Resolves tdf#125840: Crash when trying to customize Base Data View toolbar
Change-Id: If5b157c1f1362128d22d210286da741ba905e5aa
Reviewed-on: https://gerrit.libreoffice.org/73958
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
diff --git a/cui/source/customize/SvxMenuConfigPage.cxx b/cui/source/customize/SvxMenuConfigPage.cxx
index bf0247c..03e3f9a 100644
--- a/cui/source/customize/SvxMenuConfigPage.cxx
+++ b/cui/source/customize/SvxMenuConfigPage.cxx
@@ -223,10 +223,14 @@ void SvxMenuConfigPage::UpdateButtonStates()
{
SvxConfigEntry* pMenuData = GetTopLevelSelection();
PopupMenu* pGearPopup = m_pGearBtn->GetPopupMenu();
if (!pGearPopup)
return;
// Add option (gear_add) will always be enabled
pGearPopup->EnableItem( "gear_delete", pMenuData->IsDeletable() );
pGearPopup->EnableItem( "gear_rename", pMenuData->IsRenamable() );
pGearPopup->EnableItem( "gear_move", pMenuData->IsMovable() );
pGearPopup->EnableItem( "gear_delete", pMenuData && pMenuData->IsDeletable() );
pGearPopup->EnableItem( "gear_rename", pMenuData && pMenuData->IsRenamable() );
pGearPopup->EnableItem( "gear_move", pMenuData && pMenuData->IsMovable() );
}
}