diff options
author | Andreia Gaita <avidigal@novell.com> | 2006-12-02 03:08:11 +0300 |
---|---|---|
committer | Andreia Gaita <avidigal@novell.com> | 2006-12-02 03:08:11 +0300 |
commit | 4b9e94942771c723e7b0f88972416b80b58e5712 (patch) | |
tree | 3da2c020dd8fab50bfc80bfe7837e2b7a32361e7 /mcs/class/System.Drawing/System.Drawing.Printing | |
parent | 69b983337b73e7a1ee54a55989fe2cf1667c98e8 (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/ChangeLog | 7 | ||||
-rw-r--r-- | mcs/class/System.Drawing/System.Drawing.Printing/PrintingServicesUnix.cs | 5 |
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; } } |