tdf#105014: Disable related buttons when there is no menu to edit

Clicking the "Add Separator" or the "Add Submenu" button, when there is
no menu edit, causes LibreOffice to crash. So disable them properly.

Change-Id: Ibf685145a87c9e4343d83e1bb5ef6f08136c8f31
Reviewed-on: https://gerrit.libreoffice.org/32987
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Katarina Behrens <Katarina.Behrens@cib.de>
This commit is contained in:
Muhammet Kara 2017-01-12 11:17:11 +03:00 committed by Katarina Behrens
parent 38a1e19ae4
commit ce0f9962d1

View File

@ -2544,7 +2544,6 @@ void SvxMenuConfigPage::UpdateButtonStates()
m_pMoveUpButton->Enable( false );
m_pMoveDownButton->Enable( false );
m_pDeleteCommandButton->Enable(false);
m_pAddSeparatorButton->Enable();
pPopup->EnableItem( "modrename", false );
@ -2653,6 +2652,7 @@ IMPL_LINK_NOARG( SvxMenuConfigPage, SelectMenu, ListBox&, void )
m_pModifyCommandButton->Enable( pMenuData != nullptr );
m_pAddCommandsButton->Enable( pMenuData != nullptr );
m_pAddSeparatorButton->Enable( pMenuData != nullptr );
m_pAddSubmenuButton->Enable( pMenuData != nullptr );
PopupMenu* pPopup = m_pModifyTopLevelButton->GetPopupMenu();
if ( pMenuData )