Bug 105151; check for ERROR_INVALID_PARAMATER and retry with empty file name (because we get that when the file name is too long); r=bryner, sr=hyatt
git-svn-id: svn://10.0.0.236/trunk@109910 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
parent
29fb01243a
commit
e8756b98a4
@ -187,6 +187,16 @@ NS_IMETHODIMP nsFilePicker::Show(PRInt16 *retval)
|
||||
}
|
||||
else if (mMode == modeSave) {
|
||||
result = ::GetSaveFileName(&ofn);
|
||||
if (!result) {
|
||||
// Error, find out what kind.
|
||||
DWORD error = ::GetLastError();
|
||||
if (error == ERROR_INVALID_PARAMETER) {
|
||||
// Parameter error; probably the default file name is too long.
|
||||
// Try again, without a starting file name.
|
||||
ofn.lpstrFile[0] = 0;
|
||||
result = ::GetSaveFileName(&ofn);
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
NS_ASSERTION(0, "Only load, save and getFolder are supported modes");
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user