aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfFootnote.java29
-rw-r--r--src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfHeader.java17
2 files changed, 37 insertions, 9 deletions
diff --git a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfFootnote.java b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfFootnote.java
index 3594655c1..67f583f86 100644
--- a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfFootnote.java
+++ b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfFootnote.java
@@ -60,23 +60,28 @@ import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfTextrun;
/** Model of an RTF footnote
* @author Peter Herweg, pherweg@web.de
+ * @author Marc Wilhelm Kuester
*/
public class RtfFootnote extends RtfContainer
- implements IRtfTextrunContainer {
+ implements IRtfTextrunContainer, IRtfListContainer {
RtfTextrun textrunInline = null;
- RtfTextrun textrunBody = null;
+ RtfContainer body = null;
+ RtfList list = null;
boolean bBody = false;
/** Create an RTF list item as a child of given container with default attributes */
RtfFootnote(RtfContainer parent, Writer w) throws IOException {
super(parent, w);
textrunInline = new RtfTextrun(this, writer, null);
- textrunBody = new RtfTextrun(this, writer, null);
+ body = new RtfContainer(this, writer);
}
public RtfTextrun getTextrun() throws IOException {
if (bBody) {
- return textrunBody;
+ RtfTextrun textrun = RtfTextrun.getTextrun(body, writer, null);
+ textrun.setSuppressLastPar(true);
+
+ return textrun;
} else {
return textrunInline;
}
@@ -91,11 +96,23 @@ public class RtfFootnote extends RtfContainer
writeGroupMark(true);
writeControlWord("footnote");
- writeControlWord("ftnalt");
- textrunBody.writeRtfContent();
+ writeControlWord("ftnallt");
+
+ body.writeRtfContent();
+
writeGroupMark(false);
}
+ public RtfList newList(RtfAttributes attrs) throws IOException {
+ if (list != null) {
+ list.close();
+ }
+
+ list = new RtfList(body, writer, attrs);
+
+ return list;
+ }
+
public void startBody() {
bBody = true;
}
diff --git a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfHeader.java b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfHeader.java
index 7051b195a..b30518d1c 100644
--- a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfHeader.java
+++ b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfHeader.java
@@ -68,6 +68,7 @@ import java.io.IOException;
/** RTF file header, contains style, font and other document-level information.
* @author Bertrand Delacretaz bdelacretaz@codeconsult.ch
* @author Andreas Putz a.putz@skynamics.com
+ * @author Marc Wilhelm Kuester
*/
class RtfHeader extends RtfContainer {
@@ -87,9 +88,9 @@ class RtfHeader extends RtfContainer {
writeUserProperties();
RtfColorTable.getInstance().writeColors(this);
super.writeRtfContent();
- RtfTemplate.getInstance().writeTemplate(this);
- RtfStyleSheetTable.getInstance().writeStyleSheet(this);
-
+ RtfTemplate.getInstance().writeTemplate(this);
+ RtfStyleSheetTable.getInstance().writeStyleSheet(this);
+ writeFootnoteProperties();
}
/** write user properties if any */
@@ -127,4 +128,14 @@ class RtfHeader extends RtfContainer {
void writeRtfString(String toWrite) throws IOException {
RtfStringConverter.getInstance().writeRtfString(writer, toWrite);
}
+
+ /**
+ *write properties for footnote handling
+ */
+ private void writeFootnoteProperties() throws IOException {
+ writeControlWord("fet0"); //footnotes, not endnotes
+ writeControlWord("ftnbj"); //place footnotes at the end of the
+ //page (should be the default, but
+ //Word 2000 thinks otherwise)
+ }
}