src/reportlab/platypus/tables.py
changeset 3038 04d53e2083bd
parent 3031 6f90e7668adb
child 3151 be7033a8ccf9
--- a/src/reportlab/platypus/tables.py	Mon Jan 05 12:12:53 2009 +0000
+++ b/src/reportlab/platypus/tables.py	Mon Jan 05 13:02:48 2009 +0000
@@ -478,7 +478,6 @@
         return max([stringWidth(x,fontName,fontSize) for x in v])
 
     def _calc_height(self, availHeight, availWidth, H=None, W=None):
-
         H = self._argH
         if not W: W = _calc_pc(self._argW,availWidth)   #widths array
 
@@ -505,11 +504,6 @@
             FUZZ = rl_config._FUZZ
             while None in H:
                 i = H.index(None)
-                if longTable:
-                    hmax = i
-                    height = reduce(operator.add, H[:i], 0)
-                    # we can stop if we have filled up all available room
-                    if height > availHeight: break
                 V = self._cellvalues[i] # values for row i
                 S = self._cellStyles[i] # styles for row i
                 h = 0
@@ -547,6 +541,12 @@
                                 t = 0
                     if t>h: h = t   #record a new maximum
                 H[i] = h
+                # we can stop if we have filled up all available room
+                if longTable:
+                    hmax = i
+                    height = reduce(operator.add, H[:i], 0)
+                    if height > availHeight:
+                        break
             if None not in H: hmax = lim
 
             if spanCons: