maven-doxia-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ltheu...@apache.org
Subject svn commit: r628439 - in /maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia: parser/XhtmlBaseParser.java sink/XhtmlBaseSink.java
Date Sun, 17 Feb 2008 07:42:58 GMT
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";



Mime
View raw message