diff --git a/dlls/comctl32/comboex.c b/dlls/comctl32/comboex.c index 7be3b27540d..174c110c700 100644 --- a/dlls/comctl32/comboex.c +++ b/dlls/comctl32/comboex.c @@ -130,8 +130,6 @@ static LRESULT WINAPI COMBOEX_EditWndProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam); static LRESULT WINAPI COMBOEX_ComboWndProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam); -static int CALLBACK -COMBOEX_PathWordBreakProc(LPWSTR lpch, int ichCurrent, int cch, int code); static LRESULT COMBOEX_Destroy (COMBOEX_INFO *infoPtr); typedef INT (WINAPI *cmp_func_t)(LPCWSTR, LPCWSTR); @@ -674,11 +672,9 @@ COMBOEX_SetExtendedStyle (COMBOEX_INFO *infoPtr, DWORD mask, DWORD style) infoPtr->dwExtStyle = style; /* see if we need to change the word break proc on the edit */ - if ((infoPtr->dwExtStyle ^ dwTemp) & CBES_EX_PATHWORDBREAKPROC) { - SendMessageW(infoPtr->hwndEdit, EM_SETWORDBREAKPROC, 0, - (infoPtr->dwExtStyle & CBES_EX_PATHWORDBREAKPROC) ? - (LPARAM)COMBOEX_PathWordBreakProc : 0); - } + if ((infoPtr->dwExtStyle ^ dwTemp) & CBES_EX_PATHWORDBREAKPROC) + SetPathWordBreakProc(infoPtr->hwndEdit, + (infoPtr->dwExtStyle & CBES_EX_PATHWORDBREAKPROC) ? TRUE : FALSE); /* test if the control's appearance has changed */ mask = CBES_EX_NOEDITIMAGE | CBES_EX_NOEDITIMAGEINDENT; @@ -1650,30 +1646,6 @@ static LRESULT COMBOEX_WindowPosChanging (COMBOEX_INFO *infoPtr, WINDOWPOS *wp) return 0; } -static inline int is_delimiter(WCHAR c) -{ - switch(c) { - case '/': - case '\\': - case '.': - return TRUE; - } - return FALSE; -} - -static int CALLBACK -COMBOEX_PathWordBreakProc(LPWSTR lpch, int ichCurrent, int cch, int code) -{ - if (code == WB_ISDELIMITER) { - return is_delimiter(lpch[ichCurrent]); - } else { - int dir = (code == WB_LEFT) ? -1 : 1; - for(; 0 <= ichCurrent && ichCurrent < cch; ichCurrent += dir) - if (is_delimiter(lpch[ichCurrent])) return ichCurrent; - } - return ichCurrent; -} - static LRESULT WINAPI COMBOEX_EditWndProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { diff --git a/dlls/comctl32/comctl32.h b/dlls/comctl32/comctl32.h index 128f19bc1cc..a165ddd5b61 100644 --- a/dlls/comctl32/comctl32.h +++ b/dlls/comctl32/comctl32.h @@ -188,4 +188,7 @@ BOOL WINAPI DPA_Merge (const HDPA, const HDPA, DWORD, PFNDPACOMPARE, PFNDPAMERGE #define DPA_GetPtrCount(hdpa) (*(INT*)(hdpa)) +LRESULT WINAPI SetPathWordBreakProc(HWND hwnd, BOOL bSet); +BOOL WINAPI MirrorIcon(HICON *phicon1, HICON *phicon2); + #endif /* __WINE_COMCTL32_H */ diff --git a/dlls/comctl32/comctl32.spec b/dlls/comctl32/comctl32.spec index 41a36ced27d..89bea8ce82f 100644 --- a/dlls/comctl32/comctl32.spec +++ b/dlls/comctl32/comctl32.spec @@ -89,7 +89,7 @@ 377 stdcall -noname IntlStrEqWorkerW(long wstr wstr long) 382 stdcall -noname SmoothScrollWindow(ptr) 383 stub -noname DoReaderMode -384 stub -noname SetPathWordBreakProc +384 stdcall -noname SetPathWordBreakProc(ptr long) 385 stdcall -noname DPA_EnumCallback(long long long) 386 stdcall -noname DPA_DestroyCallback(ptr ptr long) 387 stdcall -noname DSA_EnumCallback(ptr ptr long) @@ -105,7 +105,7 @@ 411 stdcall GetWindowSubclass(long ptr long ptr) 412 stdcall RemoveWindowSubclass(long ptr long) 413 stdcall DefSubclassProc(long long long long) -414 stub -noname MirrorIcon +414 stdcall -noname MirrorIcon(ptr ptr) 415 stdcall -noname DrawTextWrap(long wstr long ptr long) user32.DrawTextW 416 stdcall -noname DrawTextExPrivWrap(long wstr long ptr long ptr) user32.DrawTextExW 417 stdcall -noname ExtTextOutWrap(long long long long ptr wstr long ptr) gdi32.ExtTextOutW diff --git a/dlls/comctl32/commctrl.c b/dlls/comctl32/commctrl.c index 798ed47859d..2afca787479 100644 --- a/dlls/comctl32/commctrl.c +++ b/dlls/comctl32/commctrl.c @@ -1485,3 +1485,67 @@ void COMCTL32_DrawInsertMark(HDC hDC, const RECT *lpRect, COLORREF clrInsertMark SelectObject(hDC, hOldPen); DeleteObject(hPen); } + +/*********************************************************************** + * MirrorIcon [COMCTL32.414] + * + * Mirrors an icon so that it will appear correctly on a mirrored DC. + * + * PARAMS + * phicon1 [I/O] Icon. + * phicon2 [I/O] Icon. + * + * RETURNS + * Success: TRUE. + * Failure: FALSE. + */ +BOOL WINAPI MirrorIcon(HICON *phicon1, HICON *phicon2) +{ + FIXME("(%p, %p): stub\n", phicon1, phicon2); + return FALSE; +} + +static inline int IsDelimiter(WCHAR c) +{ + switch(c) + { + case '/': + case '\\': + case '.': + case ' ': + return TRUE; + } + return FALSE; +} + +static int CALLBACK PathWordBreakProc(LPWSTR lpch, int ichCurrent, int cch, int code) +{ + if (code == WB_ISDELIMITER) + return IsDelimiter(lpch[ichCurrent]); + else + { + int dir = (code == WB_LEFT) ? -1 : 1; + for(; 0 <= ichCurrent && ichCurrent < cch; ichCurrent += dir) + if (IsDelimiter(lpch[ichCurrent])) return ichCurrent; + } + return ichCurrent; +} + +/*********************************************************************** + * SetPathWordBreakProc [COMCTL32.384] + * + * Sets the word break procedure for an edit control to one that understands + * paths so that the user can jump over directories. + * + * PARAMS + * hwnd [I] Handle to edit control. + * bSet [I] If this is TRUE then the word break proc is set, otherwise it is removed. + * + * RETURNS + * Result from EM_SETWORDBREAKPROC message. + */ +LRESULT WINAPI SetPathWordBreakProc(HWND hwnd, BOOL bSet) +{ + return SendMessageW(hwnd, EM_SETWORDBREAKPROC, 0, + (LPARAM)(bSet ? PathWordBreakProc : NULL)); +}