зеркало из https://github.com/mozilla/gecko-dev.git
Fixed saving over existing file bug 66745. r,m=Makoto Hamanaka (VYA04230@nifty.com), sr=sfraser.'
This commit is contained in:
Родитель
c5fd5ae0d3
Коммит
36637accb4
|
@ -178,11 +178,28 @@ NS_IMETHODIMP nsFilePicker::Show(PRInt16 *retval)
|
|||
ppanel->Quit();
|
||||
}
|
||||
|
||||
if (result)
|
||||
*retval = returnOK;
|
||||
else
|
||||
*retval = returnCancel;
|
||||
|
||||
if (result) {
|
||||
PRInt16 returnOKorReplace = returnOK;
|
||||
|
||||
if (mMode == modeSave) {
|
||||
// Windows does not return resultReplace,
|
||||
// we must check if file already exists
|
||||
nsCOMPtr<nsILocalFile> file(do_CreateInstance("@mozilla.org/file/local;1"));
|
||||
|
||||
NS_ENSURE_TRUE(file, NS_ERROR_FAILURE);
|
||||
|
||||
file->InitWithPath(mFile);
|
||||
|
||||
PRBool exists = PR_FALSE;
|
||||
file->Exists(&exists);
|
||||
if (exists)
|
||||
returnOKorReplace = returnReplace;
|
||||
}
|
||||
*retval = returnOKorReplace;
|
||||
}
|
||||
else {
|
||||
*retval = returnCancel;
|
||||
}
|
||||
return NS_OK;
|
||||
|
||||
// TODO: implement filters
|
||||
|
|
Загрузка…
Ссылка в новой задаче