Author: adelmelle
Date: Sun Mar 27 14:32:21 2011
New Revision: 1085944
URL: http://svn.apache.org/viewvc?rev=1085944&view=rev
Log:
Properly fix the case of unresolved bookmarks for the intermediate format:
bypass serialization of the bookmarks, instead of only its action.
Modified:
xmlgraphics/fop/trunk/src/java/org/apache/fop/render/intermediate/IFSerializer.java
xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/bookmarks_1.xml
Modified:
xmlgraphics/fop/trunk/src/java/org/apache/fop/render/intermediate/IFSerializer.java
URL:
http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/render/intermediate/IFSerializer.java?rev=1085944&r1=1085943&r2=1085944&view=diff
==============================================================================
---
xmlgraphics/fop/trunk/src/java/org/apache/fop/render/intermediate/IFSerializer.java
(original)
+++
xmlgraphics/fop/trunk/src/java/org/apache/fop/render/intermediate/IFSerializer.java
Sun Mar 27 14:32:21 2011
@@ -709,7 +709,9 @@ public class IFSerializer extends Abstra
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 Abstra
}
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} */
Modified:
xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/bookmarks_1.xml
URL:
http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/bookmarks_1.xml?rev=1085944&r1=1085943&r2=1085944&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/bookmarks_1.xml
(original)
+++ xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/bookmarks_1.xml
Sun Mar 27 14:32:21 2011
@@ -44,10 +44,10 @@
</fo:bookmark>
<!-- add a reference to a non-existing id; should only trigger a
warning
see Bugzilla 50593
+ -->
<fo:bookmark internal-destination="chapterX-secX">
<fo:bookmark-title>Section X</fo:bookmark-title>
</fo:bookmark>
- -->
</fo:bookmark>
<fo:bookmark internal-destination="bc">
<fo:bookmark-title>Fixed Block Container</fo:bookmark-title>
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]