You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-commits@xmlgraphics.apache.org by je...@apache.org on 2007/01/04 22:54:38 UTC

svn commit: r492769 - in /xmlgraphics/fop/trunk: ./ src/java/org/apache/fop/render/rtf/ src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/

Author: jeremias
Date: Thu Jan  4 13:54:38 2007
New Revision: 492769

URL: http://svn.apache.org/viewvc?view=rev&rev=492769
Log:
Bugzilla #40930:
Added support for display-align for table-cell in RTF output.

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

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/render/rtf/TableAttributesConverter.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/render/rtf/TableAttributesConverter.java?view=diff&rev=492769&r1=492768&r2=492769
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/render/rtf/TableAttributesConverter.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/render/rtf/TableAttributesConverter.java Thu Jan  4 13:54:38 2007
@@ -204,6 +204,19 @@
         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;
     }

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/ITableAttributes.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/ITableAttributes.java?view=diff&rev=492769&r1=492768&r2=492769
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/ITableAttributes.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/ITableAttributes.java Thu Jan  4 13:54:38 2007
@@ -115,6 +115,14 @@
     /** 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 @@
     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};
+    
 }

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfTableCell.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfTableCell.java?view=diff&rev=492769&r1=492768&r2=492769
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfTableCell.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfTableCell.java Thu Jan  4 13:54:38 2007
@@ -263,6 +263,7 @@
         } else {
             writeControlWord("ql");
         }
+        writeAttributes (attrib, ITableAttributes.CELL_VERT_ALIGN);
 
         writeControlWord("cellx" + xPos);
 

Modified: xmlgraphics/fop/trunk/status.xml
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/status.xml?view=diff&rev=492769&r1=492768&r2=492769
==============================================================================
--- xmlgraphics/fop/trunk/status.xml (original)
+++ xmlgraphics/fop/trunk/status.xml Thu Jan  4 13:54:38 2007
@@ -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>



---------------------------------------------------------------------
To unsubscribe, e-mail: fop-commits-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-commits-help@xmlgraphics.apache.org