xmlgraphics-fop-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Vincent Hennebert <vincent.henneb...@anyware-tech.com>
Subject Re: svn commit: r637119 - in /xmlgraphics/fop/branches/fop-0_95: src/java/org/apache/fop/layoutmgr/BlockStackingLayoutManager.java status.xml test/layoutengine/standard-testcases/block_break-before_bug44412.xml
Date Tue, 18 Mar 2008 10:31:06 GMT
Jeremias Maerki wrote:
> On 17.03.2008 20:29:07 Vincent Hennebert wrote:
>>> Author: jeremias
>>> Date: Fri Mar 14 07:41:03 2008
>>> New Revision: 637119
<snip/>
>>>              if (returnedList != null
>>>                      && returnedList.size() == 1
>>>                      && ((ListElement) returnedList.getFirst()).isForcedBreak())
{
>>> -                // a descendant of this block has break-before
>>> -                contentList.addAll(returnedList);
>>>  
>>>                  if (curLM.isFinished() && !hasNextChildLM()) {
>>> +                    // a descendant of this block has break-before
>>> +                    contentList.addAll(returnedList);
>>> +
>>>                      forcedBreakAfterLast = (BreakElement)contentList.removeLast();
>>>                      context.clearPendingMarks();
>>>                      break;
>>>                  }
>> What’s the point in adding a one-element list to another one if this 
>> element is removed just after that? What have I missed?
> 
> No particular point. It was refactoring to conserve existing
> functionality without looking at the bigger context. The if statement
> could probably be rewritten like this to "optimize" it.
> 
>                 if (curLM.isFinished() && !hasNextChildLM()) {
>                     // a descendant of this block has break-before
>                     forcedBreakAfterLast = (BreakElement)contentList.removeLast();
>                     assert contentList.size() == 0;
>                     context.clearPendingMarks();
>                     break;
>                 }

Again, what was the additional cost of applying such a change? Isn’t the 
code of this method already complex enough?


Vincent


-- 
Vincent Hennebert                            Anyware Technologies
http://people.apache.org/~vhennebert         http://www.anyware-tech.com
Apache FOP Committer                         FOP Development/Consulting

Mime
View raw message