]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
Fixed regression introduced by Bugzilla 50593: bookmarks pointing to a non-existing...
authorAndreas L. Delmelle <adelmelle@apache.org>
Sat, 26 Mar 2011 23:08:43 +0000 (23:08 +0000)
committerAndreas L. Delmelle <adelmelle@apache.org>
Sat, 26 Mar 2011 23:08:43 +0000 (23:08 +0000)
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@1085824 13f79535-47bb-0310-9956-ffa450edef68

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

index 0e2b8bf71fc648ff2948f922535f556eb9b5e6e1..f45245bfecffd3ff465001ae4af53771da52d84f 100644 (file)
@@ -336,7 +336,7 @@ public class AreaTreeHandler extends FOEventHandler {
             String[] ids = res.getIDRefs();
             for (String id : ids) {
                 List<PageViewport> pageVPList = idTracker.getPageViewportsContainingID(id);
-                if (pageVPList != null) {
+                if (pageVPList != null && !pageVPList.isEmpty()) {
                     res.resolveIDRef(id, pageVPList);
                 } else {
                     AreaEventProducer eventProducer = AreaEventProducer.Provider.get(
index 3e178d3cb7aebdbf967760c39a771969d9b5a75e..64bae054c5fdcb21f10292fa476d2d4fe85be92d 100644 (file)
@@ -718,14 +718,18 @@ public class IFSerializer extends AbstractXMLWritingIFDocumentHandler
     }
 
     private void serializeBookmark(Bookmark bookmark) throws SAXException, IFException {
-        noteAction(bookmark.getAction());
+        if (bookmark.getAction() != null) {
+            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);
-        serializeXMLizable(bookmark.getAction());
+        if (bookmark.getAction() != null) {
+            serializeXMLizable(bookmark.getAction());
+        }
         Iterator iter = bookmark.getChildBookmarks().iterator();
         while (iter.hasNext()) {
             Bookmark b = (Bookmark)iter.next();
index 3e8f4aa3eacb600769185c0f4b50e3747750f439..8c34f688e679df666e8a19395b44c8db51c4d504 100644 (file)
       documents. Example: the fix of marks layering will be such a case when it's done.
     -->
     <release version="FOP Trunk" date="TBD">
+      <action context="Code" dev="AD" type="fix" fixes-bug="50593">
+        Fixed regression introduced by Bugzilla 50593: bookmarks pointing to a non-existing
+        internal destination should just trigger a warning.
+      </action>
       <action context="Layout" dev="AD" type="fix" fixes-bug="50965" due-to="Martin Koegler">
         Bugzilla 50965: Fixed a regression in BlockContainerLayoutManager where margins were
         no longer reset after forced breaks.
index b4aa0990dc5dea661b11264011abb0736997e666..b22bf79b30208f1e263651992f3d28c0795606cb 100644 (file)
           <fo:bookmark internal-destination="chapter2-sec2">
             <fo:bookmark-title>Section 2</fo:bookmark-title>
           </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>