diff options
4 files changed, 33 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); diff --git a/status.xml b/status.xml index a8e27b53b..17c5e5df3 100644 --- a/status.xml +++ b/status.xml @@ -28,6 +28,9 @@ <changes> <release version="FOP Trunk"> + <action context="Code" dev="JM" type="add" fixes-bug="40930"> + Added support for display-align for table-cell in RTF output. + </action> <action context="Code" dev="MM" type="add"> Added support for UAX#14 type line breaking. Support does not extend across nested fo:inline elements. </action> |