> -----Original Message-----
> From: Glen Mazza [mailto:[EMAIL PROTECTED]
>

Hi Glen,

> Also, as food for thought, I wonder if the two methods
> Luca has mentioned should eventually be in
> FlowLayoutManager (FLM) instead.  The break properties
> appear relevant only for fo:flow descendants.

Interesting idea. The FLM may have more convenient access to the information
needed to deal with exactly this type of situation... at the very least,
it's worth considering moving part of the logic to FLM --say, storing a
state variable indicating whether the last page-break was forced or not-- so
the result of PSLM.needNewPage() would depend on FLM.needNewPage() which
would in its turn depend on 'lastPBForced'.
OTOH, this state variable could also be stored in the PSLM itself...

Roughly, the logic could become something like

PSLM.needNewPage(int breakVal) {
  if( (curPage != null) && (curPage.getPage().isEmpty() ) {
    if( breakVal == PAGE ) {
      return (currentPageNum == 1);
    } else {
      boolean evenPage = (currentPageNum % 2 == 0);
      return ((breakVal == (evenPage ? ODD_PAGE : EVEN_PAGE)) ||
lastPBForced);
    }
  } else {
    return true;
  }
}

Question then only remains where that 'lastPBForced' is set --somewhere in
PSLM.makeNewPage()?

As to your preceding question:

> > Just so I understand how this is supposed to work,
> > will someone please confirm my assumptions below:
> >

Your assumptions are all absolutely correct IMO.

Cheers,

Andreas

Reply via email to