Re: DO NOT REPLY [Bug 48380] ClassCastException when using fox:widow-content-limit

2011-01-07 Thread Simon Pepping
Your patch seems OK to me. Even though the conditionals handle some
tricky navigation through the list, this is the best way to use the
similarities between the two methods.

Will you apply it?

Simon

On Wed, Jan 05, 2011 at 02:01:55PM -0500, bugzi...@apache.org wrote:
 https://issues.apache.org/bugzilla/show_bug.cgi?id=48380
 
 --- Comment #2 from Andreas L. Delmelle adelme...@apache.org 2011-01-05 
 14:01:49 EST ---
 Created an attachment (id=26460)
  -- (https://issues.apache.org/bugzilla/attachment.cgi?id=26460)
 proposed patch to ElementListUtils.java
 
 Apologies for the late response...
 
 I noticed the issue did not occur with fox:orphan-content-limit, since that
 triggers a call to ElementListUtils.removeLegalBreaksFromEnd(), which was
 equipped to deal with SpaceElements, contrary to the method
 removeLegalBreaks(), where the exception was thrown. 
 Seems like the implementations of both methods were meant to be analogous, but
 got out of alignment.
 Proposal is to fix this by merging the implementations into one private 
 method,
 as they were almost identical anyway (apart from 3-4 lines, which can be
 handled rather gracefully through conditionals).
 For now, the proposed fix does not alter the behavior in any way, except by
 avoiding the potential ClassCastException, although it did get me wondering
 whether the treatment of spaces is always correct here... 
 Think: consecutive/adjoining spaces with a different precedence value, and
 whether it is correct to just add the space's optimum width. Theoretically, it
 seems possible that we leave in a break-opportunity that turns out (= after
 space-resolution) to leave less content before the break than the constraint
 specifies, because we counted 2 spaces here, of which only one is retained in
 the eventual output (?)
 
 -- 
 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 48380] ClassCastException when using fox:widow-content-limit

2011-01-07 Thread Andreas Delmelle
On 07 Jan 2011, at 17:03, Simon Pepping wrote:

 Your patch seems OK to me. Even though the conditionals handle some
 tricky navigation through the list, this is the best way to use the
 similarities between the two methods.
 
 Will you apply it?

Sure, will do!

Regards

Andreas