Commit 2eb171c1 authored by Felix Nawothnig's avatar Felix Nawothnig Committed by Alexandre Julliard

treeview: Initialize iImage and iSelectedImage with zero.

parent 5a220321
...@@ -70,6 +70,7 @@ static void IdentifyItem(HTREEITEM hItem) ...@@ -70,6 +70,7 @@ static void IdentifyItem(HTREEITEM hItem)
static void FillRoot(void) static void FillRoot(void)
{ {
TVINSERTSTRUCTA ins; TVINSERTSTRUCTA ins;
TVITEM tvi;
static CHAR root[] = "Root", static CHAR root[] = "Root",
child[] = "Child"; child[] = "Child";
...@@ -82,6 +83,13 @@ static void FillRoot(void) ...@@ -82,6 +83,13 @@ static void FillRoot(void)
hRoot = TreeView_InsertItem(hTree, &ins); hRoot = TreeView_InsertItem(hTree, &ins);
assert(hRoot); assert(hRoot);
/* UMLPad 1.15 depends on this being not -1 (I_IMAGECALLBACK) */
tvi.hItem = hRoot;
tvi.mask = TVIF_IMAGE | TVIF_SELECTEDIMAGE;
SendMessage( hTree, TVM_GETITEM, 0, (LPARAM)&tvi );
ok(tvi.iImage == 0, "tvi.iImage=%d\n", tvi.iImage);
ok(tvi.iSelectedImage == 0, "tvi.iSelectedImage=%d\n", tvi.iSelectedImage);
AddItem('B'); AddItem('B');
ins.hParent = hRoot; ins.hParent = hRoot;
ins.hInsertAfter = TVI_FIRST; ins.hInsertAfter = TVI_FIRST;
......
...@@ -1010,8 +1010,12 @@ TREEVIEW_AllocateItem(TREEVIEW_INFO *infoPtr) ...@@ -1010,8 +1010,12 @@ TREEVIEW_AllocateItem(TREEVIEW_INFO *infoPtr)
if (!newItem) if (!newItem)
return NULL; return NULL;
newItem->iImage = -1; /* I_IMAGENONE would make more sense but this is neither what is
newItem->iSelectedImage = -1; * documented (MSDN doesn't specify) nor what Windows actually does
* (it sets it to zero)... and I can so imagine an application using
* inc/dec to toggle the images. */
newItem->iImage = 0;
newItem->iSelectedImage = 0;
if (DPA_InsertPtr(infoPtr->items, INT_MAX, newItem) == -1) if (DPA_InsertPtr(infoPtr->items, INT_MAX, newItem) == -1)
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment