From: Vadim Zeitlin Date: Mon, 19 Mar 2012 12:53:25 +0000 (+0000) Subject: Fix appearance of items without icons in wxDataViewCtrl in wxOSX/Cocoa. X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/9b98a2bcfdcd8e7f6f06bb7aeab3261b75382a95?ds=inline Fix appearance of items without icons in wxDataViewCtrl in wxOSX/Cocoa. We need to set the cell image to none explicitly if the item doesn't have any, otherwise the image for the previous cell would be reused. Closes #14112. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70941 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/osx/cocoa/dataview.mm b/src/osx/cocoa/dataview.mm index ad8dfe54ec..9d2fabdc42 100644 --- a/src/osx/cocoa/dataview.mm +++ b/src/osx/cocoa/dataview.mm @@ -2995,6 +2995,8 @@ bool wxDataViewIconTextRenderer::MacRender() iconText << GetValue(); if (iconText.GetIcon().IsOk()) [cell setImage:[[wxBitmap(iconText.GetIcon()).GetNSImage() retain] autorelease]]; + else + [cell setImage:nil]; [cell setStringValue:[[wxCFStringRef(iconText.GetText()).AsNSString() retain] autorelease]]; return true; }