Bug 233299 nsIFilePicker.show is not reentrant - beos and os/2

r=neil sr=bz a=dveditz
This commit is contained in:
timeless%mozdev.org 2004-02-16 05:31:11 +00:00
Родитель 4ed6be6c58
Коммит c2c321c9e1
2 изменённых файлов: 9 добавлений и 12 удалений

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

@ -170,9 +170,9 @@ NS_IMETHODIMP nsFilePicker::Show(PRInt16 *retval)
BPath *path = (BPath *)list->ItemAt(i);
if (path->InitCheck() == B_OK) {
mFile.SetLength(0);
mFile.Truncate();
// Single and Multiple are exclusive now, though, maybe there is sense
// to assign also firts list element to mFile even in openMultiple case ?
// to assign also first list element to mFile even in openMultiple case ?
if (mMode == modeOpenMultiple) {
nsCOMPtr<nsILocalFile> file = do_CreateInstance("@mozilla.org/file/local;1", &rv);
NS_ENSURE_SUCCESS(rv,rv);
@ -181,7 +181,7 @@ NS_IMETHODIMP nsFilePicker::Show(PRInt16 *retval)
rv = mFiles->AppendElement(file);
NS_ENSURE_SUCCESS(rv,rv);
} else {
if (i == 0) mFile.Append(path->Path());
if (i == 0) mFile.Assign(path->Path());
}
} else {
printf("path.init failed \n");
@ -197,8 +197,7 @@ NS_IMETHODIMP nsFilePicker::Show(PRInt16 *retval)
BPath path(&ref);
if (path.InitCheck() == B_OK) {
path.Append(savefilename.String(), true);
mFile.SetLength(0);
mFile.Append(path.Path());
mFile.Assign(path.Path());
}
}
else {
@ -358,8 +357,7 @@ NS_IMETHODIMP nsFilePicker::InitNative(nsIWidget *aParent,
view->UnlockLooper();
}
}
mTitle.SetLength(0);
mTitle.Append(aTitle);
mTitle.Assign(aTitle);
mMode = aMode;
return NS_OK;
}

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

@ -131,7 +131,7 @@ NS_IMETHODIMP nsFilePicker::Show(PRInt16 *retval)
if(initialDir.IsEmpty())
initialDir = mLastUsedDirectory;
mFile.SetLength(0);
mFile.Truncate();
FILEDLG filedlg;
memset(&filedlg, 0, sizeof(FILEDLG));
@ -152,7 +152,7 @@ NS_IMETHODIMP nsFilePicker::Show(PRInt16 *retval)
if (filedlg.lReturn == DID_OK) {
result = PR_TRUE;
mDisplayDirectory->InitWithNativePath(nsDependentCString(filedlg.szFullFile));
mFile.Append(filedlg.szFullFile);
mFile.Assign(filedlg.szFullFile);
}
}
else {
@ -302,7 +302,7 @@ NS_IMETHODIMP nsFilePicker::Show(PRInt16 *retval)
NS_ENSURE_SUCCESS(rv,rv);
}
} else {
mFile.Append(filedlg.szFullFile);
mFile.Assign(filedlg.szFullFile);
}
mSelectedType = (PRInt16)pmydata->ulCurExt;
}
@ -522,8 +522,7 @@ NS_IMETHODIMP nsFilePicker::InitNative(nsIWidget *aParent,
PRInt16 aMode)
{
mWnd = (HWND) ((aParent) ? aParent->GetNativeData(NS_NATIVE_WINDOW) : 0);
mTitle.SetLength(0);
mTitle.Append(aTitle);
mTitle.Assign(aTitle);
mMode = aMode;
return NS_OK;
}