flowables: add SlowPageBreak
authorrgbecker
Wed, 10 Nov 2004 18:35:10 +0000
changeset 2408 1c5e79611b59
parent 2407 71caad345e58
child 2409 0a056aeb6a2c
flowables: add SlowPageBreak
reportlab/platypus/doctemplate.py
reportlab/platypus/flowables.py
--- a/reportlab/platypus/doctemplate.py	Tue Nov 09 11:49:50 2004 +0000
+++ b/reportlab/platypus/doctemplate.py	Wed Nov 10 18:35:10 2004 +0000
@@ -414,9 +414,9 @@
                 pass    #store good state here
         self._hanging.append(PageBegin)
 
-    def handle_pageBreak(self):
+    def handle_pageBreak(self,slow=None):
         '''some might choose not to end all the frames'''
-        if self._pageBreakQuick:
+        if self._pageBreakQuick and not slow:
             self.handle_pageEnd()
         else:
             n = len(self._hanging)
@@ -549,7 +549,10 @@
             return
 
         if isinstance(f,PageBreak):
-            self.handle_pageBreak()
+            if isinstance(f,SlowPageBreak):
+                self.handle_pageBreak(slow=1)
+            else:
+                self.handle_pageBreak()
             self.afterFlowable(f)
         elif isinstance(f,ActionFlowable):
             f.apply(self)
--- a/reportlab/platypus/flowables.py	Tue Nov 09 11:49:50 2004 +0000
+++ b/reportlab/platypus/flowables.py	Wed Nov 10 18:35:10 2004 +0000
@@ -408,6 +408,9 @@
         self.height = availHeight
         return (availWidth,availHeight)  #step back a point
 
+class SlowPageBreak(PageBreak):
+    pass
+
 class CondPageBreak(Spacer):
     """Throw a page if not enough vertical space"""
     def __init__(self, height):