Andreas L Delmelle wrote:

Begin forwarded message:

From: [EMAIL PROTECTED]
<snip />
URL: http://svn.apache.org/viewvc?rev=433291&view=rev
Log:
Rework of default column-creation and setting column-widths from the first row (fixes Bugzilla 35656)


For Patrick, only this tiny bit changes:

The following part is moved from TableLM to ColumnSetup. I see in the initial GSoC-patch that this is bypassed in case of auto-layout. Shouldn't be too much trouble adapting the patch to take this into account.

- // either works out table of column widths or if proportional-column-width function - // is used works out total factor, so that value of single unit can be computed.
-        int sumCols = 0;
-        float factors = 0;
-        for (Iterator i = columns.iterator(); i.hasNext();) {
-            TableColumn column = (TableColumn) i.next();
-            if (column != null) {
-                Length width = column.getColumnWidth();
-                sumCols += width.getValue(this);
-                if (width instanceof TableColLength) {
- factors += ((TableColLength) width).getTableUnits();
-                }
-            }
-        }
- // sets TABLE_UNITS in case where one or more oldColumns is defined using
-        // proportional-column-width
-        if (sumCols < getContentAreaIPD()) {
-            if (tableUnits == 0.0) {
- this.tableUnits = (getContentAreaIPD() - sumCols) / factors;
-            }
+        /* initialize unit to determine computed values
+         * for proportional-column-width()
+         */
+        if (tableUnit == 0.0) {
+            this.tableUnit = columns.computeTableUnit(this);
         }



Cheers,

Andreas

Andreas,

In ColumnSetup­.getXOffset you use the width of the columns that are stored in the new ArrayList named colWidths that you created. The problem is that my algorigthm changes the widths of the columns but that isn't reflected in colWidths, so the returned offset isn't the right one.

Maybe I missed something, or should I be updating the colWidths ArrayList rather than widths of the columns directly ?

Thank you,

Patrick

Reply via email to