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

--- Comment #3 from coolki...@hotmail.com 2011-03-30 13:33:46 EDT ---
Unfortunately the patch for Bug #50574 doesn’t resolve the issue for me.
Debugging the code shows that the lastRestartPosition variable is set to
positionAtBreak at line 767 and never used again. This will be because there is
only one page break in my test case.

The main issue seems to be that the positionAtBreak is set to the Second Block
element which has been initiated as a LeafNode. This results in the getPosition
function returning null and the subsequent getLM obviously fails thereafter on
line 824.

My knowldge of FOP's layout manager is limited so I have no idea why the Second
Block has been set to a leaf node when it clearly has children. 

Changing the Third Block from a self closing element to one that encapsulates
the "Page 2" text resolves the issue e.g:. 
<fo:flow flow-name="xsl-region-body" id="Flow">
    <fo:block id="First_Block">Page 1</fo:block>
    <fo:block id="Second_Block">
        <fo:inline id="First_Inline">
            <fo:block id="Third_Block">Page 2</fo:block>
        </fo:inline>
    </fo:block>
</fo:flow>

This will be due to the positionAtBreak variable being set to the Flow element
which does have children. 

Another example would be changing the first Inline element to a Block element:
<fo:page-sequence
    master-reference="chapter-master" master-name="chapter-master">
    <fo:flow flow-name="xsl-region-body" id="Flow">
        <fo:block id="First_Block">Page 1</fo:block>
        <fo:block id="Second_Block">
            <fo:block id="First_Inline">
                <fo:block id="Third_Block"/>Page 2
            </fo:block>
        </fo:block>
    </fo:flow>
</fo:page-sequence>

This sets the positionAtBreak variable to the newly changed block element which
has no problem getting its child Block.

I am not sure if there is a problem with the logic behind the positionAtBreak
variable e.g. should it be set to Flow instead of the Second Block? Or is it
the initialisation of the Second Block without any children?

Any ideas?
Thanks

-- 
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