зеркало из 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();
|
ppanel->Quit();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (result)
|
if (result) {
|
||||||
*retval = returnOK;
|
PRInt16 returnOKorReplace = returnOK;
|
||||||
else
|
|
||||||
*retval = returnCancel;
|
|
||||||
|
|
||||||
|
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;
|
return NS_OK;
|
||||||
|
|
||||||
// TODO: implement filters
|
// TODO: implement filters
|
||||||
|
|
Загрузка…
Ссылка в новой задаче