]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
Fix for NPE with empty block-containers (normal-breaking3)
authorJeremias Maerki <jeremias@apache.org>
Mon, 21 Mar 2005 16:15:19 +0000 (16:15 +0000)
committerJeremias Maerki <jeremias@apache.org>
Mon, 21 Mar 2005 16:15:19 +0000 (16:15 +0000)
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/Temp_KnuthStylePageBreaking@198529 13f79535-47bb-0310-9956-ffa450edef68

src/java/org/apache/fop/layoutmgr/BlockContainerLayoutManager.java

index dc9dba36b3c29b3bc51793d5f701f0c923af3934..4c365a5531cabbff3579f327523ab6b92d6d5000 100644 (file)
@@ -329,7 +329,10 @@ public class BlockContainerLayoutManager extends BlockStackingLayoutManager
             MinOptMax range = new MinOptMax(relDims.ipd);
             BlockContainerBreaker breaker = new BlockContainerBreaker(this, range);
             breaker.doLayout(relDims.bpd);
-            boolean contentOverflows = (breaker.deferredAlg.getPageBreaks().size() > 1);
+            boolean contentOverflows = false;
+            if (!breaker.isEmpty()) {
+                contentOverflows = (breaker.deferredAlg.getPageBreaks().size() > 1);
+            }
 
             Position bcPosition = new BlockContainerPosition(this, breaker);
             returnList.add(new KnuthBox(vpContentBPD, bcPosition, false));
@@ -552,6 +555,9 @@ public class BlockContainerLayoutManager extends BlockStackingLayoutManager
         }
         
         public void addContainedAreas() {
+            if (isEmpty()) {
+                return;
+            }
             //Rendering all parts (not just the first) at once for the case where the parts that 
             //overflow should be visible.
             //TODO Check if this has any unwanted side-effects. Feels a bit like a hack.