diff options
author | Julien Nabet <serval2412@yahoo.fr> | 2023-12-26 17:53:48 +0100 |
---|---|---|
committer | Julien Nabet <serval2412@yahoo.fr> | 2023-12-26 19:56:36 +0100 |
commit | 0b194702002af52d1e0034d41e497052675eb84a (patch) | |
tree | 18a2aa8d33d00a81cbbaa2710862f9a94348f3ab | |
parent | 3d9ee9375d28f0131949ee3c1f86f22dcea41d19 (diff) |
Simplify aPropVector construction in framework/statusbarmanager
Change-Id: I14dfe9f156109c9c098e27fcf88ca9a273e7722c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161308
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
-rw-r--r-- | framework/source/uielement/statusbarmanager.cxx | 42 |
1 files changed, 12 insertions, 30 deletions
diff --git a/framework/source/uielement/statusbarmanager.cxx b/framework/source/uielement/statusbarmanager.cxx index dbc305c696fa..3efb64c44bfd 100644 --- a/framework/source/uielement/statusbarmanager.cxx +++ b/framework/source/uielement/statusbarmanager.cxx @@ -34,6 +34,7 @@ #include <com/sun/star/awt/Command.hpp> #include <com/sun/star/ui/XStatusbarItem.hpp> #include <comphelper/processfactory.hxx> +#include <comphelper/propertyvalue.hxx> #include <comphelper/sequence.hxx> #include <toolkit/helper/vclunohelper.hxx> #include <svtools/statusbarcontroller.hxx> @@ -299,38 +300,19 @@ void StatusBarManager::CreateControllers() AddonStatusbarItemData *pItemData = static_cast< AddonStatusbarItemData *>( m_pStatusBar->GetItemData( nId ) ); uno::Reference< ui::XStatusbarItem > xStatusbarItem = new StatusbarItem( m_pStatusBar, nId, aCommandURL ); - beans::PropertyValue aPropValue; - std::vector< uno::Any > aPropVector; - - aPropValue.Name = "CommandURL"; - aPropValue.Value <<= aCommandURL; - aPropVector.push_back( uno::Any( aPropValue ) ); - - aPropValue.Name = "ModuleIdentifier"; - aPropValue.Value <<= OUString(); - aPropVector.push_back( uno::Any( aPropValue ) ); - - aPropValue.Name = "Frame"; - aPropValue.Value <<= m_xFrame; - aPropVector.push_back( uno::Any( aPropValue ) ); - - // TODO remove this - aPropValue.Name = "ServiceManager"; - aPropValue.Value <<= uno::Reference<lang::XMultiServiceFactory>(m_xContext->getServiceManager(), uno::UNO_QUERY_THROW); - aPropVector.push_back( uno::Any( aPropValue ) ); - - aPropValue.Name = "ParentWindow"; - aPropValue.Value <<= xStatusbarWindow; - aPropVector.push_back( uno::Any( aPropValue ) ); + std::vector< uno::Any > aPropVector + { + uno::Any(comphelper::makePropertyValue("CommandURL", aCommandURL)), + uno::Any(comphelper::makePropertyValue("ModuleIdentifier", u""_ustr)), + uno::Any(comphelper::makePropertyValue("Frame", m_xFrame)), - // TODO still needing with the css::ui::XStatusbarItem? - aPropValue.Name = "Identifier"; - aPropValue.Value <<= nId; - aPropVector.push_back( uno::Any( aPropValue ) ); + // TODO remove this + uno::Any(comphelper::makePropertyValue("ServiceManager", uno::Reference<lang::XMultiServiceFactory>(m_xContext->getServiceManager(), uno::UNO_QUERY_THROW))), - aPropValue.Name = "StatusbarItem"; - aPropValue.Value <<= xStatusbarItem; - aPropVector.push_back( uno::Any( aPropValue ) ); + uno::Any(comphelper::makePropertyValue("ParentWindow", xStatusbarWindow)), + uno::Any(comphelper::makePropertyValue("Identifier", nId)), + uno::Any(comphelper::makePropertyValue("StatusbarItem", xStatusbarItem)) + }; uno::Sequence< uno::Any > aArgs( comphelper::containerToSequence( aPropVector ) ); |