PaperClips not prints ending line breaks in TextPrint

10 views
Skip to first unread message

krgr

unread,
Nov 6, 2010, 7:10:41 AM11/6/10
to SWT PaperClips
Hi,

When I declare something like that:

TextPrint text = new TextPrint("text\r\n\r\n\r\n");

there will be just "text" printed out withouth trailing empty lines. I
don't know if it is a feature or bug, but I have multiline controls
when user may enter text and he adds empty lines, which are not
visible on the printout.

I think that is because in TextIterator constructor there is a line:

this.lines = print.getText().split("(\r)?\n");

which splits the text, but ending line breaks are ignored. To preserve
ending line breaks, the above code should be changed to something like
that:

this.lines = print.getText().split("(\r)?\n", -2);

Am I correct, or missing something ?

Matthew Hall

unread,
Apr 11, 2012, 3:46:10 PM4/11/12
to swt-pap...@googlegroups.com
Hi,

StyledTextPrint will do what you want. Have a look at the newline() method.

-Matthew
Reply all
Reply to author
Forward
0 new messages