cui/source/customize/SvxMenuConfigPage.cxx |   12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

New commits:
commit b25186b6701f0770127b38ecd7744901d2c5fe72
Author:     Muhammet Kara <muhammet.k...@collabora.com>
AuthorDate: Wed Jun 12 00:08:58 2019 +0300
Commit:     Muhammet Kara <muhammet.k...@collabora.com>
CommitDate: Wed Jun 12 10:28:46 2019 +0200

    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.k...@collabora.com>

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() );
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to