aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorWilliam Victor Mote <vmote@apache.org>2003-08-27 18:35:21 +0000
committerWilliam Victor Mote <vmote@apache.org>2003-08-27 18:35:21 +0000
commit6d324b14306ee56338fd28deb91bcc4541709e36 (patch)
treea040aa270dcf6049c7b75618b8622ee8511b186f /src
parent107b37f14824f1ed4f378651fd4188dd5808585f (diff)
downloadxmlgraphics-fop-6d324b14306ee56338fd28deb91bcc4541709e36.tar.gz
xmlgraphics-fop-6d324b14306ee56338fd28deb91bcc4541709e36.zip
make some classes more readable by reversing the sense of some conditional logic
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@196865 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src')
-rw-r--r--src/java/org/apache/fop/fo/pagination/StaticContent.java1
-rw-r--r--src/java/org/apache/fop/layoutmgr/PageLayoutManager.java98
2 files changed, 49 insertions, 50 deletions
diff --git a/src/java/org/apache/fop/fo/pagination/StaticContent.java b/src/java/org/apache/fop/fo/pagination/StaticContent.java
index b3abbda4b..39c5d3117 100644
--- a/src/java/org/apache/fop/fo/pagination/StaticContent.java
+++ b/src/java/org/apache/fop/fo/pagination/StaticContent.java
@@ -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
diff --git a/src/java/org/apache/fop/layoutmgr/PageLayoutManager.java b/src/java/org/apache/fop/layoutmgr/PageLayoutManager.java
index 4c9514116..b9b4ae602 100644
--- a/src/java/org/apache/fop/layoutmgr/PageLayoutManager.java
+++ b/src/java/org/apache/fop/layoutmgr/PageLayoutManager.java
@@ -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;
}
/**