Bug 546716 - Port |Bug 422771 - reduce narrow windows API calls in browser| to comm-central; (Av1) Copy MessageBoxW() part, + another occurrence.
authorSerge Gautherie <sgautherie.bz@free.fr>
Thu, 11 Mar 2010 12:38:59 +0100
changeset 5141 33127bb0d789ead0a59d3a4d07a7c3ff41d1c749
parent 5140 080ae7e74aa37fc7d4ac6ffb7fdc32ff150f5f77
child 5142 a566062b1c0b1e39cc4b160f3fca691fc96b3c5c
push idunknown
push userunknown
push dateunknown
bugs546716, 422771
Bug 546716 - Port |Bug 422771 - reduce narrow windows API calls in browser| to comm-central; (Av1) Copy MessageBoxW() part, + another occurrence. r=standard8.
calendar/sunbird/app/nsCalendarApp.cpp
mail/app/nsMailApp.cpp
mailnews/import/outlook/src/MapiApi.cpp
suite/app/nsSuiteApp.cpp
--- a/calendar/sunbird/app/nsCalendarApp.cpp
+++ b/calendar/sunbird/app/nsCalendarApp.cpp
@@ -55,21 +55,19 @@
 #endif
 
 static void Output(const char *fmt, ... )
 {
   va_list ap;
   va_start(ap, fmt);
 
 #if defined(XP_WIN) && !MOZ_WINCONSOLE
-  char msg[2048];
-
-  _vsnprintf(msg, sizeof(msg), fmt, ap);
-
-  MessageBox(NULL, msg, "XULRunner", MB_OK | MB_ICONERROR);
+  PRUnichar msg[2048];
+  _vsnwprintf(msg, sizeof(msg)/sizeof(msg[0]), NS_ConvertUTF8toUTF16(fmt).get(), ap);
+  MessageBoxW(NULL, msg, L"XULRunner", MB_OK | MB_ICONERROR);
 #else
   vfprintf(stderr, fmt, ap);
 #endif
 
   va_end(ap);
 }
 
 int main(int argc, char* argv[])
--- a/mail/app/nsMailApp.cpp
+++ b/mail/app/nsMailApp.cpp
@@ -54,21 +54,19 @@
 #endif
 
 static void Output(const char *fmt, ... )
 {
   va_list ap;
   va_start(ap, fmt);
 
 #if defined(XP_WIN) && !MOZ_WINCONSOLE
-  char msg[2048];
-
-  _vsnprintf(msg, sizeof(msg), fmt, ap);
-
-  MessageBox(NULL, msg, "XULRunner", MB_OK | MB_ICONERROR);
+  PRUnichar msg[2048];
+  _vsnwprintf(msg, sizeof(msg)/sizeof(msg[0]), NS_ConvertUTF8toUTF16(fmt).get(), ap);
+  MessageBoxW(NULL, msg, L"XULRunner", MB_OK | MB_ICONERROR);
 #else
   vfprintf(stderr, fmt, ap);
 #endif
 
   va_end(ap);
 }
 
 /**
--- a/mailnews/import/outlook/src/MapiApi.cpp
+++ b/mailnews/import/outlook/src/MapiApi.cpp
@@ -810,17 +810,17 @@ BOOL CMapiApi::IterateStores( CMapiFolde
   /* -- Some Microsoft sample code just to see if things are working --- *//*
 
   ULONG    cbEIDStore;
   LPENTRYID  lpEIDStore;
 
     hr = HrMAPIFindDefaultMsgStore( m_lpSession, &cbEIDStore, &lpEIDStore);
     if (HR_FAILED(hr)) {
         MAPI_TRACE0( "Default message store not found\n");
-    // MessageBox(NULL,"Message Store Not Found",NULL,MB_OK);
+    // MessageBoxW(NULL, L"Message Store Not Found", NULL, MB_OK);
     }
   else {
     LPMDB  lpStore;
     MAPI_TRACE0( "Default Message store FOUND\n");
     hr = m_lpSession->OpenMsgStore( NULL, cbEIDStore,
                                   lpEIDStore, NULL,
                                   MDB_NO_MAIL | MDB_NO_DIALOG, &lpStore);
     if (HR_FAILED(hr)) {
--- a/suite/app/nsSuiteApp.cpp
+++ b/suite/app/nsSuiteApp.cpp
@@ -56,21 +56,19 @@
 #endif
 
 static void Output(const char *fmt, ... )
 {
   va_list ap;
   va_start(ap, fmt);
 
 #if defined(XP_WIN) && !MOZ_WINCONSOLE
-  char msg[2048];
-
-  _vsnprintf(msg, sizeof(msg), fmt, ap);
-
-  MessageBox(NULL, msg, "XULRunner", MB_OK | MB_ICONERROR);
+  PRUnichar msg[2048];
+  _vsnwprintf(msg, sizeof(msg)/sizeof(msg[0]), NS_ConvertUTF8toUTF16(fmt).get(), ap);
+  MessageBoxW(NULL, msg, L"XULRunner", MB_OK | MB_ICONERROR);
 #else
   vfprintf(stderr, fmt, ap);
 #endif
 
   va_end(ap);
 }
 
 /**