Bug 665987 - Win32 nsFilePicker does not clear out mFiles. r=jmathies
authorBrian R. Bondy <netzen@gmail.com>
Fri, 19 Aug 2011 13:57:12 -0400
changeset 75576 bd9dd7e4c7ff976e31ddbd14be211219573aa2a8
parent 75575 9f28a8fec3cbd789ea67237e5780f382077967f1
child 75577 427f162c761c195d919f3a593c82bea0e4851ccf
push id3
push userfelipc@gmail.com
push dateFri, 30 Sep 2011 20:09:13 +0000
reviewersjmathies
bugs665987
milestone9.0a1
Bug 665987 - Win32 nsFilePicker does not clear out mFiles. r=jmathies
widget/src/windows/nsFilePicker.cpp
--- a/widget/src/windows/nsFilePicker.cpp
+++ b/widget/src/windows/nsFilePicker.cpp
@@ -356,16 +356,19 @@ NS_IMETHODIMP nsFilePicker::ShowW(PRInt1
                   MB_ICONERROR);
       result = PR_FALSE;
     }
 
     if (result) {
       // Remember what filter type the user selected
       mSelectedType = (PRInt16)ofn.nFilterIndex;
 
+      // Clear out any files from previous Show calls
+      mFiles.Clear();
+
       // Set user-selected location of file or directory
       if (mMode == modeOpenMultiple) {
         
         // from msdn.microsoft.com, "Open and Save As Dialog Boxes" section:
         // If you specify OFN_EXPLORER,
         // The directory and file name strings are NULL separated, 
         // with an extra NULL character after the last file name. 
         // This format enables the Explorer-style dialog boxes