jeremias
Thu, 15 May 2008 00:07:42 -0700
Author: jeremias Date: Thu May 15 00:07:18 2008 New Revision: 656524 URL: http://svn.apache.org/viewvc?rev=656524&view=rev Log: Fixed rendering of fixed block-containers in AFP output. The break-out was actually never implemented which is necessary for supporting fixed positioned viewports. Modified: xmlgraphics/fop/branches/fop-0_95/src/java/org/apache/fop/render/afp/AFPRenderer.java xmlgraphics/fop/branches/fop-0_95/status.xml Modified: xmlgraphics/fop/branches/fop-0_95/src/java/org/apache/fop/render/afp/AFPRenderer.java URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/fop-0_95/src/java/org/apache/fop/render/afp/AFPRenderer.java?rev=656524&r1=656523&r2=656524&view=diff ============================================================================== --- xmlgraphics/fop/branches/fop-0_95/src/java/org/apache/fop/render/afp/AFPRenderer.java (original) +++ xmlgraphics/fop/branches/fop-0_95/src/java/org/apache/fop/render/afp/AFPRenderer.java Thu May 15 00:07:18 2008 @@ -464,9 +464,7 @@ } } - /** - * [EMAIL PROTECTED] - */ + /** [EMAIL PROTECTED] */ protected void renderBlockViewport(BlockViewport bv, List children) { // clip and position viewport if necessary @@ -1248,20 +1246,24 @@ } } - /** - * Restores the state stack after a break out. - * @param breakOutList the state stack to restore. - */ - public void restoreStateStackAfterBreakOut(List breakOutList) { - + /** [EMAIL PROTECTED] */ + 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; + /** [EMAIL PROTECTED] */ + 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 @@ 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; } /** Modified: xmlgraphics/fop/branches/fop-0_95/status.xml URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/fop-0_95/status.xml?rev=656524&r1=656523&r2=656524&view=diff ============================================================================== --- xmlgraphics/fop/branches/fop-0_95/status.xml (original) +++ xmlgraphics/fop/branches/fop-0_95/status.xml Thu May 15 00:07:18 2008 @@ -61,6 +61,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. </action> --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]