Remove unnecessary checks before calling GetNSImage()
Now that this function is guaranteed to return NULL if the bitmap is invalid, the code can be simplified to rely on it. No real changes.
This commit is contained in:
@@ -3438,10 +3438,7 @@ bool wxDataViewIconTextRenderer::MacRender()
|
||||
|
||||
cell = (wxImageTextCell*) GetNativeData()->GetItemCell();
|
||||
iconText << GetValue();
|
||||
if (iconText.GetIcon().IsOk())
|
||||
[cell setImage:wxBitmap(iconText.GetIcon()).GetNSImage()];
|
||||
else
|
||||
[cell setImage:nil];
|
||||
[cell setImage:iconText.GetIcon().GetNSImage()];
|
||||
[cell setStringValue:wxCFStringRef(iconText.GetText()).AsNSString()];
|
||||
return true;
|
||||
}
|
||||
|
@@ -3444,11 +3444,7 @@ void wxWidgetCocoaImpl::SetBitmap( const wxBitmap& bitmap )
|
||||
{
|
||||
if ( [m_osxView respondsToSelector:@selector(setImage:)] )
|
||||
{
|
||||
if (bitmap.IsOk())
|
||||
[m_osxView setImage:bitmap.GetNSImage()];
|
||||
else
|
||||
[m_osxView setImage:nil];
|
||||
|
||||
[m_osxView setImage:bitmap.GetNSImage()];
|
||||
[m_osxView setNeedsDisplay:YES];
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user