[PATCH 1/2] comctl32: Call TREEVIEW_SendExpanded after expanding.

Florian Köberle florian at fkoeberle.de
Sat Jul 17 03:02:10 CDT 2010


---
 dlls/comctl32/tests/treeview.c |    1 -
 dlls/comctl32/treeview.c       |   13 +++++++++----
 2 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/dlls/comctl32/tests/treeview.c b/dlls/comctl32/tests/treeview.c
index 320deba..18528e3 100644
--- a/dlls/comctl32/tests/treeview.c
+++ b/dlls/comctl32/tests/treeview.c
@@ -918,7 +918,6 @@ static LRESULT CALLBACK parent_wnd_proc(HWND hWnd, UINT message, WPARAM wParam,
                   visibleItem = TreeView_GetNextItem(pHdr->hwndFrom, visibleItem, TVGN_NEXTVISIBLE);
                   *(HTREEITEM*)&rect = visibleItem;
                   ok(visibleItem != NULL, "There must be a visible item after the first visisble item.\n");
-                  todo_wine
                   ok(SendMessage(pHdr->hwndFrom, TVM_GETITEMRECT, TRUE, (LPARAM)&rect), "Failed to get rect for second visible item.\n");
                 }
                 break;
diff --git a/dlls/comctl32/treeview.c b/dlls/comctl32/treeview.c
index 5adbb30..2c3706e 100644
--- a/dlls/comctl32/treeview.c
+++ b/dlls/comctl32/treeview.c
@@ -3279,6 +3279,7 @@ TREEVIEW_Expand(TREEVIEW_INFO *infoPtr, TREEVIEW_ITEM *wineItem,
     LONG orgNextTop = 0;
     RECT scrollRect;
     TREEVIEW_ITEM *nextItem, *tmpItem;
+    BOOL sendsNotifications;
 
     TRACE("(%p, %p, partial=%d, %d\n", infoPtr, wineItem, bExpandPartial, bUser);
 
@@ -3301,8 +3302,9 @@ TREEVIEW_Expand(TREEVIEW_INFO *infoPtr, TREEVIEW_ITEM *wineItem,
 
     TRACE("TVE_EXPAND %p %s\n", wineItem, TREEVIEW_ItemName(wineItem));
 
-    if (bUser || ((wineItem->cChildren != 0) &&
-                  !(wineItem->state & TVIS_EXPANDEDONCE)))
+    sendsNotifications = bUser || ((wineItem->cChildren != 0) &&
+                                    !(wineItem->state & TVIS_EXPANDEDONCE));
+    if (sendsNotifications)
     {
 	if (!TREEVIEW_SendExpanding(infoPtr, wineItem, TVE_EXPAND))
 	{
@@ -3314,8 +3316,6 @@ TREEVIEW_Expand(TREEVIEW_INFO *infoPtr, TREEVIEW_ITEM *wineItem,
             return FALSE;
 
 	wineItem->state |= TVIS_EXPANDED;
-	TREEVIEW_SendExpanded(infoPtr, wineItem, TVE_EXPAND);
-	wineItem->state |= TVIS_EXPANDEDONCE;
     }
     else
     {
@@ -3384,6 +3384,11 @@ TREEVIEW_Expand(TREEVIEW_INFO *infoPtr, TREEVIEW_ITEM *wineItem,
         }
     }
 
+    if (sendsNotifications) {
+        TREEVIEW_SendExpanded(infoPtr, wineItem, TVE_EXPAND);
+        wineItem->state |= TVIS_EXPANDEDONCE;
+    }
+
     return TRUE;
 }
 
-- 
1.7.0.4




More information about the wine-patches mailing list