Fop
  1. Fop
  2. FOP-1976

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

    Details

    • Type: Bug Bug
    • Status: Reopened
    • Resolution: Unresolved
    • Affects Version/s: 1.0
    • Fix Version/s: None
    • Component/s: page-master/layout
    • 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. smaller3page.fo
        31 kB
        Chris Bowditch
      2. pagebreaker.patch
        9 kB
        Mehdi Houshmand

        Issue Links

          Activity

          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
          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
          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
          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
          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
          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.

            People

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

              Dates

              • Created:
                Updated:

                Development