]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
Fixed rendering of fixed block-containers in AFP output. The break-out was actually...
authorJeremias Maerki <jeremias@apache.org>
Thu, 15 May 2008 07:07:18 +0000 (07:07 +0000)
committerJeremias Maerki <jeremias@apache.org>
Thu, 15 May 2008 07:07:18 +0000 (07:07 +0000)
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/fop-0_95@656524 13f79535-47bb-0310-9956-ffa450edef68

src/java/org/apache/fop/render/afp/AFPRenderer.java
status.xml

index cbf0beb3a78acc166e65e878f17f712a6707a0a9..dc92e0377d3758b4d79d1ec983909f25fda82394 100644 (file)
@@ -464,9 +464,7 @@ public class AFPRenderer extends AbstractPathOrientedRenderer {
         }
     }
 
-    /**
-     * {@inheritDoc}
-     */
+    /** {@inheritDoc} */
     protected void renderBlockViewport(BlockViewport bv, List children) {
         // clip and position viewport if necessary
 
@@ -1248,20 +1246,24 @@ public class AFPRenderer extends AbstractPathOrientedRenderer {
         }
     }
 
-    /**
-     * Restores the state stack after a break out.
-     * @param breakOutList the state stack to restore.
-     */
-    public void restoreStateStackAfterBreakOut(List breakOutList) {
-
+    /** {@inheritDoc} */
+    public List breakOutOfStateStack() {
+        log.debug("Block.FIXED --> break out");
+        List breakOutList = new java.util.ArrayList();
+        //Don't pop the last ViewPortPos (created by renderPage())
+        while (this.viewPortPositions.size() > 1) {
+            breakOutList.add(0, popViewPortPos());
+        }
+        return breakOutList;
     }
 
-    /**
-     * Breaks out of the state stack to handle fixed block-containers.
-     * @return the saved state stack to recreate later
-     */
-    public List breakOutOfStateStack() {
-        return null;
+    /** {@inheritDoc} */
+    public void restoreStateStackAfterBreakOut(List breakOutList) {
+        log.debug("Block.FIXED --> restoring context after break-out");
+        for (int i = 0, c = breakOutList.size(); i < c; i++) {
+            ViewPortPos vps = (ViewPortPos)breakOutList.get(i);
+            pushViewPortPos(vps);
+        }
     }
 
     /** Saves the graphics state of the rendering engine. */
@@ -1784,12 +1786,13 @@ public class AFPRenderer extends AbstractPathOrientedRenderer {
         afpDataStream.setOffsets(vpp.x, vpp.y, vpp.rot);
     }
 
-    private void popViewPortPos() {
-        viewPortPositions.remove(viewPortPositions.size() - 1);
+    private ViewPortPos popViewPortPos() {
+        ViewPortPos current = (ViewPortPos)viewPortPositions.remove(viewPortPositions.size() - 1);
         if (viewPortPositions.size() > 0) {
             ViewPortPos vpp = (ViewPortPos)viewPortPositions.get(viewPortPositions.size() - 1);
             afpDataStream.setOffsets(vpp.x, vpp.y, vpp.rot);
         }
+        return current;
     }
 
     /**
index 7b5965defbb5486bd741defff851b7962adcdb78..8ab5c8710af938c63638a5abea29684689bde27f 100644 (file)
@@ -60,6 +60,9 @@
       -->
     <!--/release-->
     <release version="0.95" date="TBD">
+      <action context="Renderers" dev="JM" type="fix">
+        Fixed rendering of fixed block-containers in AFP output.
+      </action>
       <action context="Renderers" dev="JM" type="fix">
         Fixed regression causing bad positioning of block-containers if used as descendant
         of a table-cell.