fix for 34651 r=sfraser a=leaf

This commit is contained in:
pavlov%netscape.com 2000-04-10 22:08:19 +00:00
parent 1ad23c1543
commit 5dd14170f8
2 changed files with 13 additions and 5 deletions

View File

@ -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<nsILocalFile> file(do_CreateInstance("component://mozilla/file/local"));

View File

@ -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) { }
}