diff options
Diffstat (limited to 'cui/source/options')
-rw-r--r-- | cui/source/options/cfgchart.cxx | 10 | ||||
-rw-r--r-- | cui/source/options/optaboutconfig.cxx | 36 | ||||
-rw-r--r-- | cui/source/options/optgdlg.cxx | 21 | ||||
-rw-r--r-- | cui/source/options/optinet2.cxx | 3 | ||||
-rw-r--r-- | cui/source/options/optupdt.cxx | 3 |
5 files changed, 28 insertions, 45 deletions
diff --git a/cui/source/options/cfgchart.cxx b/cui/source/options/cfgchart.cxx index 525761c3c86c..5649c4ea53f3 100644 --- a/cui/source/options/cfgchart.cxx +++ b/cui/source/options/cfgchart.cxx @@ -160,10 +160,9 @@ bool SvxChartColorTable::operator==( const SvxChartColorTable & _rOther ) const SvxChartOptions::SvxChartOptions() : ::utl::ConfigItem( "Office.Chart" ), - mbIsInitialized( false ) + mbIsInitialized( false ), + maPropertyNames{ "DefaultColor/Series" } { - maPropertyNames.realloc( 1 ); - maPropertyNames[ 0 ] = "DefaultColor/Series"; } SvxChartOptions::~SvxChartOptions() @@ -239,13 +238,14 @@ void SvxChartOptions::ImplCommit() // convert list to sequence const size_t nCount = maDefColors.size(); uno::Sequence< sal_Int64 > aColors( nCount ); + auto aColorsRange = asNonConstRange(aColors); for( size_t i=0; i < nCount; i++ ) { Color aData = maDefColors.getColor( i ); - aColors[ i ] = sal_uInt32(aData); + aColorsRange[ i ] = sal_uInt32(aData); } - aValues[ 0 ] <<= aColors; + aValues.getArray()[0] <<= aColors; } PutProperties( aNames, aValues ); diff --git a/cui/source/options/optaboutconfig.cxx b/cui/source/options/optaboutconfig.cxx index 1f5adbf73b11..55941f765dd9 100644 --- a/cui/source/options/optaboutconfig.cxx +++ b/cui/source/options/optaboutconfig.cxx @@ -27,9 +27,9 @@ #include <sal/log.hxx> #include <tools/diagnose_ex.h> +#include <algorithm> #include <memory> #include <vector> -#include <iostream> using namespace ::com::sun::star; using namespace com::sun::star::uno; @@ -487,8 +487,7 @@ Reference< XNameAccess > CuiAboutConfigTabPage::getConfigAccess( const OUString& aProperty.Name = "nodepath"; aProperty.Value <<= sNodePath; - uno::Sequence< uno::Any > aArgumentList( 1 ); - aArgumentList[0] <<= aProperty; + uno::Sequence< uno::Any > aArgumentList{ uno::Any(aProperty) }; OUString sAccessString; @@ -688,10 +687,9 @@ IMPL_LINK_NOARG( CuiAboutConfigTabPage, StandardHdl_Impl, weld::Button&, void ) //create appropriate sequence with same size as string sequence uno::Sequence< sal_Int16 > seqShort( seqStr.size() ); //convert all strings to appropriate type - for( size_t i = 0; i < seqStr.size(); ++i ) - { - seqShort[i] = static_cast<sal_Int16>(seqStr[i].toInt32()); - } + std::transform(seqStr.begin(), seqStr.end(), seqShort.getArray(), + [](const auto& str) + { return static_cast<sal_Int16>(str.toInt32()); }); pProperty->Value <<= seqShort; } else if( sPropertyType == "[]long" ) @@ -699,40 +697,32 @@ IMPL_LINK_NOARG( CuiAboutConfigTabPage, StandardHdl_Impl, weld::Button&, void ) std::vector< OUString > seqStrLong = commaStringToSequence( sNewValue ); uno::Sequence< sal_Int32 > seqLong( seqStrLong.size() ); - for( size_t i = 0; i < seqStrLong.size(); ++i ) - { - seqLong[i] = seqStrLong[i].toInt32(); - } + std::transform(seqStrLong.begin(), seqStrLong.end(), seqLong.getArray(), + [](const auto& str) { return str.toInt32(); }); pProperty->Value <<= seqLong; } else if( sPropertyType == "[]hyper" ) { std::vector< OUString > seqStrHyper = commaStringToSequence( sNewValue ); uno::Sequence< sal_Int64 > seqHyper( seqStrHyper.size() ); - for( size_t i = 0; i < seqStrHyper.size(); ++i ) - { - seqHyper[i] = seqStrHyper[i].toInt64(); - } + std::transform(seqStrHyper.begin(), seqStrHyper.end(), seqHyper.getArray(), + [](const auto& str) { return str.toInt64(); }); pProperty->Value <<= seqHyper; } else if( sPropertyType == "[]double" ) { std::vector< OUString > seqStrDoub = commaStringToSequence( sNewValue ); uno::Sequence< double > seqDoub( seqStrDoub.size() ); - for( size_t i = 0; i < seqStrDoub.size(); ++i ) - { - seqDoub[i] = seqStrDoub[i].toDouble(); - } + std::transform(seqStrDoub.begin(), seqStrDoub.end(), seqDoub.getArray(), + [](const auto& str) { return str.toDouble(); }); pProperty->Value <<= seqDoub; } else if( sPropertyType == "[]float" ) { std::vector< OUString > seqStrFloat = commaStringToSequence( sNewValue ); uno::Sequence< sal_Int16 > seqFloat( seqStrFloat.size() ); - for( size_t i = 0; i < seqStrFloat.size(); ++i ) - { - seqFloat[i] = seqStrFloat[i].toFloat(); - } + std::transform(seqStrFloat.begin(), seqStrFloat.end(), seqFloat.getArray(), + [](const auto& str) { return str.toFloat(); }); pProperty->Value <<= seqFloat; } else if( sPropertyType == "[]string" ) diff --git a/cui/source/options/optgdlg.cxx b/cui/source/options/optgdlg.cxx index 30b98e8de55f..5e010bff340d 100644 --- a/cui/source/options/optgdlg.cxx +++ b/cui/source/options/optgdlg.cxx @@ -1,4 +1,4 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* * This file is part of the LibreOffice project. * @@ -38,6 +38,7 @@ #include <unotools/syslocaleoptions.hxx> #include <sfx2/objsh.hxx> #include <comphelper/propertysequence.hxx> +#include <comphelper/propertyvalue.hxx> #include <svtools/langtab.hxx> #include <editeng/unolingu.hxx> #include <editeng/langitem.hxx> @@ -594,9 +595,8 @@ IMPL_LINK_NOARG(OfaViewTabPage, OnRunGPTestClick, weld::Button&, void) IMPL_STATIC_LINK_NOARG(OfaViewTabPage, OnMoreIconsClick, weld::Button&, void) { - css::uno::Sequence<css::beans::PropertyValue> aArgs(1); - aArgs[0].Name = "AdditionsTag"; - aArgs[0].Value <<= OUString("Icons"); + css::uno::Sequence<css::beans::PropertyValue> aArgs{ comphelper::makePropertyValue( + "AdditionsTag", OUString("Icons")) }; comphelper::dispatchCommand(".uno:AdditionsDialog", aArgs); } @@ -1070,12 +1070,9 @@ OfaLanguagesTabPage::OfaLanguagesTabPage(weld::Container* pPage, weld::DialogCon Reference< XMultiServiceFactory > theConfigProvider( css::configuration::theDefaultProvider::get( comphelper::getProcessComponentContext())); - Sequence< Any > theArgs(1); - Reference< XNameAccess > theNameAccess; - // find out which locales are currently installed and add them to the listbox - theArgs[0] <<= NamedValue("nodepath", Any(OUString(sInstalledLocalesPath))); - theNameAccess.set( + Sequence< Any > theArgs{ Any(NamedValue("nodepath", Any(OUString(sInstalledLocalesPath)))) }; + Reference< XNameAccess > theNameAccess( theConfigProvider->createInstanceWithArguments(sAccessSrvc, theArgs ), UNO_QUERY_THROW ); seqInstalledLanguages = theNameAccess->getElementNames(); LanguageType aLang = LANGUAGE_DONTKNOW; @@ -1106,8 +1103,7 @@ OfaLanguagesTabPage::OfaLanguagesTabPage(weld::Container* pPage, weld::DialogCon m_xUserInterfaceLB->set_active(0); // find out whether the user has a specific locale specified - Sequence< Any > theArgs2(1); - theArgs2[0] <<= NamedValue("nodepath", Any(OUString(sUserLocalePath))); + Sequence< Any > theArgs2{ Any(NamedValue("nodepath", Any(OUString(sUserLocalePath)))) }; theNameAccess.set( theConfigProvider->createInstanceWithArguments(sAccessSrvc, theArgs2 ), UNO_QUERY_THROW ); if (theNameAccess->hasByName(sUserLocaleKey)) @@ -1276,8 +1272,7 @@ bool OfaLanguagesTabPage::FillItemSet( SfxItemSet* rSet ) Reference< XMultiServiceFactory > theConfigProvider( css::configuration::theDefaultProvider::get( comphelper::getProcessComponentContext())); - Sequence< Any > theArgs(1); - theArgs[0] <<= NamedValue("nodepath", Any(OUString(sUserLocalePath))); + Sequence< Any > theArgs{ Any(NamedValue("nodepath", Any(OUString(sUserLocalePath)))) }; Reference< XPropertySet >xProp( theConfigProvider->createInstanceWithArguments(sAccessUpdSrvc, theArgs ), UNO_QUERY_THROW ); if ( m_sUserLocaleValue != aLangString) diff --git a/cui/source/options/optinet2.cxx b/cui/source/options/optinet2.cxx index e01433516ff7..be01007e026c 100644 --- a/cui/source/options/optinet2.cxx +++ b/cui/source/options/optinet2.cxx @@ -170,8 +170,7 @@ SvxProxyTabPage::SvxProxyTabPage(weld::Container* pPage, weld::DialogController* aProperty.Name = "nodepath"; aProperty.Value <<= OUString( "org.openoffice.Inet/Settings" ); - Sequence< Any > aArgumentList( 1 ); - aArgumentList[0] <<= aProperty; + Sequence< Any > aArgumentList{ Any(aProperty) }; m_xConfigurationUpdateAccess = xConfigurationProvider->createInstanceWithArguments( "com.sun.star.configuration.ConfigurationUpdateAccess", diff --git a/cui/source/options/optupdt.cxx b/cui/source/options/optupdt.cxx index f6351edda30d..6b0dbe2cd2cd 100644 --- a/cui/source/options/optupdt.cxx +++ b/cui/source/options/optupdt.cxx @@ -368,8 +368,7 @@ IMPL_LINK_NOARG(SvxOnlineUpdateTabPage, CheckNowHdl_Impl, weld::Button&, void) aProperty.Name = "nodepath"; aProperty.Value <<= OUString("org.openoffice.Office.Addons/AddonUI/OfficeHelp/UpdateCheckJob"); - uno::Sequence< uno::Any > aArgumentList( 1 ); - aArgumentList[0] <<= aProperty; + uno::Sequence< uno::Any > aArgumentList{ uno::Any(aProperty) }; uno::Reference< container::XNameAccess > xNameAccess( xConfigProvider->createInstanceWithArguments( |