X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/223b7504a2749a972efcf75636f411a9fd91eba9..dc834029a3eb341d9c9c5bebb4ce7b60560eeacb:/src/msw/listctrl.cpp?ds=sidebyside diff --git a/src/msw/listctrl.cpp b/src/msw/listctrl.cpp index f5a5554c9e..65fb65b7d0 100644 --- a/src/msw/listctrl.cpp +++ b/src/msw/listctrl.cpp @@ -205,7 +205,7 @@ public: { if (attr) delete attr; - }; + } DECLARE_NO_COPY_CLASS(wxListItemInternalData) }; @@ -948,7 +948,7 @@ wxUIntPtr wxListCtrl::GetItemData(long item) const } // Sets the item data -bool wxListCtrl::SetItemData(long item, long data) +bool wxListCtrl::SetItemPtrData(long item, wxUIntPtr data) { wxListItem info; @@ -1424,7 +1424,7 @@ long wxListCtrl::FindItem(long start, const wxString& str, bool partial) findInfo.flags = LVFI_STRING; if ( partial ) findInfo.flags |= LVFI_PARTIAL; - findInfo.psz = str; + findInfo.psz = str.wx_str(); // ListView_FindItem() excludes the first item from search and to look // through all the items you need to start from -1 which is unnatural and @@ -2417,7 +2417,8 @@ static RECT GetCustomDrawnItemRect(const NMCUSTOMDRAW& nmcd) return rc; } -static bool HandleSubItemPrepaint(LPNMLVCUSTOMDRAW pLVCD, HFONT hfont) +static +bool HandleSubItemPrepaint(LPNMLVCUSTOMDRAW pLVCD, HFONT hfont, int colCount) { NMCUSTOMDRAW& nmcd = pLVCD->nmcd; @@ -2432,7 +2433,7 @@ static bool HandleSubItemPrepaint(LPNMLVCUSTOMDRAW pLVCD, HFONT hfont) // get the rectangle to paint RECT rc; ListView_GetSubItemRect(hwndList, item, col, LVIR_BOUNDS, &rc); - if ( !col ) + if ( !col && colCount > 1 ) { // broken ListView_GetSubItemRect() returns the entire item rect for // 0th subitem while we really need just the part for this column @@ -2602,7 +2603,7 @@ static void HandleItemPaint(LPNMLVCUSTOMDRAW pLVCD, HFONT hfont) for ( int col = 0; col < colCount; col++ ) { pLVCD->iSubItem = col; - HandleSubItemPrepaint(pLVCD, hfont); + HandleSubItemPrepaint(pLVCD, hfont, colCount); } HandleItemPostpaint(nmcd);