bug 271732. Ensures that the file get dialog never returns a dereferenced shortcut. r=bryner, sr/a=dveditz

This commit is contained in:
dougt%meer.net 2005-02-11 23:32:03 +00:00
Родитель 5b3e8c1118
Коммит 4b5a2fad7a
1 изменённых файлов: 2 добавлений и 1 удалений

Просмотреть файл

@ -233,7 +233,7 @@ NS_IMETHODIMP nsFilePicker::ShowW(PRInt16 *aReturnVal)
result = nsToolkit::mGetOpenFileName(&ofn); result = nsToolkit::mGetOpenFileName(&ofn);
} }
else if (mMode == modeSave) { else if (mMode == modeSave) {
ofn.Flags |= OFN_NOREADONLYRETURN; ofn.Flags |= OFN_NOREADONLYRETURN | OFN_NODEREFERENCELINKS;
result = nsToolkit::mGetSaveFileName(&ofn); result = nsToolkit::mGetSaveFileName(&ofn);
if (!result) { if (!result) {
// Error, find out what kind. // Error, find out what kind.
@ -344,6 +344,7 @@ NS_IMETHODIMP nsFilePicker::ShowW(PRInt16 *aReturnVal)
// we must check if file already exists // we must check if file already exists
PRBool exists = PR_FALSE; PRBool exists = PR_FALSE;
file->Exists(&exists); file->Exists(&exists);
if (exists) if (exists)
returnOKorReplace = returnReplace; returnOKorReplace = returnReplace;
} }