summaryrefslogtreecommitdiff
path: root/framework
diff options
context:
space:
mode:
authorMaxim Monastirsky <momonasmon@gmail.com>2017-12-17 01:54:45 +0200
committerMaxim Monastirsky <momonasmon@gmail.com>2017-12-17 07:35:15 +0100
commitc8977c4465b5ea2b598bdd71621d1b7c57ec5eb6 (patch)
tree696799785c1fefe9d9a6b21b6df14e3a13608675 /framework
parentccb6a1c6d59859467f9d9a6d954501e9329ee202 (diff)
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 <ci@libreoffice.org> Reviewed-by: Maxim Monastirsky <momonasmon@gmail.com>
Diffstat (limited to 'framework')
-rw-r--r--framework/source/uielement/menubarmanager.cxx17
1 files changed, 5 insertions, 12 deletions
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<PopupMenu> 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 )
{