X-Git-Url: https://git.reactos.org/?p=reactos.git;a=blobdiff_plain;f=reactos%2Fdll%2Fwin32%2Fcomctl32%2Flistview.c;h=efc6ea49ce1e28a2870b34f77bb75c8b3d7067a3;hp=a1de8a6815c31d35445f59b09a8fb861428b970e;hb=1f1e8b05a2ab2c412d5c4f442f0e063806e03d4f;hpb=d3ddfb63dd07fea7999556a765c737eb42b5f058 diff --git a/reactos/dll/win32/comctl32/listview.c b/reactos/dll/win32/comctl32/listview.c index a1de8a6815c..efc6ea49ce1 100644 --- a/reactos/dll/win32/comctl32/listview.c +++ b/reactos/dll/win32/comctl32/listview.c @@ -63,9 +63,9 @@ * -- if list is sorted by item text LISTVIEW_InsertItemT could use * binary search to calculate item index (e.g. DPA_Search()). * This requires sorted state to be reliably tracked in item modifiers. - * -- we should keep an ordered array of coordinates in iconic mode - * this would allow to frame items (iterator_frameditems), - * and find nearest item (LVFI_NEARESTXY) a lot more efficiently + * -- we should keep an ordered array of coordinates in iconic mode. + * This would allow framing items (iterator_frameditems), + * and finding the nearest item (LVFI_NEARESTXY) a lot more efficiently. * * Flags * -- LVIF_COLUMNS @@ -571,7 +571,7 @@ static const char* debugscrollinfo(const SCROLLINFO *pScrollInfo) int len, size = DEBUG_BUFFER_SIZE; if (pScrollInfo == NULL) return "(null)"; - len = snprintf(buf, size, "{cbSize=%d, ", pScrollInfo->cbSize); + len = snprintf(buf, size, "{cbSize=%u, ", pScrollInfo->cbSize); if (len == -1) goto end; buf += len; size -= len; if (pScrollInfo->fMask & SIF_RANGE) len = snprintf(buf, size, "nMin=%d, nMax=%d, ", pScrollInfo->nMin, pScrollInfo->nMax); @@ -4122,6 +4122,7 @@ static LRESULT LISTVIEW_MouseMove(LISTVIEW_INFO *infoPtr, WORD fwKeys, INT x, IN /* see if we are supposed to be tracking mouse hovering */ if (LISTVIEW_IsHotTracking(infoPtr)) { TRACKMOUSEEVENT trackinfo; + DWORD flags; trackinfo.cbSize = sizeof(TRACKMOUSEEVENT); trackinfo.dwFlags = TME_QUERY; @@ -4129,8 +4130,12 @@ static LRESULT LISTVIEW_MouseMove(LISTVIEW_INFO *infoPtr, WORD fwKeys, INT x, IN /* see if we are already tracking this hwnd */ _TrackMouseEvent(&trackinfo); - if(!(trackinfo.dwFlags & TME_HOVER) || trackinfo.hwndTrack != infoPtr->hwndSelf) { - trackinfo.dwFlags = TME_HOVER; + flags = TME_LEAVE; + if(infoPtr->dwLvExStyle & LVS_EX_TRACKSELECT) + flags |= TME_HOVER; + + if((trackinfo.dwFlags & flags) != flags || trackinfo.hwndTrack != infoPtr->hwndSelf) { + trackinfo.dwFlags = flags; trackinfo.dwHoverTime = infoPtr->dwHoverTime; trackinfo.hwndTrack = infoPtr->hwndSelf; @@ -5683,11 +5688,11 @@ static BOOL LISTVIEW_DeleteColumn(LISTVIEW_INFO *infoPtr, INT nColumn) } /* update the other column info */ - LISTVIEW_UpdateItemSize(infoPtr); if(DPA_GetPtrCount(infoPtr->hdpaColumns) == 0) LISTVIEW_InvalidateList(infoPtr); else LISTVIEW_ScrollColumns(infoPtr, nColumn, -(rcCol.right - rcCol.left)); + LISTVIEW_UpdateItemSize(infoPtr); return TRUE; } @@ -7855,10 +7860,18 @@ static INT LISTVIEW_InsertItemT(LISTVIEW_INFO *infoPtr, const LVITEMW *lpLVItem, item.iItem = nItem; if (infoPtr->dwLvExStyle & LVS_EX_CHECKBOXES) { - item.mask |= LVIF_STATE; - item.stateMask |= LVIS_STATEIMAGEMASK; - item.state &= ~LVIS_STATEIMAGEMASK; - item.state |= INDEXTOSTATEIMAGEMASK(1); + if (item.mask & LVIF_STATE) + { + item.stateMask |= LVIS_STATEIMAGEMASK; + item.state &= ~LVIS_STATEIMAGEMASK; + item.state |= INDEXTOSTATEIMAGEMASK(1); + } + else + { + item.mask |= LVIF_STATE; + item.stateMask = LVIS_STATEIMAGEMASK; + item.state = INDEXTOSTATEIMAGEMASK(1); + } } if (!set_main_item(infoPtr, &item, TRUE, isW, &has_changed)) goto undo;