Skip to content

Commit

Permalink
Only save "NextPageDetailsInSequence" and "TransitionProperties" info…
Browse files Browse the repository at this point in the history
… when needed
  • Loading branch information
bertfrees committed Sep 4, 2019
1 parent a8534a9 commit d6ad13f
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,9 @@ private PageImpl nextPageInner(int pageNumberOffset, boolean hyphenateLastLine,
// previous page to the BlockLineLocation of the last line of the previous page. This
// info is used (in the next iteration) in SheetDataSource to obtain info about the
// verso page of a sheet when we are on a recto page of that sheet.
blockContext.getRefs().setNextPageDetailsInSequence(pcbl, current.getDetails());
if (transitionContent.isPresent() && transitionContent.get().getType()==TransitionContent.Type.INTERRUPT) {
blockContext.getRefs().setNextPageDetailsInSequence(pcbl, current.getDetails());
}
}
if (nextEmpty) {
nextEmpty = false;
Expand Down Expand Up @@ -477,7 +479,9 @@ private PageImpl nextPageInner(int pageNumberOffset, boolean hyphenateLastLine,
// Determine whether there is a block boundary on the page, with enough space
// available after this point for sequence-interrupted and any-interrupted.
boolean hasBlockBoundary = blockBoundary.isPresent()?blockBoundary.get():res.getHead().stream().filter(r->r.isLastRowGroupInBlock()).findFirst().isPresent();
bc.getRefs().keepTransitionProperties(current.getDetails().getPageLocation(), new TransitionProperties(current.getAvoidVolumeBreakAfter(), hasBlockBoundary));
if (transitionContent.isPresent() && transitionContent.get().getType()==TransitionContent.Type.INTERRUPT) {
bc.getRefs().keepTransitionProperties(current.getDetails().getPageLocation(), new TransitionProperties(current.getAvoidVolumeBreakAfter(), hasBlockBoundary));
}
}
// Discard collapsed margins, but retain their properties (identifiers, markers,
// keep-with-next-sheets, keep-with-previous-sheets).
Expand Down

0 comments on commit d6ad13f

Please sign in to comment.