ChangeLog Adjust selection ranges before we insert the item so we don't mix the new selection with the existing ones (reported by Eric Pouech). Index: dlls/comctl32/listview.c =================================================================== RCS file: /var/cvs/wine/dlls/comctl32/listview.c,v retrieving revision 1.360 diff -u -r1.360 listview.c --- dlls/comctl32/listview.c 1 Sep 2003 23:55:33 -0000 1.360 +++ dlls/comctl32/listview.c 3 Sep 2003 15:32:36 -0000 @@ -5939,6 +5939,9 @@ if (nItem == -1) goto fail; infoPtr->nItemCount++; + /* shift indices first so they don't get tangled */ + LISTVIEW_ShiftIndices(infoPtr, nItem, 1); + /* set the item attributes */ if (lpLVItem->mask & (LVIF_GROUPID|LVIF_COLUMNS)) { @@ -5979,11 +5982,6 @@ } } - /* Add the subitem list to the items array. Do this last in case we go to - * fail during the above. - */ - LISTVIEW_ShiftIndices(infoPtr, nItem, 1); - /* send LVN_INSERTITEM notification */ ZeroMemory(&nmlv, sizeof(NMLISTVIEW)); nmlv.iItem = nItem; @@ -6008,6 +6006,7 @@ return nItem; undo: + LISTVIEW_ShiftIndices(infoPtr, nItem, -1); DPA_DeletePtr(infoPtr->hdpaItems, nItem); infoPtr->nItemCount--; fail: -- Dimi.