Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreia Gaita <avidigal@novell.com>2006-12-02 03:08:11 +0300
committerAndreia Gaita <avidigal@novell.com>2006-12-02 03:08:11 +0300
commit4b9e94942771c723e7b0f88972416b80b58e5712 (patch)
tree3da2c020dd8fab50bfc80bfe7837e2b7a32361e7 /mcs/class/System.Drawing/System.Drawing.Printing
parent69b983337b73e7a1ee54a55989fe2cf1667c98e8 (diff)
2006-12-01 Andreia Gaita <avidigal@novell.com>
* PrintingServicesUnix: *properly* check return value from cupsGetDefault. If there are no default printers set, check if there are installed printers, and use that. Hopefully fixes #79835 svn path=/trunk/mcs/; revision=68872
Diffstat (limited to 'mcs/class/System.Drawing/System.Drawing.Printing')
-rw-r--r--mcs/class/System.Drawing/System.Drawing.Printing/ChangeLog7
-rw-r--r--mcs/class/System.Drawing/System.Drawing.Printing/PrintingServicesUnix.cs5
2 files changed, 11 insertions, 1 deletions
diff --git a/mcs/class/System.Drawing/System.Drawing.Printing/ChangeLog b/mcs/class/System.Drawing/System.Drawing.Printing/ChangeLog
index 292d4b142c7..2c5ea74fc15 100644
--- a/mcs/class/System.Drawing/System.Drawing.Printing/ChangeLog
+++ b/mcs/class/System.Drawing/System.Drawing.Printing/ChangeLog
@@ -1,5 +1,12 @@
2006-12-01 Andreia Gaita <avidigal@novell.com>
+ * PrintingServicesUnix: *properly* check return value from
+ cupsGetDefault. If there are no default printers set,
+ check if there are installed printers, and use that.
+ Hopefully fixes #79835
+
+2006-12-01 Andreia Gaita <avidigal@novell.com>
+
* PrintingServicesUnix: check return value from cupsGetDefault.
Hopefully fixes #79835
diff --git a/mcs/class/System.Drawing/System.Drawing.Printing/PrintingServicesUnix.cs b/mcs/class/System.Drawing/System.Drawing.Printing/PrintingServicesUnix.cs
index afcf9b29c8d..14a7efedc29 100644
--- a/mcs/class/System.Drawing/System.Drawing.Printing/PrintingServicesUnix.cs
+++ b/mcs/class/System.Drawing/System.Drawing.Printing/PrintingServicesUnix.cs
@@ -333,8 +333,11 @@ namespace System.Drawing.Printing
return string.Empty;
str = cupsGetDefault ();
- if (str == IntPtr.Zero)
+ if (str != IntPtr.Zero)
return Marshal.PtrToStringAnsi (str);
+ PrinterSettings.StringCollection printers = this.InstalledPrinters;
+ if (printers.Count > 0)
+ return printers[0];
return String.Empty;
}
}