]> git.llucax.com Git - mecon/meconlib.git/blobdiff - lib/MECON/PDF/Tabla.php
BugFix
[mecon/meconlib.git] / lib / MECON / PDF / Tabla.php
index db1f332c2d32992b16d30fea6a32c64fc6010c63..719962fd4c4b08157b69a9051a491a74d5f8b7da 100644 (file)
@@ -177,14 +177,16 @@ class MECON_PDF_Tabla extends MECON_PDF_Contenido {
         for ($row = 0; $row<$this->_tabla->getRowCount(); $row++) {
             for ($i=0; $i<$this->_tabla->getColCount(); $i++ ) {
                 $tmp = $this->_tabla->getCellAttributes($row,$i);
         for ($row = 0; $row<$this->_tabla->getRowCount(); $row++) {
             for ($i=0; $i<$this->_tabla->getColCount(); $i++ ) {
                 $tmp = $this->_tabla->getCellAttributes($row,$i);
-                 if(intval($tmp['width']) != 0)
+                if(@intval($tmp['width']) != 0)
                     $attr[$i] = intval($tmp['width']);
                     $attr[$i] = intval($tmp['width']);
-                if(count($attr) == $this->_tabla->getColCount())
-                  break;
+                if(@count($attr) == $this->_tabla->getColCount())
+                  break 2;
             }
             }
-            if(count($attr) == $this->_tabla->getColCount())
-               break;
         }
         }
+        
+        if (!isset($attr))
+            die ('Todas las columnas tienen que tener un ancho asignado');
+        
         $tmp = array_sum($attr);
         
         $attr2[0] = 0;
         $tmp = array_sum($attr);
         
         $attr2[0] = 0;
@@ -295,7 +297,7 @@ class MECON_PDF_Tabla extends MECON_PDF_Contenido {
                         }
 
                         if (@$estilo['colspan']) {
                         }
 
                         if (@$estilo['colspan']) {
-                            $jj += $estilo['colspan'];
+                            $jj += $estilo['colspan'] -1;
                         }
                         
                     }
                         }
                         
                     }
@@ -339,7 +341,7 @@ class MECON_PDF_Tabla extends MECON_PDF_Contenido {
                     }
                 }
                 if (@$estilo['colspan']) {
                     }
                 }
                 if (@$estilo['colspan']) {
-                    $j += $estilo['colspan'];
+                    $j += $estilo['colspan']-1;
                 }
 
             }
                 }
 
             }