]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
Bugzilla #40930:
authorJeremias Maerki <jeremias@apache.org>
Thu, 4 Jan 2007 21:54:38 +0000 (21:54 +0000)
committerJeremias Maerki <jeremias@apache.org>
Thu, 4 Jan 2007 21:54:38 +0000 (21:54 +0000)
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

src/java/org/apache/fop/render/rtf/TableAttributesConverter.java
src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/ITableAttributes.java
src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfTableCell.java
status.xml

index 7b8abee67b320bf41d9b62ef706d832bbcbaed38..1a42fa2691201d207ac6a2530b88c581ced34683 100644 (file)
@@ -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;
     }
index 3493d9ba4c3cf578d60a8fb690c4cb51b84d421f..e96fbbe300bd11caddd0379be712ad19bd896289 100644 (file)
@@ -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};
+    
 }
index b71a473f16738c7ae6cc993d19831abd41b33a1c..1ba590f22b3d3270bf4374c1f9b9bf39c1fe5fc0 100644 (file)
@@ -263,6 +263,7 @@ public class RtfTableCell
         } else {
             writeControlWord("ql");
         }
+        writeAttributes (attrib, ITableAttributes.CELL_VERT_ALIGN);
 
         writeControlWord("cellx" + xPos);
 
index a8e27b53bcd2b4879ca082a89101c2ce07b4adfd..17c5e5df311bc6c212e708e4eac51aa2ee17c5ce 100644 (file)
@@ -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>