diff options
author | Julien Nabet <serval2412@yahoo.fr> | 2021-06-10 12:42:07 +0200 |
---|---|---|
committer | Julien Nabet <serval2412@yahoo.fr> | 2021-06-11 14:57:08 +0200 |
commit | f676b194faf2805529556c2f1da0578b58bf37de (patch) | |
tree | aa5f98c43cc6ae0b1f1c2b5904a44aac93ec9399 /svl/source | |
parent | 76a69fb0bb1d849a2a7e76e209a30db149d79cdd (diff) |
Simplify even more initializations in svl/passwordcontainer.cxx
Change-Id: I42cb919a8853df050d71b97f86abd20fdfccb5a6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116978
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Diffstat (limited to 'svl/source')
-rw-r--r-- | svl/source/passwordcontainer/passwordcontainer.cxx | 20 |
1 files changed, 4 insertions, 16 deletions
diff --git a/svl/source/passwordcontainer/passwordcontainer.cxx b/svl/source/passwordcontainer/passwordcontainer.cxx index 99f94c5eb809..1181144ead22 100644 --- a/svl/source/passwordcontainer/passwordcontainer.cxx +++ b/svl/source/passwordcontainer/passwordcontainer.cxx @@ -231,11 +231,8 @@ PassMap StorageItem::getInfo() void StorageItem::setUseStorage( bool bUse ) { - Sequence< uno::Any > sendVals(1); - sendVals[0] <<= bUse; - ConfigItem::SetModified(); - ConfigItem::PutProperties( { "UseStorage" }, sendVals ); + ConfigItem::PutProperties( { "UseStorage" }, { uno::Any(bUse) } ); } @@ -289,14 +286,10 @@ bool StorageItem::getEncodedMP( OUString& aResult ) void StorageItem::setEncodedMP( const OUString& aEncoded, bool bAcceptEmpty ) { - Sequence< uno::Any > sendVals(2); - bool bHasMaster = ( !aEncoded.isEmpty() || bAcceptEmpty ); - sendVals[0] <<= bHasMaster; - sendVals[1] <<= aEncoded; ConfigItem::SetModified(); - ConfigItem::PutProperties( { "HasMaster", "Master" }, sendVals ); + ConfigItem::PutProperties( { "HasMaster", "Master" }, { uno::Any(bHasMaster), uno::Any(aEncoded) } ); hasEncoded = bHasMaster; mEncoded = aEncoded; @@ -305,8 +298,7 @@ void StorageItem::setEncodedMP( const OUString& aEncoded, bool bAcceptEmpty ) void StorageItem::remove( const OUString& aURL, const OUString& aName ) { - std::vector < OUString > forIndex { aURL, aName }; - Sequence< OUString > sendSeq { createIndex( forIndex ) }; + Sequence< OUString > sendSeq { createIndex( { aURL, aName } ) }; ConfigItem::ClearNodeElements( "Store", sendSeq ); } @@ -326,13 +318,9 @@ void StorageItem::update( const OUString& aURL, const NamePassRecord& aRecord ) return; } - std::vector < OUString > forIndex; - forIndex.push_back( aURL ); - forIndex.push_back( aRecord.GetUserName() ); - Sequence< beans::PropertyValue > sendSeq(1); - sendSeq[0].Name = "Store/Passwordstorage['" + createIndex( forIndex ) + "']/Password"; + sendSeq[0].Name = "Store/Passwordstorage['" + createIndex( { aURL, aRecord.GetUserName() } ) + "']/Password"; sendSeq[0].Value <<= aRecord.GetPersPasswords(); |