diff options
author | Andreas L. Delmelle <adelmelle@apache.org> | 2011-03-27 14:32:21 +0000 |
---|---|---|
committer | Andreas L. Delmelle <adelmelle@apache.org> | 2011-03-27 14:32:21 +0000 |
commit | 8ba2be7b375fffc306ff6eba5e29aa90baae2fca (patch) | |
tree | 743963893cf343bea2679bde3096a68f6bc39879 /src/java | |
parent | a1bfc206713cecbf81025ce7e8dc4dde4be1c43f (diff) | |
download | xmlgraphics-fop-8ba2be7b375fffc306ff6eba5e29aa90baae2fca.tar.gz xmlgraphics-fop-8ba2be7b375fffc306ff6eba5e29aa90baae2fca.zip |
Properly fix the case of unresolved bookmarks for the intermediate format: bypass serialization of the bookmarks, instead of only its action.
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@1085944 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java')
-rw-r--r-- | src/java/org/apache/fop/render/intermediate/IFSerializer.java | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/src/java/org/apache/fop/render/intermediate/IFSerializer.java b/src/java/org/apache/fop/render/intermediate/IFSerializer.java index 64bae054c..d906d4189 100644 --- a/src/java/org/apache/fop/render/intermediate/IFSerializer.java +++ b/src/java/org/apache/fop/render/intermediate/IFSerializer.java @@ -709,7 +709,9 @@ public class IFSerializer extends AbstractXMLWritingIFDocumentHandler Iterator iter = tree.getBookmarks().iterator(); while (iter.hasNext()) { Bookmark b = (Bookmark)iter.next(); - serializeBookmark(b); + if (b.getAction() != null) { + serializeBookmark(b); + } } handler.endElement(DocumentNavigationExtensionConstants.BOOKMARK_TREE); } catch (SAXException e) { @@ -718,25 +720,22 @@ public class IFSerializer extends AbstractXMLWritingIFDocumentHandler } private void serializeBookmark(Bookmark bookmark) throws SAXException, IFException { - if (bookmark.getAction() != null) { - noteAction(bookmark.getAction()); - } + noteAction(bookmark.getAction()); AttributesImpl atts = new AttributesImpl(); atts.addAttribute(null, "title", "title", XMLUtil.CDATA, bookmark.getTitle()); atts.addAttribute(null, "starting-state", "starting-state", XMLUtil.CDATA, bookmark.isShown() ? "show" : "hide"); handler.startElement(DocumentNavigationExtensionConstants.BOOKMARK, atts); - if (bookmark.getAction() != null) { - serializeXMLizable(bookmark.getAction()); - } + serializeXMLizable(bookmark.getAction()); Iterator iter = bookmark.getChildBookmarks().iterator(); while (iter.hasNext()) { Bookmark b = (Bookmark)iter.next(); - serializeBookmark(b); + if (b.getAction() != null) { + serializeBookmark(b); + } } handler.endElement(DocumentNavigationExtensionConstants.BOOKMARK); - } /** {@inheritDoc} */ |