Project: SWT
Bug 152718 StyledText printing feature doesn't work
Reported: 2006-08-03 06:00:27 | Status: resolved fixed

When I try to print StyledText content by calling method public Runnable print(Printer printer, StyledTextPrintOptions options); throws exception. I've noticed that it happen when styled text contains text with custom styles and not. For example first line is unstyled, second line has styled range with bold style. When I am trying print text rises exception: java.lang.NullPointerException at org.eclipse.swt.custom.StyledTextRenderer$LineInfo.<init>(StyledTextRenderer.java:82) at org.eclipse.swt.custom.StyledTextRenderer.copyInto(StyledTextRenderer.java:288) at org.eclipse.swt.custom.StyledText$Printing.cacheLineData(StyledText.java:236) at org.eclipse.swt.custom.StyledText$Printing.<init>(StyledText.java:225) at org.eclipse.swt.custom.StyledText.print(StyledText.java:5859)

Files changed in fix:
bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/StyledTextRenderer.java