diff options
author | Maxim Monastirsky <momonasmon@gmail.com> | 2017-12-17 01:54:45 +0200 |
---|---|---|
committer | Maxim Monastirsky <momonasmon@gmail.com> | 2017-12-17 07:35:15 +0100 |
commit | c8977c4465b5ea2b598bdd71621d1b7c57ec5eb6 (patch) | |
tree | 696799785c1fefe9d9a6b21b6df14e3a13608675 /cui | |
parent | ccb6a1c6d59859467f9d9a6d954501e9329ee202 (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 'cui')
-rw-r--r-- | cui/source/customize/SvxConfigPageHelper.cxx | 10 | ||||
-rw-r--r-- | cui/source/customize/cfg.cxx | 4 | ||||
-rw-r--r-- | cui/source/inc/SvxConfigPageHelper.hxx | 1 |
3 files changed, 13 insertions, 2 deletions
diff --git a/cui/source/customize/SvxConfigPageHelper.cxx b/cui/source/customize/SvxConfigPageHelper.cxx index 18da75eb2c6e..9738b20c595f 100644 --- a/cui/source/customize/SvxConfigPageHelper.cxx +++ b/cui/source/customize/SvxConfigPageHelper.cxx @@ -297,6 +297,7 @@ bool SvxConfigPageHelper::GetMenuItemData( OUString& rCommandURL, OUString& rLabel, sal_uInt16& rType, + sal_Int32& rStyle, css::uno::Reference< css::container::XIndexAccess >& rSubMenu ) { try @@ -314,6 +315,10 @@ bool SvxConfigPageHelper::GetMenuItemData( { aProp[i].Value >>= rSubMenu; } + else if ( aProp[i].Name == ITEM_DESCRIPTOR_STYLE ) + { + aProp[i].Value >>= rStyle; + } else if ( aProp[i].Name == ITEM_DESCRIPTOR_LABEL ) { aProp[i].Value >>= rLabel; @@ -385,7 +390,7 @@ bool SvxConfigPageHelper::GetToolbarItemData( css::uno::Sequence< css::beans::PropertyValue > SvxConfigPageHelper::ConvertSvxConfigEntry( const SvxConfigEntry* pEntry ) { - css::uno::Sequence< css::beans::PropertyValue > aPropSeq( 3 ); + css::uno::Sequence< css::beans::PropertyValue > aPropSeq( 4 ); aPropSeq[0].Name = ITEM_DESCRIPTOR_COMMANDURL; aPropSeq[0].Value <<= pEntry->GetCommand(); @@ -406,6 +411,9 @@ css::uno::Sequence< css::beans::PropertyValue > SvxConfigPageHelper::ConvertSvxC aPropSeq[2].Value <<= pEntry->GetName(); } + aPropSeq[3].Name = ITEM_DESCRIPTOR_STYLE; + aPropSeq[3].Value <<= static_cast<sal_Int16>(pEntry->GetStyle()); + return aPropSeq; } diff --git a/cui/source/customize/cfg.cxx b/cui/source/customize/cfg.cxx index 8420ada0049a..bb3769bd540b 100644 --- a/cui/source/customize/cfg.cxx +++ b/cui/source/customize/cfg.cxx @@ -471,9 +471,10 @@ bool SaveInData::LoadSubMenus( const uno::Reference< container::XIndexAccess >& OUString aLabel; sal_uInt16 nType( css::ui::ItemType::DEFAULT ); + sal_Int32 nStyle(0); bool bItem = SvxConfigPageHelper::GetMenuItemData( xMenuSettings, nIndex, - aCommandURL, aLabel, nType, xSubMenu ); + aCommandURL, aLabel, nType, nStyle, xSubMenu ); if ( bItem ) { @@ -530,6 +531,7 @@ bool SaveInData::LoadSubMenus( const uno::Reference< container::XIndexAccess >& SvxConfigEntry* pEntry = new SvxConfigEntry( aLabel, aCommandURL, xSubMenu.is(), /*bParentData*/false ); + pEntry->SetStyle( nStyle ); pEntry->SetUserDefined( bIsUserDefined ); if ( !bUseDefaultLabel ) pEntry->SetName( aLabel ); diff --git a/cui/source/inc/SvxConfigPageHelper.hxx b/cui/source/inc/SvxConfigPageHelper.hxx index 75f8373201f6..4d0596846bd6 100644 --- a/cui/source/inc/SvxConfigPageHelper.hxx +++ b/cui/source/inc/SvxConfigPageHelper.hxx @@ -65,6 +65,7 @@ public: OUString& rCommandURL, OUString& rLabel, sal_uInt16& rType, + sal_Int32& rStyle, css::uno::Reference< css::container::XIndexAccess >& rSubMenu ); static bool GetToolbarItemData( const css::uno::Reference< css::container::XIndexAccess >& rItemContainer, |