Project: SWT
Bug 44474 StyledText does not handle case where printing not supported
Reported: 2003-10-08 12:36:21 | Status: resolved fixed

StyledText$Printing() assumes that printer.getPrinterData will return a non- null value. On machines where printing is not supported (or a printer is not installed) this is not true. Run Test_org_eclipse_swt_custom_StyledText.test_print on GTK or Mac and you will get an NPE. The test case and StyledText need to be modified to handle the case where no printer or printing support is available.

Files changed in fix:
bundles/org.eclipse.swt/Eclipse SWT Printing/carbon/org/eclipse/swt/printing/Printer.java bundles/org.eclipse.swt/Eclipse SWT Printing/gtk/org/eclipse/swt/printing/Printer.java bundles/org.eclipse.swt/Eclipse SWT Printing/photon/org/eclipse/swt/printing/Printer.java