diff options
Diffstat (limited to 'svtools')
-rw-r--r-- | svtools/source/contnr/treelistbox.cxx | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/svtools/source/contnr/treelistbox.cxx b/svtools/source/contnr/treelistbox.cxx index 230b90d931b4..67d8e95ea21a 100644 --- a/svtools/source/contnr/treelistbox.cxx +++ b/svtools/source/contnr/treelistbox.cxx @@ -1844,12 +1844,15 @@ void SvTreeListBox::SetCheckButtonState( SvTreeListEntry* pEntry, SvButtonState void SvTreeListBox::SetCheckButtonInvisible( SvTreeListEntry* pEntry) { - if( nTreeFlags & SvTreeFlags::CHKBTN ) - { - SvLBoxButton* pItem = static_cast<SvLBoxButton*>(pEntry->GetFirstItem(SvLBoxItemType::Button)); - pItem->SetStateInvisible(); - InvalidateEntry( pEntry ); - } + SvLBoxButton* pItem = (nTreeFlags & SvTreeFlags::CHKBTN) ? + static_cast<SvLBoxButton*>(pEntry->GetFirstItem(SvLBoxItemType::Button)) : + nullptr; + + if (!pItem) + return; + + pItem->SetStateInvisible(); + InvalidateEntry(pEntry); } SvButtonState SvTreeListBox::GetCheckButtonState( SvTreeListEntry* pEntry ) const |