Index: AbstractLayoutManager.java =================================================================== RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/layoutmgr/AbstractLayoutManager.java,v retrieving revision 1.35 diff -u -r1.35 AbstractLayoutManager.java --- AbstractLayoutManager.java 24 Dec 2004 12:06:26 -0000 1.35 +++ AbstractLayoutManager.java 3 Feb 2005 20:50:27 -0000 @@ -1,5 +1,5 @@ /* - * Copyright 1999-2004 The Apache Software Foundation. + * Copyright 1999-2005 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -48,6 +48,7 @@ /** True if this LayoutManager has handled all of its content. */ private boolean bFinished = false; protected boolean bInited = false; + protected boolean bBogus = false; /** child LM and child LM iterator during getNextBreakPoss phase */ protected LayoutManager curChildLM = null; @@ -149,6 +150,14 @@ return false; } + public boolean isBogus() { + if (getParent().isBogus()) { + return true; + } else { + return bBogus; + } + } + /** * Add a child area to the current area. If this causes the maximum * dimension of the current area to be exceeded, the parent LM is called @@ -263,6 +272,9 @@ } + /** + * @see org.apache.fop.layoutmgr.LayoutManager#addAreas(org.apache.fop.layoutmgr.PositionIterator, org.apache.fop.layoutmgr.LayoutContext) + */ public void addAreas(PositionIterator posIter, LayoutContext context) { } @@ -276,6 +288,9 @@ * interface which are declared abstract in AbstractLayoutManager. * ---------------------------------------------------------*/ + /** + * @see org.apache.fop.layoutmgr.LayoutManager#getParentArea(org.apache.fop.area.Area) + */ public Area getParentArea(Area childArea) { return null; } @@ -309,7 +324,7 @@ * If the id string is not null then add the id to the current page. */ protected void addID(String foID) { - if (foID != null) { + if (foID != null && foID.length() > 0) { addIDToPage(foID); } } Index: BlockLayoutManager.java =================================================================== RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/layoutmgr/BlockLayoutManager.java,v retrieving revision 1.40 diff -u -r1.40 BlockLayoutManager.java --- BlockLayoutManager.java 1 Feb 2005 14:18:28 -0000 1.40 +++ BlockLayoutManager.java 3 Feb 2005 20:50:28 -0000 @@ -285,13 +285,18 @@ LayoutContext layoutContext) { getParentArea(null); + BreakPoss bp1 = (BreakPoss)parentIter.peekNext(); + bBogus = !bp1.generatesAreas(); + // if adjusted space before double adjust = layoutContext.getSpaceAdjust(); addBlockSpacing(adjust, foBlockSpaceBefore); foBlockSpaceBefore = null; - addID(fobj.getId()); - addMarkers(true, true); + if (!isBogus()) { + addID(fobj.getId()); + addMarkers(true, true); + } try { LayoutManager childLM; @@ -311,7 +316,9 @@ } } } finally { - addMarkers(false, true); + if (!isBogus()) { + addMarkers(false, true); + } flush(); // if adjusted space after Index: BreakPoss.java =================================================================== RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/layoutmgr/BreakPoss.java,v retrieving revision 1.7 diff -u -r1.7 BreakPoss.java --- BreakPoss.java 26 Jan 2005 14:54:52 -0000 1.7 +++ BreakPoss.java 3 Feb 2005 20:50:28 -0000 @@ -187,6 +187,10 @@ return ((flags & ALL_ARE_SUPPRESS_AT_LB) != 0); } + public boolean generatesAreas() { + return /*true ||*/ !(nextBreakOverflows() && getStackingSize().opt <= 0); + } + public SpaceSpecifier getLeadingSpace() { return spaceSpecLeading; } Index: ContentLayoutManager.java =================================================================== RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/layoutmgr/ContentLayoutManager.java,v retrieving revision 1.18 diff -u -r1.18 ContentLayoutManager.java --- ContentLayoutManager.java 24 Dec 2004 12:06:26 -0000 1.18 +++ ContentLayoutManager.java 3 Feb 2005 20:50:29 -0000 @@ -159,6 +159,10 @@ return true; } + public boolean isBogus() { + return false; + } + /** @see org.apache.fop.layoutmgr.LayoutManager */ public Area getParentArea(Area childArea) { return holder; @@ -370,5 +374,6 @@ int alignment) { return null; } + } Index: LayoutManager.java =================================================================== RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/layoutmgr/LayoutManager.java,v retrieving revision 1.17 diff -u -r1.17 LayoutManager.java --- LayoutManager.java 24 Dec 2004 12:06:26 -0000 1.17 +++ LayoutManager.java 3 Feb 2005 20:50:30 -0000 @@ -71,6 +71,8 @@ */ boolean generatesInlineAreas(); + boolean isBogus(); + /** * Return true if the next area which would be generated by this * LayoutManager could start a new line (or flow for block-level FO). Index: PageSequenceLayoutManager.java =================================================================== RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/layoutmgr/PageSequenceLayoutManager.java,v retrieving revision 1.26 diff -u -r1.26 PageSequenceLayoutManager.java --- PageSequenceLayoutManager.java 3 Feb 2005 20:45:33 -0000 1.26 +++ PageSequenceLayoutManager.java 3 Feb 2005 20:50:33 -0000 @@ -242,6 +242,10 @@ fobj.setCurrentPageNumber(getPageCount()); } + public boolean isBogus() { + return false; + } + /** * Get the next break possibility. * This finds the next break for a page which is always at the end Index: PositionIterator.java =================================================================== RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/layoutmgr/PositionIterator.java,v retrieving revision 1.3 diff -u -r1.3 PositionIterator.java --- PositionIterator.java 21 Mar 2004 12:03:08 -0000 1.3 +++ PositionIterator.java 3 Feb 2005 20:50:33 -0000 @@ -84,13 +84,14 @@ if (bHasNext) { Object retObj = getPos(nextObj); lookAhead(); + //System.out.println(retObj); return retObj; } else { throw new NoSuchElementException("PosIter"); } } - protected Object peekNext() { + public Object peekNext() { return nextObj; } Index: table/Cell.java =================================================================== RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/layoutmgr/table/Cell.java,v retrieving revision 1.13 diff -u -r1.13 Cell.java --- table/Cell.java 31 Jan 2005 13:52:12 -0000 1.13 +++ table/Cell.java 3 Feb 2005 20:50:34 -0000 @@ -175,7 +175,12 @@ public void addAreas(PositionIterator parentIter, LayoutContext layoutContext) { getParentArea(null); - addID(fobj.getId()); + BreakPoss bp1 = (BreakPoss)parentIter.peekNext(); + bBogus = !bp1.generatesAreas(); + + if (!isBogus()) { + addID(fobj.getId()); + } LayoutManager childLM; int iStartPos = 0; Index: table/Row.java =================================================================== RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/layoutmgr/table/Row.java,v retrieving revision 1.16 diff -u -r1.16 Row.java --- table/Row.java 31 Jan 2005 21:16:45 -0000 1.16 +++ table/Row.java 3 Feb 2005 20:50:34 -0000 @@ -278,7 +278,11 @@ public void addAreas(PositionIterator parentIter, LayoutContext layoutContext) { getParentArea(null); - addID(fobj.getId()); + BreakPoss bp1 = (BreakPoss)parentIter.peekNext(); + bBogus = !bp1.generatesAreas(); + if (!isBogus()) { + addID(fobj.getId()); + } Cell childLM; int iStartPos = 0;