diff options
author | Julien Nabet <serval2412@yahoo.fr> | 2021-06-09 23:17:41 +0200 |
---|---|---|
committer | Julien Nabet <serval2412@yahoo.fr> | 2021-06-10 08:30:12 +0200 |
commit | 159030991c70fc3c4018ef28abf1814902a0aebb (patch) | |
tree | 02f3b436f205a71e32b3fbaa9c4ab21d2ab5f830 /svl/source | |
parent | 36db408b9027da01464927e5853950435596ae05 (diff) |
Simplify Sequences initializations (sot/stock/svl/svtools/svx)
Change-Id: Iec21851d69f4a8d5f557e9ed2d30e5f680cd62c2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116943
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Diffstat (limited to 'svl/source')
-rw-r--r-- | svl/source/passwordcontainer/passwordcontainer.cxx | 26 |
1 files changed, 5 insertions, 21 deletions
diff --git a/svl/source/passwordcontainer/passwordcontainer.cxx b/svl/source/passwordcontainer/passwordcontainer.cxx index 596a6e413db3..99f94c5eb809 100644 --- a/svl/source/passwordcontainer/passwordcontainer.cxx +++ b/svl/source/passwordcontainer/passwordcontainer.cxx @@ -231,15 +231,11 @@ PassMap StorageItem::getInfo() void StorageItem::setUseStorage( bool bUse ) { - Sequence< OUString > sendNames(1); Sequence< uno::Any > sendVals(1); - - sendNames[0] = "UseStorage"; - sendVals[0] <<= bUse; ConfigItem::SetModified(); - ConfigItem::PutProperties( sendNames, sendVals ); + ConfigItem::PutProperties( { "UseStorage" }, sendVals ); } @@ -293,18 +289,14 @@ bool StorageItem::getEncodedMP( OUString& aResult ) void StorageItem::setEncodedMP( const OUString& aEncoded, bool bAcceptEmpty ) { - Sequence< OUString > sendNames(2); Sequence< uno::Any > sendVals(2); - sendNames[0] = "HasMaster"; - sendNames[1] = "Master"; - bool bHasMaster = ( !aEncoded.isEmpty() || bAcceptEmpty ); sendVals[0] <<= bHasMaster; sendVals[1] <<= aEncoded; ConfigItem::SetModified(); - ConfigItem::PutProperties( sendNames, sendVals ); + ConfigItem::PutProperties( { "HasMaster", "Master" }, sendVals ); hasEncoded = bHasMaster; mEncoded = aEncoded; @@ -313,13 +305,8 @@ void StorageItem::setEncodedMP( const OUString& aEncoded, bool bAcceptEmpty ) void StorageItem::remove( const OUString& aURL, const OUString& aName ) { - std::vector < OUString > forIndex; - forIndex.push_back( aURL ); - forIndex.push_back( aName ); - - Sequence< OUString > sendSeq(1); - - sendSeq[0] = createIndex( forIndex ); + std::vector < OUString > forIndex { aURL, aName }; + Sequence< OUString > sendSeq { createIndex( forIndex ) }; ConfigItem::ClearNodeElements( "Store", sendSeq ); } @@ -673,18 +660,15 @@ UrlRecord SAL_CALL PasswordContainer::findForName( const OUString& aURL, const O Sequence< UserRecord > PasswordContainer::FindUsr( const std::vector< NamePassRecord >& userlist, std::u16string_view aName, const Reference< XInteractionHandler >& aHandler ) { - sal_uInt32 nInd = 0; for (auto const& aNPIter : userlist) { if( aNPIter.GetUserName() == aName ) { - Sequence< UserRecord > aResult(1); bool bTryToDecode = true; - aResult[0] = CopyToUserRecord( aNPIter, bTryToDecode, aHandler ); + Sequence< UserRecord > aResult { CopyToUserRecord( aNPIter, bTryToDecode, aHandler ) }; return aResult; } - ++nInd; } return Sequence< UserRecord >(); |