r=rods, sr=blizzard, a=rjesup@wgate.com OS/2 only - convert native printer names to Unicode git-svn-id: svn://10.0.0.236/trunk@190283 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
parent
44b4174634
commit
275d64c190
@ -507,10 +507,14 @@ nsresult GlobalPrinters::InitializeGlobalPrinters ()
|
||||
for (int i = 0; i < mGlobalNumPrinters; i++) {
|
||||
nsXPIDLCString printer;
|
||||
nsDeviceContextSpecOS2::PrnDlg.GetPrinter(i, getter_Copies(printer));
|
||||
PRUnichar* printerName = new PRUnichar[strlen(printer)+1];
|
||||
MultiByteToWideChar(0, printer, strlen(printer)+1, printerName, strlen(printer)+1);
|
||||
nsAutoString nativePrinterName(printerName);
|
||||
delete [] printerName;
|
||||
if ( defaultPrinter == i )
|
||||
mGlobalPrinterList->InsertStringAt(NS_ConvertASCIItoUCS2(printer), 0);
|
||||
mGlobalPrinterList->InsertStringAt(nativePrinterName, 0);
|
||||
else
|
||||
mGlobalPrinterList->AppendString(NS_ConvertASCIItoUCS2(printer));
|
||||
mGlobalPrinterList->AppendString(nativePrinterName);
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
@ -525,8 +529,12 @@ void GlobalPrinters::GetDefaultPrinterName(PRUnichar*& aDefaultPrinterName)
|
||||
int defaultPrinter = nsDeviceContextSpecOS2::PrnDlg.GetDefaultPrinter();
|
||||
nsXPIDLCString printer;
|
||||
nsDeviceContextSpecOS2::PrnDlg.GetPrinter(defaultPrinter, getter_Copies(printer));
|
||||
PRUnichar* printerName = new PRUnichar[strlen(printer)+1];
|
||||
MultiByteToWideChar(0, printer, strlen(printer)+1, printerName, strlen(printer)+1);
|
||||
nsAutoString nativePrinterName(printerName);
|
||||
delete [] printerName;
|
||||
|
||||
aDefaultPrinterName = ToNewUnicode(NS_ConvertASCIItoUCS2(printer));
|
||||
aDefaultPrinterName = ToNewUnicode(nativePrinterName);
|
||||
}
|
||||
|
||||
void GlobalPrinters::FreeGlobalPrinters()
|
||||
|
||||
@ -56,6 +56,7 @@
|
||||
#ifdef USE_XPRINT
|
||||
#include "nsIDeviceContextSpecXPrint.h"
|
||||
#endif /* USE_XPRINT */
|
||||
#include "nsGFXDefs.h"
|
||||
#include "nsPrintdOS2.h"
|
||||
#include <os2.h>
|
||||
#include <pmddim.h>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user