--- Comment #7 from Dave Gerdt <[EMAIL PROTECTED]>  2008-07-08 13:59:23 PST ---
Looking for a solution to this first page/last page problem I found a potential
solution written by Ken Holman [1]. I assumed because he used it (and he seems
to know a little about the subject ;)  ) I had found my solution. (I hadn't
discovered this bug yet...)

However, the solution he provides doesn't work with FOP because as Simon points
out above "ConditionalPageMasterReference.isValid(isOddPage, isFirstPage,
isLastPage,isBlankPage) ... says explicitly that a conditional pagemaster
reference with page-position="last" is not valid for a first page." Looking at
the spec [2][3] I can't see any reason why that should be the case, though I'm
no expert in the spec, to be sure. Can one of the devs comment on this?

As a fix, I reordered the if statement in
ConditionalPageMasterReference.isValid so that the block for isLastPage comes
before the block for isFirstPage and removed 'return false' when pagePosition
== EN_FIRST in the isLastPage block (see code below). This appears to fix the
problem, at least for Ken's test file. Anyone see where this might blow up in
my face somewhere else? I ran the test suite and everything seemed to come out

The test case is attached.


Reordered 'if' from ConditionalPageMasterReference.isValid:
if (isOnlyPage) {
    if (pagePosition != EN_ONLY) {
        return false;
} else if (isLastPage) {
    if (pagePosition == EN_REST) {
        return false;
    } else if (pagePosition == EN_FIRST) {
        //return false;
} else if (isFirstPage) {
    if (pagePosition == EN_REST) {
        return false;
    } else if (pagePosition == EN_LAST) {
        return false;
} else {
    if (pagePosition == EN_FIRST) {
        return false;
    } else if (pagePosition == EN_LAST) {
        return false;

Configure bugmail:
------- You are receiving this mail because: -------
You are the assignee for the bug.

Reply via email to