Closed
Bug 707864
Opened 13 years ago
Closed 8 years ago
select to print with no printers installed results in app crash
Categories
(Core :: Printing: Setup, defect)
Tracking
()
RESOLVED
WONTFIX
People
(Reporter: lars.erdmann, Unassigned)
References
Details
Attachments
(1 file)
115.06 KB,
text/plain
|
Details |
User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729) Steps to reproduce: press print button (with no printer installed) Actual results: application crash Expected results: Error is in mozilla/widget/src/os2/nsDeviceContextSpecOS2.cpp#653 as a check is missing on if any printers are installed at all (derefencing "Elements" of a nsTArray is not allowed if array is empty). I suggest: void GlobalPrinters::GetDefaultPrinterName(PRUnichar*& aDefaultPrinterName) ... nsAutoChar16Buffer printerName; PRInt32 printerNameLength; MultiByteToWideChar(0, printer, strlen(printer), printerName, printerNameLength); if (!printerName.IsEmpty()) { aDefaultPrinterName = ToNewUnicode(nsDependentString(printerName.Elements())); } ... Same holds true (analogous) for this member function: nsresult GlobalPrinters::InitializeGlobalPrinters () }
Forgot: if (!printerName.IsEmpty()) { aDefaultPrinterName = ToNewUnicode(nsDependentString(printerName.Elements())); } else { aDefaultPrinterName = NULL; }
OS: Windows XP → OS/2
or rather (judging from the Windows implementation): if (!printerName.IsEmpty()) { aDefaultPrinterName = ToNewUnicode(nsDependentString(printerName.Elements())); } else { aDefaultPrinterName = ""; }
Updated•12 years ago
|
OS: OS/2 → Windows XP
Updated•12 years ago
|
OS: Windows XP → OS/2
Comment 5•8 years ago
|
||
OS/2 is no longer a supported platform.
Status: UNCONFIRMED → RESOLVED
Closed: 8 years ago
Resolution: --- → WONTFIX
You need to log in
before you can comment on or make changes to this bug.
Description
•