framework/source/uielement/statusbarmanager.cxx | 42 ++++++------------------ 1 file changed, 12 insertions(+), 30 deletions(-)
New commits: commit 0b194702002af52d1e0034d41e497052675eb84a Author: Julien Nabet <serval2...@yahoo.fr> AuthorDate: Tue Dec 26 17:53:48 2023 +0100 Commit: Julien Nabet <serval2...@yahoo.fr> CommitDate: Tue Dec 26 19:56:36 2023 +0100 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 <serval2...@yahoo.fr> 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 ) );