]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
When I first saw this it surprised me, it seems to have been here for quite some...
authorAdrian Cumiskey <acumiskey@apache.org>
Thu, 14 Feb 2008 10:12:48 +0000 (10:12 +0000)
committerAdrian Cumiskey <acumiskey@apache.org>
Thu, 14 Feb 2008 10:12:48 +0000 (10:12 +0000)
The code block directly following this if/else condition was identical so I removed the copy/paste duplication and refactored it.

git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@627698 13f79535-47bb-0310-9956-ffa450edef68

src/java/org/apache/fop/render/AbstractRenderer.java

index 86820066fd7812ad0d195879cf4727206911c478..32c4b33c4b5d233cf122d87dfb8889c18efe43e8 100644 (file)
@@ -171,15 +171,7 @@ public abstract class AbstractRenderer
         return this.currentPageViewport;
     }
     
-    /**
-     * Prepare a page for rendering. This is called if the renderer supports
-     * out of order rendering. The renderer should prepare the page so that a
-     * page further on in the set of pages can be rendered. The body of the
-     * page should not be rendered. The page will be rendered at a later time
-     * by the call to render page.
-     *
-     * {@inheritDoc}
-     */
+    /** {@inheritDoc} */
     public void preparePage(PageViewport page) { }
 
     /**
@@ -562,31 +554,20 @@ public abstract class AbstractRenderer
             int saveIP = currentIPPosition;
             int saveBP = currentBPPosition;
 
-            if (block.getPositioning() == Block.ABSOLUTE) {
-                currentIPPosition += block.getXOffset();
-                currentBPPosition += block.getYOffset();
-                currentBPPosition += block.getSpaceBefore();
+            currentIPPosition += block.getXOffset();
+            currentBPPosition += block.getYOffset();
+            currentBPPosition += block.getSpaceBefore();
 
-                handleBlockTraits(block);
+            handleBlockTraits(block);
 
-                if (children != null) {
-                    renderBlocks(block, children);
-                }
+            if (children != null) {
+                renderBlocks(block, children);
+            }
 
+            if (block.getPositioning() == Block.ABSOLUTE) {
                 // absolute blocks do not effect the layout
                 currentBPPosition = saveBP;
             } else {
-                // relative blocks are offset
-                currentIPPosition += block.getXOffset();
-                currentBPPosition += block.getYOffset();
-                currentBPPosition += block.getSpaceBefore();
-
-                handleBlockTraits(block);
-
-                if (children != null) {
-                    renderBlocks(block, children);
-                }
-
                 // stacked and relative blocks effect stacking
                 currentIPPosition = saveIP;
                 currentBPPosition = saveBP + block.getAllocBPD();