From c576a25a1959041d9682f825bf9cdf0baf0d8d56 Mon Sep 17 00:00:00 2001 From: Robert Roebling Date: Sun, 2 Dec 2007 13:51:45 +0000 Subject: [PATCH] test for valid icon git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@50423 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/mac/carbon/dataview.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/mac/carbon/dataview.cpp b/src/mac/carbon/dataview.cpp index 6e2c855c20..a640caffe7 100644 --- a/src/mac/carbon/dataview.cpp +++ b/src/mac/carbon/dataview.cpp @@ -571,9 +571,14 @@ bool wxDataViewIconTextRenderer::Render(void) // variable definition: wxMacCFStringHolder cfString(iconText.GetText(),(this->GetView()->GetFont().Ok() ? this->GetView()->GetFont().GetEncoding() : wxLocale::GetSystemEncoding())); + + if (iconText.GetIcon().IsOk()) + { + if (::SetDataBrowserItemDataIcon(this->GetDataReference(),MAC_WXHICON(iconText.GetIcon().GetHICON())) != noErr) + return false; + } - return ((::SetDataBrowserItemDataIcon(this->GetDataReference(),MAC_WXHICON(iconText.GetIcon().GetHICON())) == noErr) && - (::SetDataBrowserItemDataText(this->GetDataReference(),cfString) == noErr)); + return (::SetDataBrowserItemDataText(this->GetDataReference(),cfString) == noErr); } /* if */ else return false;