aboutsummaryrefslogtreecommitdiffstats
path: root/src/java/org
diff options
context:
space:
mode:
authorPeter Herweg <pherweg@apache.org>2006-02-05 17:39:47 +0000
committerPeter Herweg <pherweg@apache.org>2006-02-05 17:39:47 +0000
commit0eaad5d95834cff2da64d5dfa6b3a706a2034694 (patch)
treeed70a29e783033219a926e602de666fc907b630a /src/java/org
parentadd92f84f901dcdc55d7c01f0e9bb9e9ebdcfc42 (diff)
downloadxmlgraphics-fop-0eaad5d95834cff2da64d5dfa6b3a706a2034694.tar.gz
xmlgraphics-fop-0eaad5d95834cff2da64d5dfa6b3a706a2034694.zip
RTF: remove usage of TableLayoutManager; use SimplePercentBaseContext instead
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@375060 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org')
-rw-r--r--src/java/org/apache/fop/render/rtf/RTFHandler.java26
1 files changed, 17 insertions, 9 deletions
diff --git a/src/java/org/apache/fop/render/rtf/RTFHandler.java b/src/java/org/apache/fop/render/rtf/RTFHandler.java
index 47ebdfa5a..a2d0975ad 100644
--- a/src/java/org/apache/fop/render/rtf/RTFHandler.java
+++ b/src/java/org/apache/fop/render/rtf/RTFHandler.java
@@ -32,6 +32,8 @@ import org.xml.sax.SAXException;
// FOP
import org.apache.fop.apps.FOPException;
import org.apache.fop.apps.FOUserAgent;
+import org.apache.fop.datatypes.LengthBase;
+import org.apache.fop.datatypes.SimplePercentBaseContext;
import org.apache.fop.fo.FOEventHandler;
import org.apache.fop.fo.FONode;
import org.apache.fop.fo.flow.BasicLink;
@@ -63,8 +65,6 @@ import org.apache.fop.fo.pagination.SimplePageMaster;
import org.apache.fop.fo.pagination.StaticContent;
import org.apache.fop.fo.Constants;
import org.apache.fop.fo.FOText;
-import org.apache.fop.layoutmgr.table.TableContentLayoutManager;
-import org.apache.fop.layoutmgr.table.TableLayoutManager;
import org.apache.fop.render.rtf.rtflib.rtfdoc.ITableAttributes;
import org.apache.fop.render.rtf.rtflib.rtfdoc.IRtfAfterContainer;
import org.apache.fop.render.rtf.rtflib.rtfdoc.IRtfBeforeContainer;
@@ -536,15 +536,23 @@ public class RTFHandler extends FOEventHandler {
}
try {
- Table tbl = (Table) tc.getParent();
-
- TableLayoutManager tlm
- = new TableLayoutManager(tbl);
- TableContentLayoutManager tclm
- = new TableContentLayoutManager(tlm);
+ /**
+ * Pass a SimplePercentBaseContext to getValue in order to
+ * avoid a NullPointerException, which occurs when you use
+ * proportional-column-width function in column-width attribute.
+ * Of course the results won't be correct, but at least the
+ * rest of the document will be rendered. Usage of the
+ * TableLayoutManager is not welcome due to design reasons and
+ * it also does not provide the correct values.
+ * TODO: Make proportional-column-width working for rtf output
+ */
+ SimplePercentBaseContext context
+ = new SimplePercentBaseContext(null,
+ LengthBase.TABLE_UNITS,
+ 100000);
Integer iWidth
- = new Integer(tc.getColumnWidth().getValue(tclm) / 1000);
+ = new Integer(tc.getColumnWidth().getValue(context) / 1000);
String strWidth = iWidth.toString() + "pt";
Float width = new Float(