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 bu...@apache.org on 2008/03/23 11:46:01 UTC

DO NOT REPLY [Bug 44658] New: Incorrect table-unit computation if proportional-column-width() is used as a subexpression

https://issues.apache.org/bugzilla/show_bug.cgi?id=44658

           Summary: Incorrect table-unit computation if proportional-column-
                    width() is used as a subexpression
           Product: Fop
           Version: 1.0dev
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: page-master/layout
        AssignedTo: fop-dev@xmlgraphics.apache.org
        ReportedBy: adelmelle@apache.org
                CC: louis.masters@log-net.com


Originally posted on fop-users@ by Lou Masters (29-02-2008):
---
In 0.20.3, I used to do the following to give one of my columns some extra size
and ensure it always had a minimum: 

<fo:table-column column-width="20mm+proportional-column-width(1)"/> 

In 0.94, this now produces bizarre results.  I got around it by changing the
width to something like: 

<fo:table-column column-width="20mm+proportional-column-width(1.2)"/> 

This seems to be OK.  My question is this:  Should my original method have ever
worked?  Was it correct?
---

The initial reply was that expressions like these are perfectly legitimate
according to the XSL-FO Recommendation.
In the meantime, I re-checked the behavior of this expression in FOP Trunk, and
it seems to be completely non-functional.

The reason is that an expression like the above is parsed into a
RelativeNumericProperty. 
As a result, the loop in
org.apache.fop.layoutmgr.ColumnSetup.computeTableUnit() does not detect the
TableColLength, and in the attached sample, returns a double value of 0.0 for
both columns.


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

DO NOT REPLY [Bug 44658] Incorrect table-unit computation if proportional-column-width() is used as a subexpression

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=44658

Glenn Adams <gl...@skynav.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |CLOSED

--- Comment #9 from Glenn Adams <gl...@skynav.com> 2012-04-01 07:06:31 UTC ---
batch transition pre-FOP1.0 resolved+fixed bugs to closed+fixed

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

Re: DO NOT REPLY [Bug 44658] Incorrect table-unit computation if proportional-column-width() is used as a subexpression

Posted by Simon Pepping <sp...@leverkruid.eu>.
On Tue, Apr 08, 2008 at 01:05:12PM -0700, bugzilla@apache.org wrote:
> --- Comment #7 from Andreas L. Delmelle <ad...@apache.org>  2008-04-08 13:05:11 PST ---
> 
> Cool. Simon's patch indeed looks better than my own attempt.
> 
> I'll see if I can apply it to the trunk (if Simon does not beat me to it)

Feel free to commit it. Do not forget a test case :-)

Simon

-- 
Simon Pepping
home page: http://www.leverkruid.eu

DO NOT REPLY [Bug 44658] Incorrect table-unit computation if proportional-column-width() is used as a subexpression

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=44658





--- Comment #2 from Andreas L. Delmelle <ad...@apache.org>  2008-03-24 05:11:28 PST ---
Thinking of a fix, this seems to be all but trivial...

ColumnSetup can only detect if the specified width is a relative numeric, but
does not have access to the operands, so their type cannot be determined from
there.

One option being investigated:
- push getTableUnits() up in the hierarchy, and make it part of the Length
interface
- as such, RelativeNumericProperty and NumericProperty *must* also implement it
- NumericProperty can simply return 0
- RelativeNumericProperty can check its operands, and if there is a
TableColLength, call its getTableUnits() (possible tough nut: deeper nesting,
more complex expression tree?)
- ColumnSetup then only needs to know the column-width is a Length to know that
the call to getTableUnits() will succeed; if it is backed by an expression
(RelativeNumericProperty) the above should make sure that we also get a correct
number of units in that case


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

DO NOT REPLY [Bug 44658] Incorrect table-unit computation if proportional-column-width() is used as a subexpression

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=44658





--- Comment #4 from Simon Pepping <sp...@apache.org>  2008-04-07 07:08:17 PST ---
Andreas,

Your fix is high up the tree, in the Length interface. I attach a patch which
limits the getTableUnits method to RelativeNumericProperty. The method only
plays a role in TableColLength and in RelativeNumericProperty, which may
contain TableColLength in its tree.

Note that the method getTableUnits had apparently earlier been implemented in
Length. Traces of that are still present in the code.

Simon


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

DO NOT REPLY [Bug 44658] Incorrect table-unit computation if proportional-column-width() is used as a subexpression

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=44658





--- Comment #5 from Simon Pepping <sp...@apache.org>  2008-04-07 07:10:24 PST ---
Created an attachment (id=21785)
 --> (https://issues.apache.org/bugzilla/attachment.cgi?id=21785)
Alternative patch for the problem, as described


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

DO NOT REPLY [Bug 44658] Incorrect table-unit computation if proportional-column-width() is used as a subexpression

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=44658





--- Comment #3 from Andreas L. Delmelle <ad...@apache.org>  2008-03-24 13:04:33 PST ---
Created an attachment (id=21706)
 --> (https://issues.apache.org/bugzilla/attachment.cgi?id=21706)
Initial patch correcting the problem


Initial patch addresses the issue, and at the same time caters for expressions
like:

proportional-column-width(1) + proportional-column-width(0.5) -> 1.5
table-units
max(proportional-column-width(1), proportional-column-width(1.5)) -> 1.5
table-units

Strange as they may seem, they are definitely legal:
proportional-column-width() yields a numeric.


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

DO NOT REPLY [Bug 44658] Incorrect table-unit computation if proportional-column-width() is used as a subexpression

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=44658


Andreas L. Delmelle <ad...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED




--- Comment #7 from Andreas L. Delmelle <ad...@apache.org>  2008-04-08 13:05:11 PST ---

Cool. Simon's patch indeed looks better than my own attempt.

I'll see if I can apply it to the trunk (if Simon does not beat me to it)


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

DO NOT REPLY [Bug 44658] Incorrect table-unit computation if proportional-column-width() is used as a subexpression

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=44658


Simon Pepping <sp...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED




--- Comment #8 from Simon Pepping <sp...@apache.org>  2008-04-24 10:44:07 PST ---
Fixed in revision 651323.


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

DO NOT REPLY [Bug 44658] Incorrect table-unit computation if proportional-column-width() is used as a subexpression

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=44658





--- Comment #1 from Andreas L. Delmelle <ad...@apache.org>  2008-03-23 03:47:01 PST ---
Created an attachment (id=21701)
 --> (https://issues.apache.org/bugzilla/attachment.cgi?id=21701)
FO demonstrating the issue


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

DO NOT REPLY [Bug 44658] Incorrect table-unit computation if proportional-column-width() is used as a subexpression

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=44658





--- Comment #6 from Simon Pepping <sp...@apache.org>  2008-04-07 07:31:54 PST ---
The method that is a remnant of the past and needs to be removed, is
LengthProperty.getTableUnits.


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.