Return-Path: Delivered-To: apmail-xmlgraphics-fop-commits-archive@www.apache.org Received: (qmail 19898 invoked from network); 19 Sep 2005 21:16:44 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 19 Sep 2005 21:16:44 -0000 Received: (qmail 46799 invoked by uid 500); 19 Sep 2005 21:16:43 -0000 Delivered-To: apmail-xmlgraphics-fop-commits-archive@xmlgraphics.apache.org Received: (qmail 46782 invoked by uid 500); 19 Sep 2005 21:16:43 -0000 Mailing-List: contact fop-commits-help@xmlgraphics.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: fop-dev@xmlgraphics.apache.org Delivered-To: mailing list fop-commits@xmlgraphics.apache.org Received: (qmail 46769 invoked by uid 99); 19 Sep 2005 21:16:43 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 19 Sep 2005 14:16:43 -0700 X-ASF-Spam-Status: No, hits=-9.8 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [209.237.227.194] (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.29) with SMTP; Mon, 19 Sep 2005 14:16:52 -0700 Received: (qmail 19886 invoked by uid 65534); 19 Sep 2005 21:16:40 -0000 Message-ID: <20050919211640.19885.qmail@minotaur.apache.org> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r290270 - /xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/TableBody.java Date: Mon, 19 Sep 2005 21:16:39 -0000 To: fop-commits@xmlgraphics.apache.org From: adelmelle@apache.org X-Mailer: svnmailer-1.0.5 X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Author: adelmelle Date: Mon Sep 19 14:16:37 2005 New Revision: 290270 URL: http://svn.apache.org/viewcvs?rev=290270&view=rev Log: Correction of style violations Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/TableBody.java Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/TableBody.java URL: http://svn.apache.org/viewcvs/xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/TableBody.java?rev=290270&r1=290269&r2=290270&view=diff ============================================================================== --- xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/TableBody.java (original) +++ xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/TableBody.java Mon Sep 19 14:16:37 2005 @@ -26,7 +26,6 @@ import org.xml.sax.Locator; import org.apache.fop.apps.FOPException; -import org.apache.fop.datatypes.Numeric; import org.apache.fop.fo.FONode; import org.apache.fop.fo.FObj; import org.apache.fop.fo.PropertyList; @@ -51,12 +50,14 @@ private PropertyList savedPropertyList; + //used for validation protected boolean tableRowsFound = false; protected boolean tableCellsFound = false; - private int columnIndex = 1; + //used for initial values of column-number property protected List pendingSpans; protected BitSet usedColumnIndices = new BitSet(); + private int columnIndex = 1; private boolean firstRow = true; /** @@ -149,7 +150,7 @@ * @see org.apache.fop.fo.FONode#addChildNode(FONode) */ protected void addChildNode(FONode child) throws FOPException { - if( child.getNameId() == FO_TABLE_CELL ) { + if (child.getNameId() == FO_TABLE_CELL) { addCellNode( (TableCell) child); } else { super.addChildNode(child); @@ -167,25 +168,25 @@ //if firstRow flag is still true, the cell starts a row, //and there was a previous cell that didn't explicitly //end the previous row => set firstRow flag to false - if( firstRow && cell.startsRow() && !lastCellEndedRow() ) { + if (firstRow && cell.startsRow() && !lastCellEndedRow()) { firstRow = false; } int rowSpan = cell.getNumberRowsSpanned(); int colSpan = cell.getNumberColumnsSpanned(); //if there were no explicit columns, pendingSpans //will not be properly initialized for the first row - if( firstRow && ((Table) parent).columns == null ) { - if( pendingSpans == null ) { + if (firstRow && ((Table) parent).columns == null) { + if (pendingSpans == null) { pendingSpans = new java.util.ArrayList(); } - for( int i = colSpan; --i >= 0; ) { + for (int i = colSpan; --i >= 0;) { pendingSpans.add(null); } } //if the current cell spans more than one row, //update pending span list for the next row - if( rowSpan > 1 ) { - for( int i = colSpan; --i >= 0; ) { + if (rowSpan > 1) { + for (int i = colSpan; --i >= 0;) { pendingSpans.set(columnIndex - 1 + i, new PendingSpan(rowSpan)); } @@ -197,11 +198,11 @@ //take up more than three columnIndices... int startIndex = columnIndex - 1; int endIndex = startIndex + colSpan; - if( ((Table) parent).columns != null ) { + if (((Table) parent).columns != null) { List cols = ((Table) parent).columns; int tmpIndex = endIndex; - for( int i = startIndex; i <= tmpIndex; ++i ) { - if( i < cols.size() && cols.get(i) == null ) { + for (int i = startIndex; i <= tmpIndex; ++i) { + if (i < cols.size() && cols.get(i) == null) { endIndex++; } } @@ -209,8 +210,8 @@ usedColumnIndices.set(startIndex, endIndex); setNextColumnIndex(); super.addChildNode(cell); - if( cell.endsRow() ) { - if( firstRow ) { + if (cell.endsRow()) { + if (firstRow) { firstRow = false; } resetColumnIndex(); @@ -297,10 +298,10 @@ * */ protected void initPendingSpans() { - if( ((Table) parent).columns != null ) { + if (((Table) parent).columns != null) { List tableCols = ((Table) parent).columns; pendingSpans = new java.util.ArrayList(tableCols.size()); - for( int i = tableCols.size(); --i >= 0; ) { + for (int i = tableCols.size(); --i >= 0;) { pendingSpans.add(null); } } @@ -320,6 +321,7 @@ * (used by TableCell.bind() in case the column-number * was explicitly specified) * + * @param newIndex the new column index */ protected void setCurrentColumnIndex(int newIndex) { columnIndex = newIndex; @@ -333,17 +335,17 @@ columnIndex = 1; usedColumnIndices.clear(); PendingSpan pSpan; - for( int i = pendingSpans.size(); --i >= 0; ) { + for (int i = pendingSpans.size(); --i >= 0;) { pSpan = (PendingSpan) pendingSpans.get(i); - if( pSpan != null ) { + if (pSpan != null) { pSpan.rowsLeft--; - if( pSpan.rowsLeft == 0 ) { + if (pSpan.rowsLeft == 0) { pendingSpans.set(i, null); } } usedColumnIndices.set(i, pendingSpans.get(i) != null); } - if( !firstRow ) { + if (!firstRow) { setNextColumnIndex(); } } @@ -353,15 +355,15 @@ * */ private void setNextColumnIndex() { - while( usedColumnIndices.get(columnIndex - 1) ) { + while (usedColumnIndices.get(columnIndex - 1)) { //increment columnIndex columnIndex++; //if the table has explicit columns, and //the updated index is not assigned to any //column, increment further until the next //index occupied by a column... - if( ((Table) parent).columns != null ) { - while( columnIndex <= ((Table) parent).columns.size() + if (((Table) parent).columns != null) { + while (columnIndex <= ((Table) parent).columns.size() && !((Table) parent).isColumnNumberUsed(columnIndex) ) { columnIndex++; } @@ -376,9 +378,9 @@ * had ends-row="false" (implicit or explicit) */ public boolean lastCellEndedRow() { - if( childNodes != null ) { + if (childNodes != null) { FONode prevNode = (FONode) childNodes.get(childNodes.size() - 1); - if( prevNode.getNameId() == FO_TABLE_CELL ) { + if (prevNode.getNameId() == FO_TABLE_CELL) { return ((TableCell) prevNode).endsRow(); } } @@ -389,6 +391,7 @@ * Checks whether a given column-number is already in use * for the current row (used by TableCell.bind()); * + * @param colNr the column-number to check * @return true if column-number is already occupied */ protected boolean isColumnNumberUsed(int colNr) { --------------------------------------------------------------------- To unsubscribe, e-mail: fop-commits-unsubscribe@xmlgraphics.apache.org For additional commands, e-mail: fop-commits-help@xmlgraphics.apache.org