https://git.reactos.org/?p=reactos.git;a=commitdiff;h=b53d60cfc591ba94db6a72...
commit b53d60cfc591ba94db6a7264d74f55a48bbe4856 Author: Amine Khaldi amine.khaldi@reactos.org AuthorDate: Thu Jan 18 23:52:46 2018 +0100 Commit: Amine Khaldi amine.khaldi@reactos.org CommitDate: Thu Jan 18 23:52:46 2018 +0100
[COMDLG32] Sync with Wine 3.0. CORE-14225 --- dll/win32/comdlg32/filedlg.c | 34 +++++++++++++++++----------------- dll/win32/comdlg32/fontdlg.c | 27 +++++++++++++++++++++++++-- media/doc/README.WINE | 2 +- 3 files changed, 43 insertions(+), 20 deletions(-)
diff --git a/dll/win32/comdlg32/filedlg.c b/dll/win32/comdlg32/filedlg.c index b3b40e67e6..457ee9b13e 100644 --- a/dll/win32/comdlg32/filedlg.c +++ b/dll/win32/comdlg32/filedlg.c @@ -442,23 +442,6 @@ static BOOL GetFileDialog95(FileOpenDlgInfos *info, UINT dlg_type) ret = FALSE; }
- /* set the lpstrFileTitle */ - if (ret && info->ofnInfos->lpstrFile && info->ofnInfos->lpstrFileTitle) - { - if (info->unicode) - { - LPOPENFILENAMEW ofn = info->ofnInfos; - WCHAR *file_title = PathFindFileNameW(ofn->lpstrFile); - lstrcpynW(ofn->lpstrFileTitle, file_title, ofn->nMaxFileTitle); - } - else - { - LPOPENFILENAMEA ofn = (LPOPENFILENAMEA)info->ofnInfos; - char *file_title = PathFindFileNameA(ofn->lpstrFile); - lstrcpynA(ofn->lpstrFileTitle, file_title, ofn->nMaxFileTitle); - } - } - if (current_dir) { SetCurrentDirectoryW(current_dir); @@ -2677,6 +2660,23 @@ BOOL FILEDLG95_OnOpen(HWND hwnd) fodInfos->ofnInfos->nFileExtension = (*lpszTemp) ? (lpszTemp - tempFileA) + 1 : 0; }
+ /* set the lpstrFileTitle */ + if(fodInfos->ofnInfos->lpstrFileTitle) + { + LPWSTR lpstrFileTitle = PathFindFileNameW(lpstrPathAndFile); + if(fodInfos->unicode) + { + LPOPENFILENAMEW ofn = fodInfos->ofnInfos; + lstrcpynW(ofn->lpstrFileTitle, lpstrFileTitle, ofn->nMaxFileTitle); + } + else + { + LPOPENFILENAMEA ofn = (LPOPENFILENAMEA)fodInfos->ofnInfos; + WideCharToMultiByte(CP_ACP, 0, lpstrFileTitle, -1, + ofn->lpstrFileTitle, ofn->nMaxFileTitle, NULL, NULL); + } + } + /* copy currently selected filter to lpstrCustomFilter */ if (fodInfos->ofnInfos->lpstrCustomFilter) { diff --git a/dll/win32/comdlg32/fontdlg.c b/dll/win32/comdlg32/fontdlg.c index 6cc8c897bc..d4c90df05b 100644 --- a/dll/win32/comdlg32/fontdlg.c +++ b/dll/win32/comdlg32/fontdlg.c @@ -923,14 +923,37 @@ static LRESULT CFn_WMCommand(HWND hDlg, WPARAM wParam, LPARAM lParam, LPCHOOSEFO int i; long l; HDC hdc; + BOOL cmb_selected_by_edit = FALSE;
if (!lpcf) return FALSE;
+ if(HIWORD(wParam) == CBN_EDITCHANGE) + { + int idx; + WCHAR str_edit[256], str_cmb[256]; + int cmb = LOWORD(wParam); + + GetDlgItemTextW(hDlg, cmb, str_edit, sizeof(str_edit) / sizeof(str_edit[0])); + idx = SendDlgItemMessageW(hDlg, cmb, CB_FINDSTRING, -1, (LPARAM)str_edit); + if(idx != -1) + { + SendDlgItemMessageW(hDlg, cmb, CB_GETLBTEXT, idx, (LPARAM)str_cmb); + + /* Select listbox entry only if we have an exact match */ + if(lstrcmpiW(str_edit, str_cmb) == 0) + { + SendDlgItemMessageW(hDlg, cmb, CB_SETCURSEL, idx, 0); + SendDlgItemMessageW(hDlg, cmb, CB_SETEDITSEL, 0, -1); /* Remove edit field selection */ + cmb_selected_by_edit = TRUE; + } + } + } + TRACE("WM_COMMAND wParam=%08X lParam=%08lX\n", (LONG)wParam, lParam); switch (LOWORD(wParam)) { case cmb1: - if (HIWORD(wParam)==CBN_SELCHANGE) + if (HIWORD(wParam) == CBN_SELCHANGE || cmb_selected_by_edit) { INT pointsize; /* save current pointsize */ LONG pstyle; /* save current style */ @@ -981,7 +1004,7 @@ static LRESULT CFn_WMCommand(HWND hDlg, WPARAM wParam, LPARAM lParam, LPCHOOSEFO case cmb2: case cmb3: case cmb5: - if (HIWORD(wParam)==CBN_SELCHANGE || HIWORD(wParam)== BN_CLICKED ) + if (HIWORD(wParam) == CBN_SELCHANGE || HIWORD(wParam) == BN_CLICKED || cmb_selected_by_edit) { WCHAR str[256]; WINDOWINFO wininfo; diff --git a/media/doc/README.WINE b/media/doc/README.WINE index 270a296417..2de694b13d 100644 --- a/media/doc/README.WINE +++ b/media/doc/README.WINE @@ -55,7 +55,7 @@ reactos/dll/win32/cabinet # Synced to WineStaging-2.9 reactos/dll/win32/clusapi # Synced to WineStaging-2.9 reactos/dll/win32/comcat # Synced to WineStaging-2.9 reactos/dll/win32/comctl32 # Synced to Wine-3.0 -reactos/dll/win32/comdlg32 # Synced to WineStaging-2.16 +reactos/dll/win32/comdlg32 # Synced to Wine-3.0 reactos/dll/win32/compstui # Synced to WineStaging-2.9 reactos/dll/win32/credui # Synced to WineStaging-2.9 reactos/dll/win32/crypt32 # Synced to WineStaging-2.16