aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Bowditch <cbowditch@apache.org>2011-04-19 13:06:27 +0000
committerChris Bowditch <cbowditch@apache.org>2011-04-19 13:06:27 +0000
commit81125d40f04e276caa3f57e3be31da78981f2c2a (patch)
tree39e4db2fbd585227d187d1c819eb4900437af003
parent427df0fa7d2f67a4d21740cbf7264d3b11739a41 (diff)
downloadxmlgraphics-fop-81125d40f04e276caa3f57e3be31da78981f2c2a.tar.gz
xmlgraphics-fop-81125d40f04e276caa3f57e3be31da78981f2c2a.zip
Bugzilla #51008: page-number-citation-last does not work in RTF
Patch submitted by Max Aster git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@1095076 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--src/java/org/apache/fop/render/rtf/RTFHandler.java27
-rw-r--r--status.xml3
2 files changed, 30 insertions, 0 deletions
diff --git a/src/java/org/apache/fop/render/rtf/RTFHandler.java b/src/java/org/apache/fop/render/rtf/RTFHandler.java
index 35f58e170..9597c1532 100644
--- a/src/java/org/apache/fop/render/rtf/RTFHandler.java
+++ b/src/java/org/apache/fop/render/rtf/RTFHandler.java
@@ -78,6 +78,7 @@ import org.apache.fop.fo.flow.ListItemBody;
import org.apache.fop.fo.flow.ListItemLabel;
import org.apache.fop.fo.flow.PageNumber;
import org.apache.fop.fo.flow.PageNumberCitation;
+import org.apache.fop.fo.flow.PageNumberCitationLast;
import org.apache.fop.fo.flow.table.Table;
import org.apache.fop.fo.flow.table.TableBody;
import org.apache.fop.fo.flow.table.TableCell;
@@ -1447,6 +1448,26 @@ public class RTFHandler extends FOEventHandler {
throw new RuntimeException(e.getMessage());
}
}
+
+ /** {@inheritDoc} */
+ public void startPageNumberCitationLast(PageNumberCitationLast l) {
+ if (bDefer) {
+ return;
+ }
+ try {
+
+ IRtfTextrunContainer container
+ = (IRtfTextrunContainer)builderContext.getContainer(
+ IRtfTextrunContainer.class, true, this);
+ RtfTextrun textrun = container.getTextrun();
+
+ textrun.addPageNumberCitation(l.getRefId());
+
+ } catch (Exception e) {
+ log.error("startPageNumberCitationLast: " + e.getMessage());
+ throw new RuntimeException(e.getMessage());
+ }
+ }
private void prepareTable(Table tab) {
// Allows to receive the available width of the table
@@ -1641,6 +1662,12 @@ public class RTFHandler extends FOEventHandler {
} else {
endPageNumberCitation((PageNumberCitation) foNode);
}
+ } else if (foNode instanceof PageNumberCitationLast) {
+ if (bStart) {
+ startPageNumberCitationLast((PageNumberCitationLast) foNode);
+ } else {
+ endPageNumberCitationLast((PageNumberCitationLast) foNode);
+ }
} else {
RTFEventProducer eventProducer = RTFEventProducer.Provider.get(
getUserAgent().getEventBroadcaster());
diff --git a/status.xml b/status.xml
index 9378e627f..12aade2fc 100644
--- a/status.xml
+++ b/status.xml
@@ -59,6 +59,9 @@
documents. Example: the fix of marks layering will be such a case when it's done.
-->
<release version="FOP Trunk" date="TBD">
+ <action context="Renderers" dev="CB" type="fix" fixes-bug="51008" due-to="Max Aster">
+ Bugzilla 51008: page-number-citation-last does not work in RTF
+ </action>
<action context="Renderers" dev="VH" type="add">
Added id element to intermediate format to track the origin of content.
</action>