Fop
  1. Fop
  2. FOP-1976

last simple-page-master not chosen when force-page-count=odd

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Resolution: Fixed
    • Affects Version/s: 1.0
    • Fix Version/s: trunk
    • Component/s: layout/unqualified
    • Labels:
      None
    • Environment:
      Operating System: Linux
      Platform: PC
    • External issue ID:
      51962

      Description

      If force-page-count="odd" and the first page has an overflowing region onto a second page, then the 3rd and last page should use the page-position="last" simple-page-master in the conditional-page-master-reference. However, it was using the "rest".

      I'm having a few issues with the apache git server, so I'll attach the patch when the issues have been resolved.

      1. pagebreaker.patch
        9 kB
        Mehdi Houshmand
      2. smaller3page.fo
        31 kB
        Chris Bowditch

        Issue Links

          Activity

          Hide
          Chris Bowditch added a comment -

          I've committed a change based on Matthias's suggestion in revision: 1608489

          This only addresses the problem when the start page != 1, not the issue of force-page-count="end-on-even" being handled the same as force-page-count="even" However, I feel that problem is out of scope for this bug, as it was originally opened to deal with the last page master not being selected for force-page-count="odd" (or even) Please feel free to open a separate JIRA regarding the difference between end-on-even and even.

          Show
          Chris Bowditch added a comment - I've committed a change based on Matthias's suggestion in revision: 1608489 This only addresses the problem when the start page != 1, not the issue of force-page-count="end-on-even" being handled the same as force-page-count="even" However, I feel that problem is out of scope for this bug, as it was originally opened to deal with the last page master not being selected for force-page-count="odd" (or even) Please feel free to open a separate JIRA regarding the difference between end-on-even and even.
          Hide
          Chris Bowditch added a comment -

          I've attached an example provided by Rob Sargent on the user mailing list. The page-sequence has force-page-count="even" A blank fourth page is added, but the last page master is not used.

          Show
          Chris Bowditch added a comment - I've attached an example provided by Rob Sargent on the user mailing list. The page-sequence has force-page-count="even" A blank fourth page is added, but the last page master is not used.
          Hide
          Chris Bowditch added a comment -

          Hi Matthias,

          Thanks for pointing out the flaw in the current logic. Can you upload a test FO file that demonstrates the issue?

          Thanks,

          Chris

          Show
          Chris Bowditch added a comment - Hi Matthias, Thanks for pointing out the flaw in the current logic. Can you upload a test FO file that demonstrates the issue? Thanks, Chris
          Hide
          Matthias Reischenbacher added a comment -

          Hi Mehdi, Peter,

          I believe that there is a small bug inside the new PageSequenceLayoutManager.getForcedLastPageNum() method:

          You're handling "even" and "end-on-even" the same way. I think that this is not entirely correct, because "even" only forces an even number of pages inside the current page-sequence, but not for the whole document. Since lastPageNum refers to the total amount of pages, the mod check should be done like that:

          (lastPageNum - startPageNum + 1) % 2 != 0

          The same applies to "odd" and "end-on-odd".

          Could you please check that?

          Thanks
          Matthias

          Show
          Matthias Reischenbacher added a comment - Hi Mehdi, Peter, I believe that there is a small bug inside the new PageSequenceLayoutManager.getForcedLastPageNum() method: You're handling "even" and "end-on-even" the same way. I think that this is not entirely correct, because "even" only forces an even number of pages inside the current page-sequence, but not for the whole document. Since lastPageNum refers to the total amount of pages, the mod check should be done like that: (lastPageNum - startPageNum + 1) % 2 != 0 The same applies to "odd" and "end-on-odd". Could you please check that? Thanks Matthias
          Hide
          Peter Hancock added a comment -

          {Patch applied in rev 1181660

          Thanks Mehdi

          Show
          Peter Hancock added a comment - {Patch applied in rev 1181660 Thanks Mehdi
          Hide
          Mehdi Houshmand added a comment -

          Attachment pagebreaker.patch has been added with description: Page breaker patch

          Show
          Mehdi Houshmand added a comment - Attachment pagebreaker.patch has been added with description: Page breaker patch
          Hide
          Mehdi Houshmand added a comment -

          This work is a collaboration between myself and Peter Hancock

          Show
          Mehdi Houshmand added a comment - This work is a collaboration between myself and Peter Hancock

            People

            • Assignee:
              Unassigned
              Reporter:
              Mehdi Houshmand
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development