Manuel Mall wrote:

But if we have a long fo:inline stretching multiple lines this seem to give the wrong results from the Inline LM perspective. For example if the fo:inline finishes in the middle of a line followed by more text the Line LM will not set the LAST_AREA flag when calling addAreas on the Inline LM as there are more areas on the line. Therefore the Inline LM "thinks" its not done with yet although it is and the reverse is true on the first line of a multi-line inline.

The LineLM.addAreas() method creates a line at a time (a line for each LineBreakPosition), and asks its children to add their inline areas for the line area being created.

It sets the LAST_AREA flag if the child LM is the one that created the last element placed in this line: for each line, there is one and only one child LM that receives a LayoutContext with this flag set, unless there are bugs :-)

If the content of an inline is divided among several lines, the method InlineLM.addAreas() will be called once per line, and all the times (but the last) it will have the LAST_AREA flag on.

Some time ago there was a thread about a similar subject [1]: the problem, then, was the opposite, i.e. to find out which is the last area generated by a LM, regardless of line breaks.

I think there is a bit of ambiguity in the names: at the moment, the LAST_AREA flag signals to a LM that it is adding the last inline area in a line, or the last block area in a page, but this can cause confusion with the is-last area trait described by the specs (4.2.2 Common traits). Maybe we can find out a more significant and univocal name.

Regards
    Luca

[1] Markers: Determining the last generated area for a LM, http://nagoya.apache.org/eyebrowse/ReadMsg?listId=63&msgNo=11296


Reply via email to