Bug 712571 - Fix for nsIFilePicker filterIndex always returning 0 on Vista and up. r=neil.
authorJim Mathies <jmathies@mozilla.com>
Tue, 03 Jan 2012 08:59:29 -0600
changeset 84913 dd08f68dce1b1f389d055bd13d4c908497fef053
parent 84912 e6e6d271538cc8443725ae27b47d315a512731a5
child 84914 ea1181d6a8167ddbcd35d2d01d0d815e48a9718b
push id805
push userakeybl@mozilla.com
push dateWed, 01 Feb 2012 18:17:35 +0000
treeherdermozilla-aurora@6fb3bf232436 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersneil
bugs712571
milestone12.0a1
Bug 712571 - Fix for nsIFilePicker filterIndex always returning 0 on Vista and up. r=neil.
widget/src/windows/nsFilePicker.cpp
--- a/widget/src/windows/nsFilePicker.cpp
+++ b/widget/src/windows/nsFilePicker.cpp
@@ -968,16 +968,22 @@ nsFilePicker::ShowFilePicker(const nsStr
       dialog->Unadvise(mFDECookie);
       return false;
     }
     dialog->Unadvise(mFDECookie);
   }
 
   // results
 
+  // Remember what filter type the user selected
+  UINT filterIdxResult;
+  if (SUCCEEDED(dialog->GetFileTypeIndex(&filterIdxResult))) {
+    mSelectedType = (PRInt16)filterIdxResult;
+  }
+
   // single selection
   if (mMode != modeOpenMultiple) {
     nsRefPtr<IShellItem> item;
     if (FAILED(dialog->GetResult(getter_AddRefs(item))) || !item) {
       return false;
     }
 
     LPWSTR str = NULL;