diff options
author | Muhammet Kara <muhammet.kara@collabora.com> | 2019-06-12 00:08:58 +0300 |
---|---|---|
committer | Muhammet Kara <muhammet.kara@collabora.com> | 2019-06-12 10:28:46 +0200 |
commit | b25186b6701f0770127b38ecd7744901d2c5fe72 (patch) | |
tree | 9e5a338a37c8bbdbd1de863e7bfceaefa00d1355 /cui | |
parent | f8c6667a4407606a34917bba737bcb2578bcf2ca (diff) |
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>
Diffstat (limited to 'cui')
-rw-r--r-- | cui/source/customize/SvxMenuConfigPage.cxx | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/cui/source/customize/SvxMenuConfigPage.cxx b/cui/source/customize/SvxMenuConfigPage.cxx index a2f6d92bc8d7..2f210e91619c 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() ); |