Remove unnecessary HasImageList() checks in wxDataViewTreeCtrl

These checks don't seem to make any sense at all, even though they were
there ever since this classes was added in a75124d0da (Added
wxDataViewTreeCtrl, 2007-12-01), and, in fact, were clearly harmful
until they were fixed in e6a2aa5ae3 (Show correct icon for branch nodes
in wxDataViewTreeCtrl, 2018-09-12).

But it seems that even this wasn't the right thing to do, as there
doesn't seem to be any reason to not call ItemChanged() even for the
controls not using images, so just remove them completely.
This commit is contained in:
Vadim Zeitlin
2021-11-11 22:05:59 +00:00
parent 3cc4ef5f77
commit e6bf7f5ec5

View File

@@ -3180,8 +3180,6 @@ void wxDataViewTreeCtrl::DeleteAllItems()
void wxDataViewTreeCtrl::OnExpanded( wxDataViewEvent &event )
{
if (!HasImageList()) return;
wxDataViewTreeStoreContainerNode* container = GetStore()->FindContainerNode( event.GetItem() );
if (!container) return;
@@ -3192,8 +3190,6 @@ void wxDataViewTreeCtrl::OnExpanded( wxDataViewEvent &event )
void wxDataViewTreeCtrl::OnCollapsed( wxDataViewEvent &event )
{
if (!HasImageList()) return;
wxDataViewTreeStoreContainerNode* container = GetStore()->FindContainerNode( event.GetItem() );
if (!container) return;