]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
Properly fix the case of unresolved bookmarks for the intermediate format: bypass...
authorAndreas L. Delmelle <adelmelle@apache.org>
Sun, 27 Mar 2011 14:32:21 +0000 (14:32 +0000)
committerAndreas L. Delmelle <adelmelle@apache.org>
Sun, 27 Mar 2011 14:32:21 +0000 (14:32 +0000)
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@1085944 13f79535-47bb-0310-9956-ffa450edef68

src/java/org/apache/fop/render/intermediate/IFSerializer.java
test/layoutengine/standard-testcases/bookmarks_1.xml

index 64bae054c5fdcb21f10292fa476d2d4fe85be92d..d906d41897ab92e8d52ff4e1ab4e4b62617d4f16 100644 (file)
@@ -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} */
index 5b9b23718d5f0bb20026f325e202e64677c24415..85cb80cc3ba5e06a0579aace7cbd36f4a17ddaf8 100644 (file)
           </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>