From 095f290eed1cb05e62a2791e54e965bdfe9c446e Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Mon, 14 Sep 2015 23:25:50 +0200 Subject: [PATCH] IDEMPIERE-1440:line description alignment wrong on document printing / found issue printing a multiline string with empty lines --- .../src/org/compiere/print/layout/TableElement.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/org.adempiere.base/src/org/compiere/print/layout/TableElement.java b/org.adempiere.base/src/org/compiere/print/layout/TableElement.java index cd1a26b2ba..7fe046e1ff 100644 --- a/org.adempiere.base/src/org/compiere/print/layout/TableElement.java +++ b/org.adempiere.base/src/org/compiere/print/layout/TableElement.java @@ -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);