From c8977c4465b5ea2b598bdd71621d1b7c57ec5eb6 Mon Sep 17 00:00:00 2001 From: Maxim Monastirsky Date: Sun, 17 Dec 2017 01:54:45 +0200 Subject: tdf#98058 Respect menu:style="text" setting It was implemented on the xml handling side, but ignored by the menubar code. In addition, make the menu:style attribute survive customization (similar to tdf#114261). Change-Id: I92a3517ee7ba2fe7a0782985d89fb5d0fdbac246 Reviewed-on: https://gerrit.libreoffice.org/46627 Tested-by: Jenkins Reviewed-by: Maxim Monastirsky --- framework/source/uielement/menubarmanager.cxx | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) (limited to 'framework/source/uielement') diff --git a/framework/source/uielement/menubarmanager.cxx b/framework/source/uielement/menubarmanager.cxx index fa5215f80213..f32d54bba2b4 100644 --- a/framework/source/uielement/menubarmanager.cxx +++ b/framework/source/uielement/menubarmanager.cxx @@ -1073,13 +1073,10 @@ void MenuBarManager::FillMenuManager( Menu* pMenu, const Reference< XFrame >& rF Reference< XDispatch > xDispatch; Reference< XStatusListener > xStatusListener; VclPtr pPopup = pMenu->GetPopupMenu( nItemId ); - bool bItemShowMenuImages = m_bShowMenuImages; // overwrite the show icons on menu option? - if (!bItemShowMenuImages) - { - MenuItemBits nBits = pMenu->GetItemBits( nItemId ); - bItemShowMenuImages = ( ( nBits & MenuItemBits::ICON ) == MenuItemBits::ICON ); - } + MenuItemBits nBits = pMenu->GetItemBits( nItemId ) & ( MenuItemBits::ICON | MenuItemBits::TEXT ); + bool bItemShowMenuImages = ( m_bShowMenuImages && nBits != MenuItemBits::TEXT ) || nBits & MenuItemBits::ICON; + if ( pPopup ) { // Retrieve module identifier from Help Command entry @@ -1891,13 +1888,9 @@ void MenuBarManager::FillMenuImages(Reference< XFrame > const & _xFrame, Menu* _ sal_uInt16 nId = _pMenu->GetItemId( nPos ); if ( _pMenu->GetItemType( nPos ) != MenuItemType::SEPARATOR ) { - bool bTmpShowMenuImages( bShowMenuImages ); // overwrite the show icons on menu option? - if (!bTmpShowMenuImages) - { - MenuItemBits nBits = _pMenu->GetItemBits( nId ); - bTmpShowMenuImages = ( ( nBits & MenuItemBits::ICON ) == MenuItemBits::ICON ); - } + MenuItemBits nBits = _pMenu->GetItemBits( nId ) & ( MenuItemBits::ICON | MenuItemBits::TEXT ); + bool bTmpShowMenuImages = ( bShowMenuImages && nBits != MenuItemBits::TEXT ) || nBits & MenuItemBits::ICON; if ( bTmpShowMenuImages ) { -- cgit