aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeremias Maerki <jeremias@apache.org>2005-09-05 11:44:49 +0000
committerJeremias Maerki <jeremias@apache.org>2005-09-05 11:44:49 +0000
commitf438f9f25b77e785f6512576075b98ca3c51c899 (patch)
tree5457b20dda99e1b04b46e03e4424ce3c8a6839a3
parent0cebf71726b24c24dd90134dacdf0c424044c35b (diff)
downloadxmlgraphics-fop-f438f9f25b77e785f6512576075b98ca3c51c899.tar.gz
xmlgraphics-fop-f438f9f25b77e785f6512576075b98ca3c51c899.zip
Bugzilla #36479:
Bookmarks are now working in RTF output. Submitted by: Sergey Simonchik <Sergey.Simonchik.at.borland.com> git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@278724 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--src/java/org/apache/fop/render/rtf/RTFHandler.java2
-rw-r--r--src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfBookmark.java4
-rw-r--r--src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfTextrun.java7
3 files changed, 11 insertions, 2 deletions
diff --git a/src/java/org/apache/fop/render/rtf/RTFHandler.java b/src/java/org/apache/fop/render/rtf/RTFHandler.java
index ca5da52cf..e0366dd34 100644
--- a/src/java/org/apache/fop/render/rtf/RTFHandler.java
+++ b/src/java/org/apache/fop/render/rtf/RTFHandler.java
@@ -335,6 +335,7 @@ public class RTFHandler extends FOEventHandler {
textrun.addParagraphBreak();
textrun.pushAttributes(rtfAttr);
+ textrun.addBookmark(bl.getId());
} catch (IOException ioe) {
// TODO could we throw Exception in all FOEventHandler events?
log.error("startBlock: " + ioe.getMessage());
@@ -550,6 +551,7 @@ public class RTFHandler extends FOEventHandler {
RtfTextrun textrun = container.getTextrun();
textrun.pushAttributes(rtfAttr);
+ textrun.addBookmark(inl.getId());
} catch (IOException ioe) {
log.error("startInline:" + ioe.getMessage());
throw new RuntimeException(ioe.getMessage());
diff --git a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfBookmark.java b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfBookmark.java
index d06571c26..b7970e6bb 100644
--- a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfBookmark.java
+++ b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfBookmark.java
@@ -59,8 +59,8 @@ public class RtfBookmark extends RtfElement {
* @param writer a <code>Writer</code> value
* @param bookmark Name of the bookmark
*/
- RtfBookmark (IRtfBookmarkContainer parent, Writer w, String bookmark) throws IOException {
- super ((RtfContainer) parent, w);
+ RtfBookmark (RtfContainer parent, Writer w, String bookmark) throws IOException {
+ super (parent, w);
int now = bookmark.length ();
diff --git a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfTextrun.java b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfTextrun.java
index ab6761dc4..56316bbc8 100644
--- a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfTextrun.java
+++ b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfTextrun.java
@@ -149,6 +149,13 @@ public class RtfTextrun extends RtfContainer {
return new RtfHyperLink(this, writer, attr);
}
+ public void addBookmark(String id) throws IOException {
+ if (id != "") {
+ // if id is not empty, add boormark
+ new RtfBookmark(this, writer, id);
+ }
+ }
+
public RtfExternalGraphic newImage() throws IOException {
return new RtfExternalGraphic(this, writer);
}