aboutsummaryrefslogtreecommitdiffstats
path: root/src/java/org/apache/fop/area/BookmarkData.java
diff options
context:
space:
mode:
authorJeremias Maerki <jeremias@apache.org>2007-05-07 12:22:22 +0000
committerJeremias Maerki <jeremias@apache.org>2007-05-07 12:22:22 +0000
commit719a8a50772a780263366f9286f7f132f4561e0c (patch)
tree4c0ebcbb84750d5f42901b3315afb1f654e11655 /src/java/org/apache/fop/area/BookmarkData.java
parent283e22abdafff51ac4b5aefcdc7fe06ca9cfb61e (diff)
downloadxmlgraphics-fop-719a8a50772a780263366f9286f7f132f4561e0c.tar.gz
xmlgraphics-fop-719a8a50772a780263366f9286f7f132f4561e0c.zip
Bugzilla #42067:
Add support for exact positioning of internal PDF links. Submitted by: Paul Vinkenoog <paul.at.vinkenoog.nl> git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@535866 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org/apache/fop/area/BookmarkData.java')
-rw-r--r--src/java/org/apache/fop/area/BookmarkData.java43
1 files changed, 36 insertions, 7 deletions
diff --git a/src/java/org/apache/fop/area/BookmarkData.java b/src/java/org/apache/fop/area/BookmarkData.java
index 8ef1e6086..d87b38592 100644
--- a/src/java/org/apache/fop/area/BookmarkData.java
+++ b/src/java/org/apache/fop/area/BookmarkData.java
@@ -61,7 +61,7 @@ public class BookmarkData extends AbstractOffDocumentItem implements Resolvable
whenToProcess = END_OF_DOC;
// top level defined in Rec to show all child bookmarks
bShow = true;
-
+
for (int count = 0; count < bookmarkTree.getBookmarks().size(); count++) {
Bookmark bkmk = (Bookmark)(bookmarkTree.getBookmarks()).get(count);
addSubData(createBookmarkData(bkmk));
@@ -84,6 +84,34 @@ public class BookmarkData extends AbstractOffDocumentItem implements Resolvable
}
/**
+ * Create a new bookmark data root object.
+ * This constructor is called by the AreaTreeParser when the
+ * <bookmarkTree> element is read from the XML file
+ */
+ public BookmarkData() {
+ idRef = null;
+ whenToProcess = END_OF_DOC;
+ bShow = true;
+ }
+
+ /**
+ * Create a new bookmark data object.
+ * This constructor is called by the AreaTreeParser when a
+ * <bookmark> element is read from the XML file.
+ *
+ * @param title the bookmark's title
+ * @param showChildren whether to initially display the bookmark's children
+ * @param pv the target PageViewport
+ * @param idRef the target ID
+ */
+ public BookmarkData(String title, boolean showChildren, PageViewport pv, String idRef) {
+ bookmarkTitle = title;
+ bShow = showChildren;
+ pageRef = pv;
+ this.idRef = idRef;
+ }
+
+ /**
* Get the idref for this bookmark-item
*
* @return the idref for the bookmark-item
@@ -93,17 +121,19 @@ public class BookmarkData extends AbstractOffDocumentItem implements Resolvable
}
/**
- * Add the child bookmark data object.
+ * Add a child bookmark data object.
* This adds a child bookmark in the bookmark hierarchy.
*
* @param sub the child bookmark data
*/
public void addSubData(BookmarkData sub) {
subData.add(sub);
- unresolvedIDRefs.put(sub.getIDRef(), sub);
- String[] ids = sub.getIDRefs();
- for (int count = 0; count < ids.length; count++) {
- unresolvedIDRefs.put(ids[count], sub);
+ if (sub.pageRef == null || sub.pageRef.equals("")) {
+ unresolvedIDRefs.put(sub.getIDRef(), sub);
+ String[] ids = sub.getIDRefs();
+ for (int count = 0; count < ids.length; count++) {
+ unresolvedIDRefs.put(ids[count], sub);
+ }
}
}
@@ -221,4 +251,3 @@ public class BookmarkData extends AbstractOffDocumentItem implements Resolvable
}
}
-