commdlg: Malformed filters are still added to the filter combo box.
This commit is contained in:
parent
316e5835a0
commit
05eaadc1f7
|
@ -2367,16 +2367,19 @@ static HRESULT FILEDLG95_FILETYPE_Init(HWND hwnd)
|
||||||
lpstrDisplay = lpstrPos;
|
lpstrDisplay = lpstrPos;
|
||||||
lpstrPos += strlenW(lpstrPos) + 1;
|
lpstrPos += strlenW(lpstrPos) + 1;
|
||||||
|
|
||||||
|
CBAddStringW(fodInfos->DlgInfos.hwndFileTypeCB, lpstrDisplay);
|
||||||
|
|
||||||
|
nFilters++;
|
||||||
|
/* malformed filters are added anyway... */
|
||||||
|
if (!*lpstrPos) break;
|
||||||
|
|
||||||
/* Copy the extensions */
|
/* Copy the extensions */
|
||||||
if (! *lpstrPos) return E_FAIL; /* malformed filter */
|
|
||||||
if (!(lpstrExt = MemAlloc((strlenW(lpstrPos)+1)*sizeof(WCHAR)))) return E_FAIL;
|
if (!(lpstrExt = MemAlloc((strlenW(lpstrPos)+1)*sizeof(WCHAR)))) return E_FAIL;
|
||||||
strcpyW(lpstrExt,lpstrPos);
|
strcpyW(lpstrExt,lpstrPos);
|
||||||
lpstrPos += strlenW(lpstrPos) + 1;
|
lpstrPos += strlenW(lpstrPos) + 1;
|
||||||
|
|
||||||
/* Add the item at the end of the combo */
|
/* Add the item at the end of the combo */
|
||||||
CBAddStringW(fodInfos->DlgInfos.hwndFileTypeCB, lpstrDisplay);
|
CBSetItemDataPtr(fodInfos->DlgInfos.hwndFileTypeCB, nFilters-1, lpstrExt);
|
||||||
CBSetItemDataPtr(fodInfos->DlgInfos.hwndFileTypeCB, nFilters, lpstrExt);
|
|
||||||
nFilters++;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue