@@ -490,8 +490,9 @@ def block_container_layout(context, box, max_position_y, skip_stack,
490
490
if over_orphans < 0 and not page_is_empty :
491
491
# Reached the bottom of the page before we had
492
492
# enough lines for orphans, cancel the whole box.
493
+ page = child .page_values ()[0 ]
493
494
return (
494
- None , None , {'break' : 'any' , 'page' : None }, [],
495
+ None , None , {'break' : 'any' , 'page' : page }, [],
495
496
False )
496
497
# How many lines we need on the next page to satisfy widows
497
498
# -1 for the current line.
@@ -503,8 +504,9 @@ def block_container_layout(context, box, max_position_y, skip_stack,
503
504
break
504
505
if needed > over_orphans and not page_is_empty :
505
506
# Total number of lines < orphans + widows
507
+ page = child .page_values ()[0 ]
506
508
return (
507
- None , None , {'break' : 'any' , 'page' : None }, [],
509
+ None , None , {'break' : 'any' , 'page' : page }, [],
508
510
False )
509
511
if needed and needed <= over_orphans :
510
512
# Remove lines to keep them for the next page
@@ -548,6 +550,7 @@ def block_container_layout(context, box, max_position_y, skip_stack,
548
550
elif page_break not in ('left' , 'right' , 'recto' , 'verso' ):
549
551
assert page_name
550
552
page_break = 'any'
553
+ page_name = child .page_values ()[0 ]
551
554
next_page = {'break' : page_break , 'page' : page_name }
552
555
resume_at = (index , None )
553
556
break
@@ -661,8 +664,9 @@ def block_container_layout(context, box, max_position_y, skip_stack,
661
664
# The page has content *before* this block:
662
665
# cancel the block and try to find a break
663
666
# in the parent.
667
+ page = child .page_values ()[0 ]
664
668
return (
665
- None , None , {'break' : 'any' , 'page' : None }, [],
669
+ None , None , {'break' : 'any' , 'page' : page }, [],
666
670
False )
667
671
# else:
668
672
# ignore this 'avoid' and break anyway.
@@ -673,8 +677,9 @@ def block_container_layout(context, box, max_position_y, skip_stack,
673
677
else :
674
678
# This was the first child of this box, cancel the box
675
679
# completly
680
+ page = child .page_values ()[0 ]
676
681
return (
677
- None , None , {'break' : 'any' , 'page' : None }, [], False )
682
+ None , None , {'break' : 'any' , 'page' : page }, [], False )
678
683
679
684
# Bottom borders may overflow here
680
685
# TODO: back-track somehow when all lines fit but not borders
0 commit comments