From 23223ef4302931a6a141c659bfda7ef6c7546b77 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Wed, 6 May 2009 08:01:02 +0000 Subject: [PATCH] =?utf8?q?Endlosschleife=20im=20PDF-Tabellenmodul=20und=20?= =?utf8?q?damit=20im=20PDF-Export=20gefixt:=20Wenn=20die=20Tabelle=20zu=20?= =?utf8?q?breit=20wird=20und=20dann=20irgendwann=20nicht=20einmal=20mehr?= =?utf8?q?=20ein=20Wort=20in=20eine=20Zeile=20passt,=20dann=20muss=20das?= =?utf8?q?=20Wort=20trotzdem=20gesetzt=20werden;=20andernfalls=20w=C3=BCrd?= =?utf8?q?e=20das=20PDF::Table-Modul=20in=20einer=20Endlosschleife=20enden?= =?utf8?q?.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Fix für Bug 863. --- modules/override/PDF/Table.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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)); -- 2.20.1