reportlab/platypus/tables.py
changeset 2474 5462fb8b792d
parent 2472 6795e616cdbe
child 2475 24a8e6ffc36a
--- a/reportlab/platypus/tables.py	Thu Mar 31 15:35:20 2005 +0000
+++ b/reportlab/platypus/tables.py	Fri Apr 01 09:38:18 2005 +0000
@@ -667,12 +667,16 @@
         W = list(self._argW)
         width = 0
         elementWidth = self._elementWidth
-        for colNo, w in enumerate(W):
+        rowNos = xrange(self._nrows)
+        values = self._cellvalues
+        styles = self._cellStyles
+        for colNo in xrange(len(W)):
+            w = W[colNo]
             if w is None or w=='*' or _endswith(w,'%'):
                 final = 0
-                for rowNo in range(self._nrows):
-                    value = self._cellvalues[rowNo][colNo]
-                    style = self._cellStyles[rowNo][colNo]
+                for rowNo in rowNos:
+                    value = values[rowNo][colNo]
+                    style = styles[rowNo][colNo]
                     new = (elementWidth(value,style)+
                            style.leftPadding+style.rightPadding)
                     final = max(final, new)