Resolves tdf#125840: Crash when trying to customize Base Data View toolbar
Change-Id: I2463e7ac7d73b83e79474175bc5d51ffd826f320
Reviewed-on: https://gerrit.libreoffice.org/73841
Tested-by: Jenkins
Reviewed-by: Muhammet Kara <muhammet.kara@collabora.com>
(cherry picked from commit b25186b6701f0770127b38ecd7744901d2c5fe72)
Reviewed-on: https://gerrit.libreoffice.org/73869
diff --git a/cui/source/customize/SvxMenuConfigPage.cxx b/cui/source/customize/SvxMenuConfigPage.cxx
index a2f6d92..2f210e9 100644
--- a/cui/source/customize/SvxMenuConfigPage.cxx
+++ b/cui/source/customize/SvxMenuConfigPage.cxx
@@ -243,10 +243,18 @@ void SvxMenuConfigPage::UpdateButtonStates()
m_xModifyBtn->set_sensitive( bIsValidSelection && !bIsSeparator);
// If there is no top level selection (menu), then everything working on the right box
// which contains the functions of the selected menu/toolbar needs to be disabled
SvxConfigEntry* pMenuData = GetTopLevelSelection();
m_xInsertBtn->set_sensitive(pMenuData != nullptr);
m_xAddCommandButton->set_sensitive(pMenuData != nullptr);
m_xRemoveCommandButton->set_sensitive(pMenuData != nullptr);
//Handle the gear button
if (m_bIsMenuBar)
if (pMenuData && m_bIsMenuBar)
{
SvxConfigEntry* pMenuData = GetTopLevelSelection();
// Add option (gear_add) will always be enabled
m_xGearBtn->set_item_sensitive( "menu_gear_delete", pMenuData->IsDeletable() );
m_xGearBtn->set_item_sensitive( "menu_gear_rename", pMenuData->IsRenamable() );