You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-dev@xmlgraphics.apache.org by Andreas L Delmelle <a_...@pandora.be> on 2006/08/21 19:25:52 UTC
Fwd: svn commit: r433291 ...
Begin forwarded message:
> From: adelmelle@apache.org
> <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
Re: svn commit: r433291 ...
Posted by Andreas L Delmelle <a_...@pandora.be>.
On Aug 21, 2006, at 23:08, Patrick Paul wrote:
> <snip />
> Maybe I missed something, or should I be updating the colWidths
> ArrayList rather than widths of the columns directly?
Correct. Feel free to add accessors if that simplifies your work.
I decided to separate the widths from the columns, so in a farther
future we may release the TableColumns themselves sooner (if we do
the same for the borders and backgrounds).
Cheers,
Andreas
Re: Fwd: svn commit: r433291 ...
Posted by Patrick Paul <pp...@yahoo.ca>.
Andreas L Delmelle wrote:
> Begin forwarded message:
>
>> From: adelmelle@apache.org
>> <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