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

--- Comment #2 from Jonathan Levinson <[email protected]> 2009-09-25 
17:46:34 PDT ---
Created an attachment (id=24314)
 --> (https://issues.apache.org/bugzilla/attachment.cgi?id=24314)
Patch that fixes problem

Attached is a patch that fixes problem which occurs when containing-block
contains block which contains block whose right-margin is a percentage width.

I ran JUNIT tests and all passed successfully.

I'm new to FOP community and to Layout Manager and I have confidence that
someone more senior on FOP community will review my fix.

Let id=1 be the containing block (not a block container but the containing
block!) and let id=2 be the block whose right-margin is a percentage.  The
problem was that when the endIndent was calculated in BlockLayoutManager in
method initialize, the ipd for id=1 had not yet been set up and was zero in its
various manifestations.  Percent * 0 = 0.

There could be a deeper problem (like the Knuth Elements being processed in the
wrong order), which my fix masks, however my fix did resolve this particular
issue and still passed all JUNIT tests, so it is worth posting.

My fix is an instance of the "RECALCULATE" design pattern (my own coinage).  If
you sometimes get the calculation wrong the first time, unconditionally do it
again when it is needed and more information is available.  In this case, if
you sometimes get the calculation wrong in initialize, unconditionally
recalculate when you get the next Knuth Element, which is responsible for
updating the content ipd with over-constrained adjust.

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

Reply via email to