Nikolay Sivov : comctl32/comboex: Don' t invalidate all windows if Edit box isn't set up.

Alexandre Julliard julliard at winehq.org
Thu Dec 24 10:27:18 CST 2009


Module: wine
Branch: master
Commit: 7d748b6ba0f7da0f18e88de91e6117b8793af6c0
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=7d748b6ba0f7da0f18e88de91e6117b8793af6c0

Author: Nikolay Sivov <bunglehead at gmail.com>
Date:   Wed Dec 23 23:32:21 2009 +0300

comctl32/comboex: Don't invalidate all windows if Edit box isn't set up.

---

 dlls/comctl32/comboex.c |   14 +++++---------
 1 files changed, 5 insertions(+), 9 deletions(-)

diff --git a/dlls/comctl32/comboex.c b/dlls/comctl32/comboex.c
index 1609b90..185f1e1 100644
--- a/dlls/comctl32/comboex.c
+++ b/dlls/comctl32/comboex.c
@@ -1149,7 +1149,7 @@ static LRESULT COMBOEX_Command (COMBOEX_INFO *infoPtr, WPARAM wParam)
 	 */
 	ShowWindow (infoPtr->hwndEdit, SW_SHOW);
 	InvalidateRect (infoPtr->hwndCombo, 0, TRUE);
-	InvalidateRect (infoPtr->hwndEdit, 0, TRUE);
+	if (infoPtr->hwndEdit) InvalidateRect (infoPtr->hwndEdit, 0, TRUE);
 	cursel = SendMessageW (infoPtr->hwndCombo, CB_GETCURSEL, 0, 0);
 	if (cursel == -1) {
             cmp_func_t cmptext = get_cmp_func(infoPtr);
@@ -1164,8 +1164,7 @@ static LRESULT COMBOEX_Command (COMBOEX_INFO *infoPtr, WPARAM wParam)
 	    if ((cursel == n) || ((INT_PTR)item == CB_ERR)) {
 		TRACE("failed to find match??? item=%p cursel=%d\n",
 		      item, cursel);
-		if (infoPtr->hwndEdit)
-		    SetFocus(infoPtr->hwndEdit);
+		if (infoPtr->hwndEdit) SetFocus(infoPtr->hwndEdit);
 		return 0;
 	    }
 	}
@@ -1174,8 +1173,7 @@ static LRESULT COMBOEX_Command (COMBOEX_INFO *infoPtr, WPARAM wParam)
 	    if ((INT_PTR)item == CB_ERR) {
 		TRACE("failed to find match??? item=%p cursel=%d\n",
 		      item, cursel);
-		if (infoPtr->hwndEdit)
-		    SetFocus(infoPtr->hwndEdit);
+		if (infoPtr->hwndEdit) SetFocus(infoPtr->hwndEdit);
 		return 0;
 	    }
 	}
@@ -1271,8 +1269,7 @@ static LRESULT COMBOEX_Command (COMBOEX_INFO *infoPtr, WPARAM wParam)
 	 * after passing the command to the parent of the ComboEx.
 	 */
 	lret = SendMessageW (parent, WM_COMMAND, wParam, (LPARAM)infoPtr->hwndSelf);
-	if (infoPtr->hwndEdit)
-	    SetFocus(infoPtr->hwndEdit);
+	if (infoPtr->hwndEdit) SetFocus(infoPtr->hwndEdit);
 	return lret;
     }
     return 0;
@@ -1374,8 +1371,7 @@ static LRESULT COMBOEX_DrawItem (const COMBOEX_INFO *infoPtr, DRAWITEMSTRUCT con
 		GetWindowRect (infoPtr->hwndSelf, &exrc);
 		GetWindowRect (infoPtr->hwndCombo, &cbrc);
 		edrc.left=edrc.top=edrc.right=edrc.bottom=-1;
-		if (infoPtr->hwndEdit)
-		    GetWindowRect (infoPtr->hwndEdit, &edrc);
+		if (infoPtr->hwndEdit) GetWindowRect (infoPtr->hwndEdit, &edrc);
                 TRACE("window rects ex=(%s), cb=(%s), ed=(%s)\n",
                       wine_dbgstr_rect(&exrc), wine_dbgstr_rect(&cbrc),
                       wine_dbgstr_rect(&edrc));




More information about the wine-cvs mailing list