From: Jeremias Maerki Date: Fri, 4 Feb 2011 15:11:29 +0000 (+0000) Subject: Bugfix: Suppress generating duplicate fo:root and fo:declarations extension attachments. X-Git-Tag: fop-1_1rc1old~332 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=8312fbff3f5f45d205449be19af94203014e658c;p=xmlgraphics-fop.git Bugfix: Suppress generating duplicate fo:root and fo:declarations extension attachments. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@1067190 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/src/java/org/apache/fop/area/AreaTreeHandler.java b/src/java/org/apache/fop/area/AreaTreeHandler.java index 2729a5a0a..dd9db89a3 100644 --- a/src/java/org/apache/fop/area/AreaTreeHandler.java +++ b/src/java/org/apache/fop/area/AreaTreeHandler.java @@ -201,14 +201,19 @@ public class AreaTreeHandler extends FOEventHandler { private void startAbstractPageSequence(AbstractPageSequence pageSequence) { rootFObj = pageSequence.getRoot(); + + //Before the first page-sequence... + if (this.prevPageSeqLM == null) { + // extension attachments from fo:root + wrapAndAddExtensionAttachments(rootFObj.getExtensionAttachments()); + // extension attachments from fo:declarations + if (rootFObj.getDeclarations() != null) { + wrapAndAddExtensionAttachments(rootFObj.getDeclarations().getExtensionAttachments()); + } + } + finishPrevPageSequence(pageSequence.getInitialPageNumber()); pageSequence.initPageNumber(); - // extension attachments from fo:root - wrapAndAddExtensionAttachments(rootFObj.getExtensionAttachments()); - // extension attachments from fo:declarations - if (rootFObj.getDeclarations() != null) { - wrapAndAddExtensionAttachments(rootFObj.getDeclarations().getExtensionAttachments()); - } } private void wrapAndAddExtensionAttachments(List list) { @@ -367,6 +372,7 @@ public class AreaTreeHandler extends FOEventHandler { * @param pv a page viewport that contains the area with this ID * @deprecated use getIDTracker().associateIDWithPageViewport(id, pv) instead */ + @Deprecated public void associateIDWithPageViewport(String id, PageViewport pv) { idTracker.associateIDWithPageViewport(id, pv); } @@ -379,6 +385,7 @@ public class AreaTreeHandler extends FOEventHandler { * @param id the id of the object being processed * @deprecated use getIDTracker().signalPendingID(id) instead */ + @Deprecated public void signalPendingID(String id) { idTracker.signalPendingID(id); } @@ -391,6 +398,7 @@ public class AreaTreeHandler extends FOEventHandler { * @param id the id of the formatting object which was just finished * @deprecated use getIDTracker().signalIDProcessed(id) instead */ + @Deprecated public void signalIDProcessed(String id) { idTracker.signalIDProcessed(id); } @@ -402,6 +410,7 @@ public class AreaTreeHandler extends FOEventHandler { * @return true if the ID has been resolved * @deprecated use getIDTracker().alreadyResolvedID(id) instead */ + @Deprecated public boolean alreadyResolvedID(String id) { return idTracker.alreadyResolvedID(id); } @@ -412,6 +421,7 @@ public class AreaTreeHandler extends FOEventHandler { * @param pv page viewport whose ID refs to resolve * @deprecated use getIDTracker().tryIDResolution(pv) instead */ + @Deprecated public void tryIDResolution(PageViewport pv) { idTracker.tryIDResolution(pv); } @@ -423,6 +433,7 @@ public class AreaTreeHandler extends FOEventHandler { * @return the list of PageViewports * @deprecated use getIDTracker().getPageViewportsContainingID(id) instead */ + @Deprecated public List getPageViewportsContainingID(String id) { return idTracker.getPageViewportsContainingID(id); } @@ -434,6 +445,7 @@ public class AreaTreeHandler extends FOEventHandler { * @param res the Resolvable object needing the idref to be resolved * @deprecated use getIDTracker().addUnresolvedIDRef(idref, res) instead */ + @Deprecated public void addUnresolvedIDRef(String idref, Resolvable res) { idTracker.addUnresolvedIDRef(idref, res); }