You are viewing a plain text version of this content. The canonical link for it is here.
Posted to doxia-commits@maven.apache.org by vs...@apache.org on 2009/08/30 13:01:10 UTC

svn commit: r809309 - in /maven/doxia/doxia/trunk/doxia-modules/doxia-module-fo/src: main/java/org/apache/maven/doxia/module/fo/FoSink.java test/java/org/apache/maven/doxia/module/fo/FoSinkTest.java

Author: vsiveton
Date: Sun Aug 30 11:01:10 2009
New Revision: 809309

URL: http://svn.apache.org/viewvc?rev=809309&view=rev
Log:
o removed FOP hack to center the table (fixed in fop 0.95)

Modified:
    maven/doxia/doxia/trunk/doxia-modules/doxia-module-fo/src/main/java/org/apache/maven/doxia/module/fo/FoSink.java
    maven/doxia/doxia/trunk/doxia-modules/doxia-module-fo/src/test/java/org/apache/maven/doxia/module/fo/FoSinkTest.java

Modified: maven/doxia/doxia/trunk/doxia-modules/doxia-module-fo/src/main/java/org/apache/maven/doxia/module/fo/FoSink.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-modules/doxia-module-fo/src/main/java/org/apache/maven/doxia/module/fo/FoSink.java?rev=809309&r1=809308&r2=809309&view=diff
==============================================================================
--- maven/doxia/doxia/trunk/doxia-modules/doxia-module-fo/src/main/java/org/apache/maven/doxia/module/fo/FoSink.java (original)
+++ maven/doxia/doxia/trunk/doxia-modules/doxia-module-fo/src/main/java/org/apache/maven/doxia/module/fo/FoSink.java Sun Aug 30 11:01:10 2009
@@ -938,22 +938,13 @@
         String content = this.tableContentWriterStack.removeLast().toString();
 
         StringBuffer sb = new StringBuffer();
-        // FOP hack to center the table, see
-        // http://xmlgraphics.apache.org/fop/fo.html#fo-center-table-horizon
-        sb.append( "<fo:table-column column-width=\"proportional-column-width(1)\"/>" );
-        sb.append( EOL );
-
         int cellCount = Integer.parseInt( this.cellCountStack.removeLast().toString() );
-        int percent = 100 / cellCount;
         for ( int i = 0; i < cellCount; i++ )
         {
-            sb.append( "<fo:table-column column-width=\"" + percent + "%\"/>" );
+            sb.append( "<fo:table-column column-width=\"proportional-column-width(1)\"/>" );
             sb.append( EOL );
         }
 
-        sb.append( "<fo:table-column column-width=\"proportional-column-width(1)\"/>" );
-        sb.append( EOL );
-
         int index = content.indexOf( ">" ) + 1;
         writeln( content.substring( 0, index ) );
         write( sb.toString() );
@@ -1071,7 +1062,7 @@
 
         // the column-number is needed for the hack to center the table, see tableRows.
         int cellCount = Integer.parseInt( this.cellCountStack.getLast().toString() );
-        cellAtts.addAttribute( "column-number", String.valueOf( cellCount + 2 ) );
+        cellAtts.addAttribute( "column-number", String.valueOf( cellCount + 1 ) );
 
         if ( this.tableGridStack.getLast().equals( Boolean.TRUE ) )
         {

Modified: maven/doxia/doxia/trunk/doxia-modules/doxia-module-fo/src/test/java/org/apache/maven/doxia/module/fo/FoSinkTest.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-modules/doxia-module-fo/src/test/java/org/apache/maven/doxia/module/fo/FoSinkTest.java?rev=809309&r1=809308&r2=809309&view=diff
==============================================================================
--- maven/doxia/doxia/trunk/doxia-modules/doxia-module-fo/src/test/java/org/apache/maven/doxia/module/fo/FoSinkTest.java (original)
+++ maven/doxia/doxia/trunk/doxia-modules/doxia-module-fo/src/test/java/org/apache/maven/doxia/module/fo/FoSinkTest.java Sun Aug 30 11:01:10 2009
@@ -297,11 +297,9 @@
         // String deAtts = getConfig().getAttributeString( "table.body.cell" );
 
         return EOL + EOL + "<fo:block" + dlAtts + ">" + EOL + "<fo:table" + dtAtts + ">" + EOL
-            + "<fo:table-column column-width=\"proportional-column-width(1)\"/>" + EOL
-            + "<fo:table-column column-width=\"100%\"/>" + EOL
             + "<fo:table-column column-width=\"proportional-column-width(1)\"/>" + EOL + EOL + "<fo:table-body>"
             + EOL + "<fo:table-row" + ddAtts
-            + "><fo:table-cell column-number=\"2\" padding-after=\"1.5pt\" padding-end=\"5pt\" "
+            + "><fo:table-cell column-number=\"1\" padding-after=\"1.5pt\" padding-end=\"5pt\" "
             + "keep-together.within-column=\"always\" padding-start=\"2.5pt\" "
             + "background-color=\"#eeeeee\" padding-before=\"4pt\">" + EOL + "<fo:block line-height=\"1.2em\" "
             + "text-align=\"center\" font-family=\"Helvetica,sans-serif\" font-size=\"9pt\">" + EOL + cell