Browse Source

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
tags/fop-1_1rc1old
Andreas L. Delmelle 13 years ago
parent
commit
8ba2be7b37

+ 8
- 9
src/java/org/apache/fop/render/intermediate/IFSerializer.java View File

Iterator iter = tree.getBookmarks().iterator(); Iterator iter = tree.getBookmarks().iterator();
while (iter.hasNext()) { while (iter.hasNext()) {
Bookmark b = (Bookmark)iter.next(); Bookmark b = (Bookmark)iter.next();
serializeBookmark(b);
if (b.getAction() != null) {
serializeBookmark(b);
}
} }
handler.endElement(DocumentNavigationExtensionConstants.BOOKMARK_TREE); handler.endElement(DocumentNavigationExtensionConstants.BOOKMARK_TREE);
} catch (SAXException e) { } catch (SAXException e) {
} }


private void serializeBookmark(Bookmark bookmark) throws SAXException, IFException { private void serializeBookmark(Bookmark bookmark) throws SAXException, IFException {
if (bookmark.getAction() != null) {
noteAction(bookmark.getAction());
}
noteAction(bookmark.getAction());


AttributesImpl atts = new AttributesImpl(); AttributesImpl atts = new AttributesImpl();
atts.addAttribute(null, "title", "title", XMLUtil.CDATA, bookmark.getTitle()); atts.addAttribute(null, "title", "title", XMLUtil.CDATA, bookmark.getTitle());
atts.addAttribute(null, "starting-state", "starting-state", atts.addAttribute(null, "starting-state", "starting-state",
XMLUtil.CDATA, bookmark.isShown() ? "show" : "hide"); XMLUtil.CDATA, bookmark.isShown() ? "show" : "hide");
handler.startElement(DocumentNavigationExtensionConstants.BOOKMARK, atts); handler.startElement(DocumentNavigationExtensionConstants.BOOKMARK, atts);
if (bookmark.getAction() != null) {
serializeXMLizable(bookmark.getAction());
}
serializeXMLizable(bookmark.getAction());
Iterator iter = bookmark.getChildBookmarks().iterator(); Iterator iter = bookmark.getChildBookmarks().iterator();
while (iter.hasNext()) { while (iter.hasNext()) {
Bookmark b = (Bookmark)iter.next(); Bookmark b = (Bookmark)iter.next();
serializeBookmark(b);
if (b.getAction() != null) {
serializeBookmark(b);
}
} }
handler.endElement(DocumentNavigationExtensionConstants.BOOKMARK); handler.endElement(DocumentNavigationExtensionConstants.BOOKMARK);

} }


/** {@inheritDoc} */ /** {@inheritDoc} */

+ 1
- 1
test/layoutengine/standard-testcases/bookmarks_1.xml View File

</fo:bookmark> </fo:bookmark>
<!-- add a reference to a non-existing id; should only trigger a warning <!-- add a reference to a non-existing id; should only trigger a warning
see Bugzilla 50593 see Bugzilla 50593
-->
<fo:bookmark internal-destination="chapterX-secX"> <fo:bookmark internal-destination="chapterX-secX">
<fo:bookmark-title>Section X</fo:bookmark-title> <fo:bookmark-title>Section X</fo:bookmark-title>
</fo:bookmark> </fo:bookmark>
-->
</fo:bookmark> </fo:bookmark>
<fo:bookmark internal-destination="bc"> <fo:bookmark internal-destination="bc">
<fo:bookmark-title>Fixed Block Container</fo:bookmark-title> <fo:bookmark-title>Fixed Block Container</fo:bookmark-title>

Loading…
Cancel
Save