summaryrefslogtreecommitdiffstats
path: root/bundles/org.eclipse.swt/Eclipse SWT Printing
diff options
context:
space:
mode:
authorCarolyn MacLeod <seven>2001-09-10 20:00:48 +0000
committerCarolyn MacLeod <seven>2001-09-10 20:00:48 +0000
commit37b249557ded98734edb9cf7f8639435161f49d6 (patch)
treeaecd3ea545c2dae80900e54cafb5e60882ecaca1 /bundles/org.eclipse.swt/Eclipse SWT Printing
parentac05b6199f666ed9c624db0b5527d6efde6a5a2f (diff)
downloadeclipse.platform.swt-37b249557ded98734edb9cf7f8639435161f49d6.tar.gz
eclipse.platform.swt-37b249557ded98734edb9cf7f8639435161f49d6.tar.xz
eclipse.platform.swt-37b249557ded98734edb9cf7f8639435161f49d6.zip
*** empty log message ***
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT Printing')
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT Printing/win32/org/eclipse/swt/printing/Printer.java10
1 files changed, 7 insertions, 3 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Printing/win32/org/eclipse/swt/printing/Printer.java b/bundles/org.eclipse.swt/Eclipse SWT Printing/win32/org/eclipse/swt/printing/Printer.java
index 33267dc032..f55ecb8cff 100755
--- a/bundles/org.eclipse.swt/Eclipse SWT Printing/win32/org/eclipse/swt/printing/Printer.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Printing/win32/org/eclipse/swt/printing/Printer.java
@@ -104,17 +104,21 @@ public static PrinterData[] getPrinterList() {
return printerList;
}
-/**
+/*
* Returns a <code>PrinterData</code> object representing
* the default printer.
*
- * @return the default printer or null if there is no default printer
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_UNSPECIFIED - if there are no valid printers
+ * </ul>
+ *
+ * @return the default printer data or null if there is no default printer
*/
static PrinterData getDefaultPrinterData() {
byte [] deviceName = null;
byte[] buf = new byte[1024];
int n = OS.GetProfileString(appName, keyName, new byte[] {0}, buf, buf.length);
- if (n == 0) return null;
+ if (n == 0) SWT.error(SWT.ERROR_UNSPECIFIED);
int commaIndex = 0;
while(buf[commaIndex] != ',' && commaIndex < buf.length) commaIndex++;
if (commaIndex < buf.length) {