From 1f2fd3c71eb1e30680d0abfc0cac1de4a54b2889 Mon Sep 17 00:00:00 2001 From: "jaggernaut%netscape.com" Date: Thu, 16 Feb 2006 21:32:01 +0000 Subject: [PATCH] Attempt to fix OS/2 bustage. --- widget/src/os2/nsDeviceContextSpecOS2.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/widget/src/os2/nsDeviceContextSpecOS2.cpp b/widget/src/os2/nsDeviceContextSpecOS2.cpp index 5c53bff68ca2..29758f3cd326 100644 --- a/widget/src/os2/nsDeviceContextSpecOS2.cpp +++ b/widget/src/os2/nsDeviceContextSpecOS2.cpp @@ -34,6 +34,7 @@ #include "nsISupportsPrimitives.h" #include "nsIWindowWatcher.h" #include "nsIDOMWindowInternal.h" +#include "nsUnicharUtils.h" PRINTDLG nsDeviceContextSpecOS2::PrnDlg; @@ -270,10 +271,11 @@ NS_IMETHODIMP nsDeviceContextSpecOS2::Init(nsIPrintSettings* aPS, PRBool aQuiet) if (NS_FAILED(rv)) return rv; + const nsAFlatString& printerUCS2 = NS_ConvertUTF8toUCS2(mPrData.printer); int numPrinters = GlobalPrinters::GetInstance()->GetNumPrinters(); if (numPrinters) { for(int i = 0; (i < numPrinters) && !mQueue; i++) { - if (!(GlobalPrinters::GetInstance()->GetStringAt(i)->CompareWithConversion(mPrData.printer, TRUE, -1))) + if ((GlobalPrinters::GetInstance()->GetStringAt(i)->Equals(printerUCS2, nsCaseInsensitiveStringComparator()))) mQueue = PrnDlg.SetPrinterQueue(i); } } @@ -421,7 +423,7 @@ NS_IMETHODIMP nsPrinterEnumeratorOS2::DisplayPropertiesDlg(const PRUnichar *aPri PRInt32 numPrinters = GlobalPrinters::GetInstance()->GetNumPrinters(); for(int i = 0; i < numPrinters; i++) { - if (!(GlobalPrinters::GetInstance()->GetStringAt(i)->CompareWithConversion(aPrinter, TRUE, -1))) { + if ((GlobalPrinters::GetInstance()->GetStringAt(i)->Equals(aPrinter, nsCaseInsensitiveStringComparator()))) { if ( nsDeviceContextSpecOS2::PrnDlg.ShowProperties(i) ) return NS_OK; else @@ -449,9 +451,9 @@ nsresult GlobalPrinters::InitializeGlobalPrinters () for (int i = 0; i < mGlobalNumPrinters; i++) { char *printer = nsDeviceContextSpecOS2::PrnDlg.GetPrinter(i); if ( defaultPrinter == i ) - mGlobalPrinterList->InsertStringAt(nsString(NS_ConvertASCIItoUCS2(printer)), 0); + mGlobalPrinterList->InsertStringAt(NS_ConvertASCIItoUCS2(printer), 0); else - mGlobalPrinterList->AppendString(nsString(NS_ConvertASCIItoUCS2(printer))); + mGlobalPrinterList->AppendString(NS_ConvertASCIItoUCS2(printer)); } return NS_OK; }