DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUGĀ·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=39118>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED ANDĀ·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=39118





------- Additional Comments From [EMAIL PROTECTED]  2006-04-15 12:30 -------
Created an attachment (id=18109)
 --> (http://issues.apache.org/bugzilla/attachment.cgi?id=18109&action=view)
This file is the *complete* patch to handle page-number-citation-last in the
different FO elements requested

Ignore the precedent patch, this one applies the same modifications + new ones
                
                Patch Explanation
                -----------------
                
OK, this is a file to help you understand the changes applied
to the source code to handle the page-number-citation-last
element. 

New Data Structures
-------------------

2 java.util.HashSet in AreaTreeHandler.java :

    private Set unresolvedLayoutManagers = new HashSet();
    private Set alreadyResolvedIDs = new HashSet();

The role of unresolvedLayoutManagers is to keep a list of 
"which formatting objects contributes IDs" as you proposed it.

The role of alreadyResolvedIDs is to keep a list of IDs already
resolved. That role might seems unnecessary, so here's a little 
example that i came across while doing the modification :

...
  <fo:block>page: <fo:page-number/>, bof2 is on page <fo:page-number-citation
ref-id="bof2"/></fo:block>
    <fo:block linefeed-treatment="preserve" id="bof3">page: <fo:page-number/>
      test
      test
      test
      test
      test
      test
    </fo:block>
    <fo:block break-before="page">page: <fo:page-number/></fo:block>
    <fo:block>page: <fo:page-number/></fo:block>
    <fo:block>page: <fo:page-number/> of <fo:page-number-citation
ref-id="eof1"/></fo:block>
    <fo:block>page(-last): <fo:page-number/> of <fo:page-number-citation-last
ref-id="bof3"/></fo:block>
...

Withouth the second Set, the problem that we come across is that the
layout of the block with the id 'bof3' is finished before the creation
of the page-number-citation-last layout manager. Due to the construction
of the PNCL-LM, the first step it does is to add the UnresolvedPageNumber
in the unresolvedLayoutManager list (there is no way to known in advance
if the page number can be resolved or not at this point). Each layout manager
is responsible of removing its ID from the unresolvedLayoutManager's list
and, at the same time to call for the resolution of the IDs its possess.
But as the ID of the block of the block layout manager is inexisting in the
list as the PNCL-LM haven't addded yet, it is not resolved when "it should".
The solution that i chose is to add each ID resolved "in advance" in a Set,
that the PNCL-LM will check to see if it can skip the "wait for resolve"
step, so it can immediately be resolved. 

I hope that this little explanation helped you to understand the changes.

What have been done -> handling of PageSequence ids and Block ids + Block level

ids (as page-number-citation)

Known limits -> no handling of IDs contained in a root, flow, and the table
related ids : table-header, table-footer, table-body ...
And, i don't know if it's a problem, but when the actual UnresolvedPageNumber
object is resolved, the font associated to it is null (this is due to the
"transient" state of the object i guess...) and the IPD can't be updated (only
the case with PageSequences).

New Code
--------
As explained above.
The source code changes are avail in the patch file.


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

Reply via email to