xmlgraphics-fop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From adelme...@apache.org
Subject svn commit: r291270 - in /xmlgraphics/fop/trunk/src/java/org/apache/fop/fo: flow/TableBody.java flow/TableCell.java flow/TableColumn.java flow/TableFObj.java flow/TableRow.java properties/ColumnNumberPropertyMaker.java
Date Sat, 24 Sep 2005 10:02:07 GMT
Author: adelmelle
Date: Sat Sep 24 03:02:01 2005
New Revision: 291270

URL: http://svn.apache.org/viewcvs?rev=291270&view=rev
Log:
Moved check for explicit column-number to ColumnNumberPropertyMaker

Modified:
    xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/TableBody.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/TableCell.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/TableColumn.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/TableFObj.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/TableRow.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/properties/ColumnNumberPropertyMaker.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=291270&r1=291269&r2=291270&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 Sat Sep 24 03:02:01
2005
@@ -329,7 +329,7 @@
      * 
      * @param newIndex  the new column index
      */
-    protected void setCurrentColumnIndex(int newIndex) {
+    public void setCurrentColumnIndex(int newIndex) {
         columnIndex = newIndex;
     }
 

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/TableCell.java
URL: http://svn.apache.org/viewcvs/xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/TableCell.java?rev=291270&r1=291269&r2=291270&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/TableCell.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/TableCell.java Sat Sep 24 03:02:01
2005
@@ -149,14 +149,8 @@
             //in the current row => error!
             if (((TableFObj) parent).isColumnNumberUsed(columnIndex)) {
                 throw new FOPException("fo:table-cell overlaps in column "
-                        + i, locator);
+                        + columnIndex, locator);
             }
-        }
-        //if column-number was explicitly specified, force the parent's current
-        //column index to the specified value, so that the updated index will
-        //be the correct initial value for the next cell (see Rec 7.26.8)
-        if (pList.getExplicit(PR_COLUMN_NUMBER) != null) {
-            ((TableFObj) parent).setCurrentColumnIndex(columnNumber.getValue());
         }
     }
 

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/TableColumn.java
URL: http://svn.apache.org/viewcvs/xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/TableColumn.java?rev=291270&r1=291269&r2=291270&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/TableColumn.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/TableColumn.java Sat Sep 24 03:02:01
2005
@@ -75,18 +75,9 @@
         visibility = pList.get(PR_VISIBILITY).getEnum();
         super.bind(pList);
         
-        if (pList.getExplicit(PR_COLUMN_NUMBER) != null) {
-            if (getTable().isColumnNumberUsed(columnNumber.getValue())) {
-                throw new PropertyException("Specified column-number \""
-                        + columnNumber 
-                        + "\" has already been assigned to a previous column");
-            } else {
-                //force parent table's current column index
-                //to the specified value, so that the updated index
-                //will be the correct initial value for the next column
-                //(see Rec 7.26.8)
-                getTable().setCurrentColumnIndex(columnNumber.getValue());
-            }
+        if (getTable().isColumnNumberUsed(columnNumber.getValue())) {
+            throw new PropertyException("column-number \"" + columnNumber 
+                    + "\" has already been assigned to a previous column");
         }
         if (numberColumnsRepeated.getValue() <= 0) {
             throw new PropertyException("number-columns-repeated must be 1 or bigger, "

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/TableFObj.java
URL: http://svn.apache.org/viewcvs/xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/TableFObj.java?rev=291270&r1=291269&r2=291270&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/TableFObj.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/TableFObj.java Sat Sep 24 03:02:01
2005
@@ -125,7 +125,7 @@
      * 
      * @param   newIndex    new value for column index
      */
-    protected void setCurrentColumnIndex(int newIndex) {
+    public void setCurrentColumnIndex(int newIndex) {
         //do nothing by default
     }
     

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/TableRow.java
URL: http://svn.apache.org/viewcvs/xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/TableRow.java?rev=291270&r1=291269&r2=291270&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/TableRow.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/TableRow.java Sat Sep 24 03:02:01
2005
@@ -305,7 +305,7 @@
      * 
      * @param newIndex  new value for column index
      */
-    protected void setCurrentColumnIndex(int newIndex) {
+    public void setCurrentColumnIndex(int newIndex) {
         columnIndex = newIndex;
     }
 

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/properties/ColumnNumberPropertyMaker.java
URL: http://svn.apache.org/viewcvs/xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/properties/ColumnNumberPropertyMaker.java?rev=291270&r1=291269&r2=291270&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/properties/ColumnNumberPropertyMaker.java
(original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/properties/ColumnNumberPropertyMaker.java
Sat Sep 24 03:02:01 2005
@@ -86,9 +86,9 @@
         
         Property p = super.get(0, propertyList, tryInherit, tryDefault);
         FObj fo = propertyList.getFObj();
+        TableFObj parent = (TableFObj) propertyList.getParentFObj();
         
         if (p.getNumeric().getValue() <= 0) {
-            TableFObj parent = (TableFObj) propertyList.getParentFObj();
             int columnIndex = parent.getCurrentColumnIndex();
             fo.getLogger().warn("Specified negative or zero value for "
                     + "column-number on " + fo.getName() + ": "
@@ -97,6 +97,13 @@
             return new NumberProperty(columnIndex);
         }
         //TODO: check for non-integer value and round
+        
+        //if column-number was explicitly specified, force the parent's current
+        //column index to the specified value, so that the updated index will
+        //be the correct initial value for the next cell (see Rec 7.26.8)
+        if (propertyList.getExplicit(Constants.PR_COLUMN_NUMBER) != null) {
+            parent.setCurrentColumnIndex(p.getNumeric().getValue());
+        }
         return p;
     }
 }



---------------------------------------------------------------------
To unsubscribe, e-mail: fop-commits-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-commits-help@xmlgraphics.apache.org


Mime
View raw message