Bug 776902 - vc11 nullptr fix for nsFilePicker. r=bbondy
☠☠ backed out by d5cb0a79fd36 ☠ ☠
authorJim Mathies <jmathies@mozilla.com>
Tue, 24 Jul 2012 15:07:41 -0500
changeset 100332 ea7070555f4faea52b9bba31a0acd39d654e2408
parent 100331 e78641108412f98a046350aa802c2c09e43e93cc
child 100333 4e122956dcc06993ff7d494f8c250247e5b4a297
child 100347 d5cb0a79fd36f20f278fe7f3d281be5b8476a9e8
push id23175
push useremorley@mozilla.com
push dateWed, 25 Jul 2012 15:03:49 +0000
treeherdermozilla-central@75d16b99e8ab [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbbondy
bugs776902
milestone17.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 776902 - vc11 nullptr fix for nsFilePicker. r=bbondy
widget/windows/nsFilePicker.cpp
--- a/widget/windows/nsFilePicker.cpp
+++ b/widget/windows/nsFilePicker.cpp
@@ -534,27 +534,27 @@ nsFilePicker::ShowXPFolderPicker(const n
     mParentWidget->GetNativeData(NS_NATIVE_TMP_WINDOW) : NULL));
 
   BROWSEINFOW browserInfo = {0};
   browserInfo.pidlRoot       = nsnull;
   browserInfo.pszDisplayName = (LPWSTR)dirBuffer;
   browserInfo.lpszTitle      = mTitle.get();
   browserInfo.ulFlags        = BIF_USENEWUI | BIF_RETURNONLYFSDIRS;
   browserInfo.hwndOwner      = adtw.get(); 
-  browserInfo.iImage         = nsnull;
+  browserInfo.iImage         = 0;
   browserInfo.lParam         = reinterpret_cast<LPARAM>(this);
 
   if (!aInitialDir.IsEmpty()) {
     // the dialog is modal so that |initialDir.get()| will be valid in 
     // BrowserCallbackProc. Thus, we don't need to clone it.
     browserInfo.lParam = (LPARAM) aInitialDir.get();
     browserInfo.lpfn   = &BrowseCallbackProc;
   } else {
-    browserInfo.lParam = nsnull;
-    browserInfo.lpfn   = nsnull;
+    browserInfo.lParam = 0;
+    browserInfo.lpfn   = NULL;
   }
 
   LPITEMIDLIST list = ::SHBrowseForFolderW(&browserInfo);
   if (list) {
     result = ::SHGetPathFromIDListW(list, (LPWSTR)dirBuffer);
     if (result)
       mUnicodeFile.Assign(dirBuffer);
     // free PIDL
@@ -772,17 +772,17 @@ nsFilePicker::ShowXPFilePicker(const nsS
 
         result = FilePickerWrapper(&ofn, PICKER_TYPE_SAVE);
         if (!result) {
           // Error, find out what kind.
           if (GetLastError() == ERROR_INVALID_PARAMETER ||
               CommDlgExtendedError() == FNERR_INVALIDFILENAME) {
             // Probably the default file name is too long or contains illegal
             // characters. Try again, without a starting file name.
-            ofn.lpstrFile[0] = nsnull;
+            ofn.lpstrFile[0] = L'\0';
             result = FilePickerWrapper(&ofn, PICKER_TYPE_SAVE);
           }
         }
       }
       break;
 
     default:
       NS_NOTREACHED("unsupported file picker mode");