Bug 233299 nsIFilePicker.show is not reentrant - windows

r=neil sr=bz
This commit is contained in:
timeless%mozdev.org 2004-02-10 10:15:37 +00:00
Родитель f35be4bf50
Коммит 33301e74e1
1 изменённых файлов: 4 добавлений и 5 удалений

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

@ -112,7 +112,7 @@ NS_IMETHODIMP nsFilePicker::ShowW(PRInt16 *aReturnVal)
initialDir = mLastUsedUnicodeDirectory;
}
mUnicodeFile.SetLength(0);
mUnicodeFile.Truncate();
if (mMode == modeGetFolder) {
PRUnichar dirBuffer[MAX_PATH+1];
@ -134,7 +134,7 @@ NS_IMETHODIMP nsFilePicker::ShowW(PRInt16 *aReturnVal)
if (list != NULL) {
result = nsToolkit::mSHGetPathFromIDList(list, (LPWSTR)fileBuffer);
if (result) {
mUnicodeFile.Append(fileBuffer);
mUnicodeFile.Assign(fileBuffer);
}
// free PIDL
@ -277,7 +277,7 @@ NS_IMETHODIMP nsFilePicker::ShowW(PRInt16 *aReturnVal)
else {
// I think it also needs a conversion here (to unicode since appending to nsString)
// but doing that generates garbage file name, weird.
mUnicodeFile.Append(fileBuffer);
mUnicodeFile.Assign(fileBuffer);
}
}
@ -488,8 +488,7 @@ NS_IMETHODIMP nsFilePicker::InitNative(nsIWidget *aParent,
{
mParentWidget = aParent;
NS_IF_ADDREF(mParentWidget);
mTitle.SetLength(0);
mTitle.Append(aTitle);
mTitle.Assign(aTitle);
mMode = aMode;
return NS_OK;
}