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 lt...@apache.org on 2008/02/17 08:42:58 UTC

svn commit: r628439 - in /maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia: parser/XhtmlBaseParser.java sink/XhtmlBaseSink.java

Author: ltheussl
Date: Sat Feb 16 23:42:55 2008
New Revision: 628439

URL: http://svn.apache.org/viewvc?rev=628439&view=rev
Log:
[DOXIA-221] Fix NPE when the celljustif array is shorter than the cell count.
            Switch to left default justification in XhtmlBaseParser.
Submitted by: Benjamin Bentmann

Modified:
    maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/parser/XhtmlBaseParser.java
    maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/sink/XhtmlBaseSink.java

Modified: maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/parser/XhtmlBaseParser.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/parser/XhtmlBaseParser.java?rev=628439&r1=628438&r2=628439&view=diff
==============================================================================
--- maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/parser/XhtmlBaseParser.java (original)
+++ maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/parser/XhtmlBaseParser.java Sat Feb 16 23:42:55 2008
@@ -274,11 +274,11 @@
 
             String align = parser.getAttributeValue( null, Attribute.ALIGN.toString() );
 
-            int[] justif = { JUSTIFY_CENTER };
+            int[] justif = { JUSTIFY_LEFT };
 
-            if ( "left".equals( align ) )
+            if ( "center".equals( align ) )
             {
-                justif[0] = JUSTIFY_LEFT;
+                justif[0] = JUSTIFY_CENTER;
             }
             else if ( "right".equals( align ) )
             {

Modified: maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/sink/XhtmlBaseSink.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/sink/XhtmlBaseSink.java?rev=628439&r1=628438&r2=628439&view=diff
==============================================================================
--- maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/sink/XhtmlBaseSink.java (original)
+++ maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/sink/XhtmlBaseSink.java Sat Feb 16 23:42:55 2008
@@ -804,7 +804,7 @@
 
         if ( cellJustif != null && isCellJustif )
         {
-            switch ( cellJustif[cellCount] )
+            switch ( cellJustif[Math.min( cellCount, cellJustif.length - 1 )] )
             {
                 case Parser.JUSTIFY_LEFT:
                     justif = "left";