]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
make some classes more readable by reversing the sense of some conditional logic
authorWilliam Victor Mote <vmote@apache.org>
Wed, 27 Aug 2003 18:35:21 +0000 (18:35 +0000)
committerWilliam Victor Mote <vmote@apache.org>
Wed, 27 Aug 2003 18:35:21 +0000 (18:35 +0000)
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@196865 13f79535-47bb-0310-9956-ffa450edef68

src/java/org/apache/fop/fo/pagination/StaticContent.java
src/java/org/apache/fop/layoutmgr/PageLayoutManager.java

index b3abbda4b15db6b76683f9eb1f05b71b4b5acc68..39c5d311783a477aa68be68e42ba57a41ec3a56e 100644 (file)
@@ -55,7 +55,6 @@ import org.apache.fop.fo.FONode;
 import org.apache.fop.fo.FOTreeVisitor;
 import org.apache.fop.apps.FOPException;
 import org.apache.fop.layoutmgr.StaticContentLayoutManager;
-import org.apache.fop.apps.*;
 
 /**
  * Class modelling the fo:static-content object. See Sec. 6.4.19 of the XSL-FO
index 4c9514116eb54915902d7120ec05589b001c347c..b9b4ae602b9db81e50eab567e245973b5855b49d 100644 (file)
@@ -467,61 +467,61 @@ public class PageLayoutManager extends AbstractLayoutManager implements Runnable
     }
 
     private void layoutStaticContent(Region region, int regionClass) {
-        if (region != null) {
-            StaticContent flow = pageSequence
-              .getStaticContent(region.getRegionName());
-            if (flow != null) {
-                RegionViewport reg = curPage.getPage()
-                  .getRegion(regionClass);
-                reg.getRegion().setIPD((int)reg.getViewArea().getWidth());
-                if (reg == null) {
-                    getLogger().error("no region viewport: shouldn't happen");
-                }
-                StaticContentLayoutManager lm = flow.getLayoutManager();
-                lm.setUserAgent(getUserAgent());
-                lm.init();
-                lm.setRegionReference(reg.getRegion());
-                lm.setParent(this);
-                LayoutContext childLC = new LayoutContext(0);
-                childLC.setStackLimit(new MinOptMax((int)curPage.getViewArea().getHeight()));
-                childLC.setRefIPD((int)reg.getViewArea().getWidth());
-
-                while (!lm.isFinished()) {
-                    BreakPoss bp = lm.getNextBreakPoss(childLC);
-                    if (bp != null) {
-                        List vecBreakPoss = new ArrayList();
-                        vecBreakPoss.add(bp);
-                        lm.addAreas(new BreakPossPosIter(vecBreakPoss, 0,
-                                                          vecBreakPoss.size()), null);
-                    } else {
-                      getLogger().error("bp==null  cls=" + regionClass);
-                    }
-                }
-                //lm.flush();
-                lm.reset(null);
+        if (region == null) {
+            return;
+        }
+        StaticContent flow = pageSequence.getStaticContent(region.getRegionName());
+        if (flow == null) {
+            return;
+        }
+        RegionViewport reg = curPage.getPage().getRegion(regionClass);
+        reg.getRegion().setIPD((int)reg.getViewArea().getWidth());
+        if (reg == null) {
+            getLogger().error("no region viewport: shouldn't happen");
+        }
+        StaticContentLayoutManager lm = flow.getLayoutManager();
+        lm.setUserAgent(getUserAgent());
+        lm.init();
+        lm.setRegionReference(reg.getRegion());
+        lm.setParent(this);
+        LayoutContext childLC = new LayoutContext(0);
+        childLC.setStackLimit(new MinOptMax((int)curPage.getViewArea().getHeight()));
+        childLC.setRefIPD((int)reg.getViewArea().getWidth());
+        while (!lm.isFinished()) {
+            BreakPoss bp = lm.getNextBreakPoss(childLC);
+            if (bp != null) {
+                List vecBreakPoss = new ArrayList();
+                vecBreakPoss.add(bp);
+                lm.addAreas(new BreakPossPosIter(vecBreakPoss, 0,
+                                                  vecBreakPoss.size()), null);
+            } else {
+              getLogger().error("bp==null  cls=" + regionClass);
             }
         }
+        //lm.flush();
+        lm.reset(null);
     }
 
     private void finishPage() {
-        if (curPage != null) {
-            // Layout static content into the regions
-            // Need help from pageseq for this
-            layoutStaticContent(currentSimplePageMaster.getRegion(Region.BEFORE),
-                                Region.BEFORE_CODE);
-            layoutStaticContent(currentSimplePageMaster.getRegion(Region.AFTER),
-                                Region.AFTER_CODE);
-            layoutStaticContent(currentSimplePageMaster.getRegion(Region.START),
-                                Region.START_CODE);
-            layoutStaticContent(currentSimplePageMaster.getRegion(Region.END),
-                                Region.END_CODE);
-            // Queue for ID resolution and rendering
-            areaTree.addPage(curPage);
-            curPage = null;
-            curBody = null;
-            curSpan = null;
-            curFlow = null;
+        if (curPage == null) {
+            return;
         }
+        // Layout static content into the regions
+        // Need help from pageseq for this
+        layoutStaticContent(currentSimplePageMaster.getRegion(Region.BEFORE),
+                            Region.BEFORE_CODE);
+        layoutStaticContent(currentSimplePageMaster.getRegion(Region.AFTER),
+                            Region.AFTER_CODE);
+        layoutStaticContent(currentSimplePageMaster.getRegion(Region.START),
+                            Region.START_CODE);
+        layoutStaticContent(currentSimplePageMaster.getRegion(Region.END),
+                            Region.END_CODE);
+        // Queue for ID resolution and rendering
+        areaTree.addPage(curPage);
+        curPage = null;
+        curBody = null;
+        curSpan = null;
+        curFlow = null;
     }
 
     /**