aboutsummaryrefslogtreecommitdiffstats
path: root/src/java/org/apache
diff options
context:
space:
mode:
authorJeremias Maerki <jeremias@apache.org>2007-01-04 21:54:38 +0000
committerJeremias Maerki <jeremias@apache.org>2007-01-04 21:54:38 +0000
commit5129ea1afdcd8505180ce04b1badfba42a8f8ddd (patch)
tree19891f8b464f5117041c2afac9379b57e94dfd45 /src/java/org/apache
parent5d7ef2812e0f1a8f87bc837e303dd98bd12307e8 (diff)
downloadxmlgraphics-fop-5129ea1afdcd8505180ce04b1badfba42a8f8ddd.tar.gz
xmlgraphics-fop-5129ea1afdcd8505180ce04b1badfba42a8f8ddd.zip
Bugzilla #40930:
Added support for display-align for table-cell in RTF output. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@492769 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org/apache')
-rw-r--r--src/java/org/apache/fop/render/rtf/TableAttributesConverter.java13
-rw-r--r--src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/ITableAttributes.java16
-rw-r--r--src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfTableCell.java1
3 files changed, 30 insertions, 0 deletions
diff --git a/src/java/org/apache/fop/render/rtf/TableAttributesConverter.java b/src/java/org/apache/fop/render/rtf/TableAttributesConverter.java
index 7b8abee67..1a42fa269 100644
--- a/src/java/org/apache/fop/render/rtf/TableAttributesConverter.java
+++ b/src/java/org/apache/fop/render/rtf/TableAttributesConverter.java
@@ -204,6 +204,19 @@ public final class TableAttributesConverter {
if (n > 1) {
attrib.set(ITableAttributes.COLUMN_SPAN, n);
}
+
+ switch (fobj.getDisplayAlign()) {
+ case Constants.EN_BEFORE:
+ attrib.set(ITableAttributes.ATTR_CELL_VERT_ALIGN_TOP);
+ break;
+ case Constants.EN_CENTER:
+ attrib.set(ITableAttributes.ATTR_CELL_VERT_ALIGN_CENTER);
+ break;
+ case Constants.EN_AFTER:
+ attrib.set(ITableAttributes.ATTR_CELL_VERT_ALIGN_BOTTOM);
+ break;
+ default: //nop
+ }
return attrib;
}
diff --git a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/ITableAttributes.java b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/ITableAttributes.java
index 3493d9ba4..e96fbbe30 100644
--- a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/ITableAttributes.java
+++ b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/ITableAttributes.java
@@ -115,6 +115,14 @@ public interface ITableAttributes {
/** cell border, right */
String CELL_BORDER_RIGHT = "clbrdrr";
+// for vertical alignment in cells
+ /** cell alignment, top */
+ String ATTR_CELL_VERT_ALIGN_TOP = "clvertalt";
+ /** cell alignment, center */
+ String ATTR_CELL_VERT_ALIGN_CENTER = "clvertalc";
+ /** cell alignment, bottom */
+ String ATTR_CELL_VERT_ALIGN_BOTTOM = "clvertalb";
+
//Table row border attributes
/** row border, top */
String ROW_BORDER_TOP = "trbrdrt";
@@ -191,4 +199,12 @@ public interface ITableAttributes {
String[] CELL_COLOR = {
CELL_SHADE, CELL_COLOR_BACKGROUND, CELL_COLOR_FOREGROUND
};
+
+ /**
+ * List of ALL vertical alignment attributes, used to select them when writing
+ * attributes
+ */
+ String[] CELL_VERT_ALIGN = {
+ ATTR_CELL_VERT_ALIGN_TOP, ATTR_CELL_VERT_ALIGN_CENTER, ATTR_CELL_VERT_ALIGN_BOTTOM};
+
}
diff --git a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfTableCell.java b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfTableCell.java
index b71a473f1..1ba590f22 100644
--- a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfTableCell.java
+++ b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfTableCell.java
@@ -263,6 +263,7 @@ public class RtfTableCell
} else {
writeControlWord("ql");
}
+ writeAttributes (attrib, ITableAttributes.CELL_VERT_ALIGN);
writeControlWord("cellx" + xPos);