src/reportlab/platypus/doctemplate.py
changeset 3009 71ae9bbac9fb
parent 2998 efe6a1d93dd2
child 3031 6f90e7668adb
--- a/src/reportlab/platypus/doctemplate.py	Wed Oct 15 22:35:07 2008 +0000
+++ b/src/reportlab/platypus/doctemplate.py	Thu Oct 16 12:56:05 2008 +0000
@@ -261,6 +261,13 @@
         this page."""
         pass
 
+def _addGeneratedContent(flowables,frame):
+    S = getattr(frame,'_generated_content',None)
+    if S:
+        for i,f in enumerate(S):
+            flowables.insert(i,f)
+        del frame._generated_content
+
 class BaseDocTemplate:
     """
     First attempt at defining a document template class.
@@ -621,13 +628,6 @@
         finally:
             if frame: del f._frame
 
-    def _addGeneratedContent(self,flowables,frame):
-        S = getattr(frame,'_generated_content',None)
-        if S:
-            for i,f in enumerate(S):
-                flowables.insert(i,f)
-            del frame._generated_content
-
     def handle_flowable(self,flowables):
         '''try to handle one flowable from the front of list flowables.'''
 
@@ -659,7 +659,7 @@
                 if not isinstance(f,FrameActionFlowable):
                     self._curPageFlowableCount += 1
                     self.afterFlowable(f)
-                self._addGeneratedContent(flowables,frame)
+                _addGeneratedContent(flowables,frame)
             else:
                 if self.allowSplitting:
                     # see if this is a splittable thing
@@ -672,7 +672,7 @@
                         if frame.add(S[0], canv, trySplit=0):
                             self._curPageFlowableCount += 1
                             self.afterFlowable(S[0])
-                            self._addGeneratedContent(flowables,frame)
+                            _addGeneratedContent(flowables,frame)
                         else:
                             ident = "Splitting error(n==%d) on page %d in\n%s" % (n,self.page,self._fIdent(f,60,frame))
                             #leave to keep apart from the raise