aboutsummaryrefslogtreecommitdiffstats
path: root/src/java/org/apache/fop/render/rtf/TableAttributesConverter.java
diff options
context:
space:
mode:
authorJeremias Maerki <jeremias@apache.org>2003-11-08 19:31:41 +0000
committerJeremias Maerki <jeremias@apache.org>2003-11-08 19:31:41 +0000
commit3415cc316ddd8a44514553b582f2bd162831b204 (patch)
tree44afe51acf597bda5c8493d03c62981e7367ceff /src/java/org/apache/fop/render/rtf/TableAttributesConverter.java
parent926caf5957bb9815413f97ddb00e55b5c8920fdc (diff)
downloadxmlgraphics-fop-3415cc316ddd8a44514553b582f2bd162831b204.tar.gz
xmlgraphics-fop-3415cc316ddd8a44514553b582f2bd162831b204.zip
RTF: Add support for number-rows-spanned, height (at table-row) and margin-left
(at table and block). Submitted By: Peter Herweg <pherweg@web.de> git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@196999 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org/apache/fop/render/rtf/TableAttributesConverter.java')
-rw-r--r--src/java/org/apache/fop/render/rtf/TableAttributesConverter.java39
1 files changed, 29 insertions, 10 deletions
diff --git a/src/java/org/apache/fop/render/rtf/TableAttributesConverter.java b/src/java/org/apache/fop/render/rtf/TableAttributesConverter.java
index 3a08ee0c0..650851e4b 100644
--- a/src/java/org/apache/fop/render/rtf/TableAttributesConverter.java
+++ b/src/java/org/apache/fop/render/rtf/TableAttributesConverter.java
@@ -104,7 +104,34 @@ public class TableAttributesConverter {
//////////////////////////////////////////////////
// @@ Static converter methods
//////////////////////////////////////////////////
+ /**
+ * Converts table-only attributes to rtf attributes.
+ *
+ * @param attrs Given attributes
+ * @param defaultAttributes Default rtf attributes
+ *
+ * @return All valid rtf attributes together
+ *
+ * @throws ConverterException On convertion error
+ */
+ static RtfAttributes convertTableAttributes(PropertyList properties)
+ throws FOPException {
+ RtfAttributes attrib = new RtfAttributes();
+ LengthProperty lengthProp=null;
+ // margin-left
+ lengthProp=(LengthProperty)properties.get("margin-left");
+ if (lengthProp != null) {
+ Float f = new Float(lengthProp.getLength().getValue() / 1000f);
+ final String sValue = f.toString() + "pt";
+
+ attrib.set(
+ ITableAttributes.ATTR_ROW_LEFT_INDENT,
+ (int)FoUnitsConverter.getInstance().convertToTwips(sValue));
+ }
+
+ return attrib;
+ }
/**
* Converts cell attributes to rtf attributes.
@@ -115,7 +142,7 @@ public class TableAttributesConverter {
*
* @throws ConverterException On convertion error
*/
- static RtfAttributes convertCellAttributes(PropertyList props, PropertyList defProps)
+ static RtfAttributes convertCellAttributes(PropertyList props)
throws FOPException {
Property p;
@@ -124,11 +151,7 @@ public class TableAttributesConverter {
RtfAttributes attrib = null;
- if (defProps != null) {
- attrib = convertCellAttributes(defProps, null);
- } else {
attrib = new RtfAttributes();
- }
boolean isBorderPresent = false;
@@ -269,7 +292,7 @@ public class TableAttributesConverter {
* @throws ConverterException On convertion error
*/
static RtfAttributes convertRowAttributes(PropertyList props,
- PropertyList defProps, RtfAttributes rtfatts)
+ RtfAttributes rtfatts)
throws FOPException {
Property p;
@@ -278,14 +301,10 @@ public class TableAttributesConverter {
RtfAttributes attrib = null;
- if (defProps != null) {
- attrib = convertRowAttributes(defProps, null, rtfatts);
- } else {
if (rtfatts == null) {
attrib = new RtfAttributes();
} else {
attrib = rtfatts;
- }
}
String attrValue;