IDEMPIERE-1440:line description alignment wrong on document printing / found issue printing a multiline string with empty lines

This commit is contained in:
Carlos Ruiz 2015-09-14 23:25:50 +02:00
parent 6ccc971cfe
commit 095f290eed
1 changed files with 4 additions and 1 deletions

View File

@ -434,7 +434,10 @@ public class TableElement extends PrintElement
String[] lines = Pattern.compile("\n", Pattern.MULTILINE).split(string);
for (int lineNo = 0; lineNo < lines.length; lineNo++)
{
AttributedString aString = new AttributedString(lines[lineNo]);
String str = lines[lineNo];
if (str.length() == 0)
str = " ";
AttributedString aString = new AttributedString(str);
aString.addAttribute(TextAttribute.FONT, font);
AttributedCharacterIterator iter = aString.getIterator();
LineBreakMeasurer measurer = new LineBreakMeasurer(iter, frc);