From doxia-commits-return-748-apmail-maven-doxia-commits-archive=maven.apache.org@maven.apache.org Thu Feb 14 11:33:40 2008 Return-Path: Delivered-To: apmail-maven-doxia-commits-archive@www.apache.org Received: (qmail 9172 invoked from network); 14 Feb 2008 11:33:40 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 14 Feb 2008 11:33:40 -0000 Received: (qmail 35516 invoked by uid 500); 14 Feb 2008 11:33:34 -0000 Delivered-To: apmail-maven-doxia-commits-archive@maven.apache.org Received: (qmail 35495 invoked by uid 500); 14 Feb 2008 11:33:34 -0000 Mailing-List: contact doxia-commits-help@maven.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: doxia-dev@maven.apache.org Delivered-To: mailing list doxia-commits@maven.apache.org Received: (qmail 35484 invoked by uid 99); 14 Feb 2008 11:33:34 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 14 Feb 2008 03:33:34 -0800 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 14 Feb 2008 11:33:11 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 3BA731A9832; Thu, 14 Feb 2008 03:33:19 -0800 (PST) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r627711 - in /maven/doxia/doxia/trunk: doxia-core/src/main/java/org/apache/maven/doxia/sink/XhtmlBaseSink.java doxia-modules/doxia-module-fo/src/main/java/org/apache/maven/doxia/module/fo/FoSink.java Date: Thu, 14 Feb 2008 11:33:18 -0000 To: doxia-commits@maven.apache.org From: vsiveton@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20080214113319.3BA731A9832@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: vsiveton Date: Thu Feb 14 03:33:14 2008 New Revision: 627711 URL: http://svn.apache.org/viewvc?rev=627711&view=rev Log: o fixed ArrayIndexOutOfBoundsException Modified: maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/sink/XhtmlBaseSink.java maven/doxia/doxia/trunk/doxia-modules/doxia-module-fo/src/main/java/org/apache/maven/doxia/module/fo/FoSink.java 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=627711&r1=627710&r2=627711&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 Thu Feb 14 03:33:14 2008 @@ -59,9 +59,12 @@ /** An indication on if we're in verbatim mode. */ private boolean verbatimFlag; - /** Justification of table cells. */ + /** Alignment of table cells. */ private int[] cellJustif; + /** Justification of table cells. */ + private boolean isCellJustif; + /** Number of cells in a table row. */ private int cellCount; @@ -132,6 +135,7 @@ protected void setCellJustif( int[] justif ) { this.cellJustif = justif; + this.isCellJustif = true; } /** @@ -183,6 +187,7 @@ headFlag = false; verbatimFlag = false; cellJustif = null; + isCellJustif = false; cellCount = 0; evenTableRow = true; } @@ -708,6 +713,7 @@ public void tableRows_() { this.cellJustif = null; + this.isCellJustif = false; this.evenTableRow = true; } @@ -795,7 +801,7 @@ { String justif = null; - if ( cellJustif != null ) + if ( cellJustif != null && isCellJustif ) { switch ( cellJustif[cellCount] ) { @@ -855,7 +861,10 @@ writeEndTag( t ); - ++cellCount; + if ( isCellJustif ) + { + ++cellCount; + } } /** 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=627711&r1=627710&r2=627711&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 Thu Feb 14 03:33:14 2008 @@ -67,6 +67,9 @@ /** Alignment of table cells. */ private int[] cellJustif; + /** Justification of table cells. */ + private boolean isCellJustif; + /** Current table cell. */ private int cellCount; @@ -623,15 +626,19 @@ { this.tableGrid = grid; this.cellJustif = justification; + this.isCellJustif = true; // FOP hack to center the table, see // http://xmlgraphics.apache.org/fop/fo.html#fo-center-table-horizon writeln( "" ); // TODO: calculate width[i] - for ( int i = 0; i < cellJustif.length; i++ ) + if ( cellJustif != null ) { - writeln( "" ); + for ( int i = 0; i < cellJustif.length; i++ ) + { + writeln( "" ); + } } writeln( "" ); @@ -642,6 +649,7 @@ public void tableRows_() { this.cellJustif = null; + this.isCellJustif = false; writeEndTag( TABLE_BODY_TAG ); } @@ -694,8 +702,8 @@ private void tableCell( boolean headerRow ) { String justif = null; - - if ( cellJustif != null ) + + if ( cellJustif != null && isCellJustif ) { switch ( cellJustif[cellCount] ) { @@ -711,7 +719,7 @@ break; } } - + if ( justif != null ) { // the column-number is needed for the hack to center the table, see tableRows. @@ -734,7 +742,11 @@ { writeEndTag( BLOCK_TAG ); writeEndTag( TABLE_CELL_TAG ); - ++cellCount; + + if ( isCellJustif ) + { + ++cellCount; + } } /** {@inheritDoc} */