aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas L. Delmelle <adelmelle@apache.org>2011-03-26 23:08:43 +0000
committerAndreas L. Delmelle <adelmelle@apache.org>2011-03-26 23:08:43 +0000
commit8c443ea8862b9a8258829f9c80790151d06fd2b0 (patch)
tree95440ae8646a327d1d64aff5a497f69c049f77c9
parent767b2ba1cc657aa1f974836f6e5f1d5d9558fd18 (diff)
downloadxmlgraphics-fop-8c443ea8862b9a8258829f9c80790151d06fd2b0.tar.gz
xmlgraphics-fop-8c443ea8862b9a8258829f9c80790151d06fd2b0.zip
Fixed regression introduced by Bugzilla 50593: bookmarks pointing to a non-existing internal destination should just trigger a warning.
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@1085824 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--src/java/org/apache/fop/area/AreaTreeHandler.java2
-rw-r--r--src/java/org/apache/fop/render/intermediate/IFSerializer.java8
-rw-r--r--status.xml4
-rw-r--r--test/layoutengine/standard-testcases/bookmarks_1.xml6
4 files changed, 17 insertions, 3 deletions
diff --git a/src/java/org/apache/fop/area/AreaTreeHandler.java b/src/java/org/apache/fop/area/AreaTreeHandler.java
index 0e2b8bf71..f45245bfe 100644
--- a/src/java/org/apache/fop/area/AreaTreeHandler.java
+++ b/src/java/org/apache/fop/area/AreaTreeHandler.java
@@ -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(
diff --git a/src/java/org/apache/fop/render/intermediate/IFSerializer.java b/src/java/org/apache/fop/render/intermediate/IFSerializer.java
index 3e178d3cb..64bae054c 100644
--- a/src/java/org/apache/fop/render/intermediate/IFSerializer.java
+++ b/src/java/org/apache/fop/render/intermediate/IFSerializer.java
@@ -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();
diff --git a/status.xml b/status.xml
index 3e8f4aa3e..8c34f688e 100644
--- a/status.xml
+++ b/status.xml
@@ -59,6 +59,10 @@
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.
diff --git a/test/layoutengine/standard-testcases/bookmarks_1.xml b/test/layoutengine/standard-testcases/bookmarks_1.xml
index b4aa0990d..b22bf79b3 100644
--- a/test/layoutengine/standard-testcases/bookmarks_1.xml
+++ b/test/layoutengine/standard-testcases/bookmarks_1.xml
@@ -42,6 +42,12 @@
<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>