[otrs-cvs] CVS: otrs/Kernel/System PDF.pm,1.9,1.10

cvs-log at otrs.org cvs-log at otrs.org
Mon Aug 21 22:12:31 CEST 2006


Update of /home/cvs/otrs/Kernel/System
In directory lancelot:/tmp/cvs-serv31608/Kernel/System

Modified Files:
	PDF.pm 
Log Message:
redesiged Table() to fix a lot of infinite loop bugs

Index: PDF.pm
===================================================================
RCS file: /home/cvs/otrs/Kernel/System/PDF.pm,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -r1.9 -r1.10
*** PDF.pm	8 Aug 2006 14:54:02 -0000	1.9
--- PDF.pm	21 Aug 2006 19:12:29 -0000	1.10
***************
*** 608,612 ****
      (%Return, $CellData, $ColumnData) = $PDFObject->Table(
          CellData => $CellData,            # 2D arrayref (see example)
!         ColumnData => $ColumnData,        # 2D arrayref (see example)
          Width => 300,                     # (optional) default maximal width
          Height => 400,                    # (optional) default minimal height
--- 608,614 ----
      (%Return, $CellData, $ColumnData) = $PDFObject->Table(
          CellData => $CellData,            # 2D arrayref (see example)
!         ColumnData => $ColumnData,        # arrayref (see example)
!         RowData => $RowData,              # arrayref (see example)
[...1362 lines suppressed...]
*** 2135,2138 ****
--- 2365,2382 ----
              push (@PossibleRows, $Row);
              $Return{RequiredHeight} += $RowHeight;
+ 
+             # check, if min one character can count (protection of infinite loop)
+             if (defined($Param{Text})) {
+                 if (length($Param{Text}) >= $TextLength) {
+                     $Return{RequiredWidth} = 0;
+                     $Return{RequiredHeight} = 0;
+                     $Return{LeftOver} = $Param{Text};
+                     $Param{Text} = undef;
+                     @PossibleRows = ();
+                 }
+                 else {
+                     $TextLength = length($Param{Text});
+                 }
+             }
          }
          else {



More information about the cvs-log mailing list