Mike McCormack : commdlg:
Malformed filters are still added to the filter combo box.
Alexandre Julliard
julliard at wine.codeweavers.com
Mon Mar 27 05:29:04 CST 2006
Module: wine
Branch: refs/heads/master
Commit: 05eaadc1f771cf861c3cbebc6b8fd0d6fdaa542b
URL: http://source.winehq.org/git/?p=wine.git;a=commit;h=05eaadc1f771cf861c3cbebc6b8fd0d6fdaa542b
Author: Mike McCormack <mike at codeweavers.com>
Date: Sun Mar 26 11:35:52 2006 +0900
commdlg: Malformed filters are still added to the filter combo box.
---
dlls/commdlg/filedlg.c | 11 +++++++----
1 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/dlls/commdlg/filedlg.c b/dlls/commdlg/filedlg.c
index a3a4c83..428841f 100644
--- a/dlls/commdlg/filedlg.c
+++ b/dlls/commdlg/filedlg.c
@@ -2367,16 +2367,19 @@ static HRESULT FILEDLG95_FILETYPE_Init(H
lpstrDisplay = lpstrPos;
lpstrPos += strlenW(lpstrPos) + 1;
+ CBAddStringW(fodInfos->DlgInfos.hwndFileTypeCB, lpstrDisplay);
+
+ nFilters++;
+ /* malformed filters are added anyway... */
+ if (!*lpstrPos) break;
+
/* Copy the extensions */
- if (! *lpstrPos) return E_FAIL; /* malformed filter */
if (!(lpstrExt = MemAlloc((strlenW(lpstrPos)+1)*sizeof(WCHAR)))) return E_FAIL;
strcpyW(lpstrExt,lpstrPos);
lpstrPos += strlenW(lpstrPos) + 1;
/* Add the item at the end of the combo */
- CBAddStringW(fodInfos->DlgInfos.hwndFileTypeCB, lpstrDisplay);
- CBSetItemDataPtr(fodInfos->DlgInfos.hwndFileTypeCB, nFilters, lpstrExt);
- nFilters++;
+ CBSetItemDataPtr(fodInfos->DlgInfos.hwndFileTypeCB, nFilters-1, lpstrExt);
}
}
More information about the wine-cvs
mailing list