X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=modules%2Foverride%2FPDF%2FTable.pm;h=7040b2958ac4dcc0583a3c328df35f8d711fb8d8;hb=863306157cee10bd58abb8f032083f04cea4e72b;hp=f950a723debf774dfded8308df94810d75f81149;hpb=233b76bd53f43b3bc63b6d25440b75e679c90057;p=kivitendo-erp.git diff --git a/modules/override/PDF/Table.pm b/modules/override/PDF/Table.pm index f950a723d..7040b2958 100644 --- a/modules/override/PDF/Table.pm +++ b/modules/override/PDF/Table.pm @@ -135,8 +135,8 @@ sub text_block { $line_width += $arg{'indent'}; } - # Lets take from paragraph as many words as we can put into $width - $indent; - while ( @paragraph and $text_object->advancewidth( join("\x20", @line)."\x20" . $paragraph[0]) + $line_width < $width ) { + # Lets take from paragraph as many words as we can put into $width - $indent;. Always take at least one word; otherwise we'd end up in an infinite loop. + while (!scalar(@line) || (@paragraph && ($text_object->advancewidth( join("\x20", @line)."\x20" . $paragraph[0]) + $line_width < $width))) { push(@line, shift(@paragraph)); } $line_width += $text_object->advancewidth(join('', @line));