diff --git a/widget/src/windows/nsFilePicker.cpp b/widget/src/windows/nsFilePicker.cpp index 53a2c9d7af6..3c2330efd23 100644 --- a/widget/src/windows/nsFilePicker.cpp +++ b/widget/src/windows/nsFilePicker.cpp @@ -150,7 +150,12 @@ NS_IMETHODIMP nsFilePicker::Show(PRInt16 *retval) mFile.Append(fileBuffer); } - return((PRBool)result); + if (result) + *retval = returnOK; + else + *retval = returnCancel; + + return NS_OK; } //------------------------------------------------------------------------- @@ -222,7 +227,10 @@ NS_IMETHODIMP nsFilePicker::AppendFilter(const PRUnichar *aTitle, NS_IMETHODIMP nsFilePicker::GetFile(nsILocalFile **aFile) { - /*NS_ENSURE_ARG_POINTER(*aFile); */ + NS_ENSURE_ARG_POINTER(aFile); + + if (mFile.IsEmpty()) + return NS_OK; nsCOMPtr file(do_CreateInstance("component://mozilla/file/local")); diff --git a/xpfe/browser/resources/content/navigator.js b/xpfe/browser/resources/content/navigator.js index b00eb704da1..a0514f8c5c2 100644 --- a/xpfe/browser/resources/content/navigator.js +++ b/xpfe/browser/resources/content/navigator.js @@ -713,9 +713,9 @@ function RevealSearchPanel() var fp = Components.classes["component://mozilla/filepicker"].createInstance(nsIFilePicker); fp.init(window, bundle.GetStringFromName("openFile"), nsIFilePicker.modeOpen); fp.setFilters(nsIFilePicker.filterAll); - fp.show(); - - openNewWindowWith(fp.fileURL.spec); + if (fp.show() == nsIFilePicker.returnOK) { + openNewWindowWith(fp.fileURL.spec); + } } catch (ex) { } }