summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulien Nabet <serval2412@yahoo.fr>2021-10-16 22:46:14 +0200
committerJulien Nabet <serval2412@yahoo.fr>2021-10-16 23:42:16 +0200
commit6cce3821ff14b41b704e279034680ce81d2b14ca (patch)
treed523c2b61663396c8f138beebb37917071d57cdf
parente7d99ed15a33de67e436f23096fd2de2ab2e400f (diff)
Simplify vector initialization in ucb
Change-Id: I4b03ab81a17efc125bc5e3b159cf212198c43d22 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123707 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
-rw-r--r--ucb/source/ucp/cmis/cmis_content.cxx6
-rw-r--r--ucb/source/ucp/webdav-neon/NeonSession.cxx4
-rw-r--r--ucb/source/ucp/webdav-neon/webdavcontent.cxx9
-rw-r--r--ucb/source/ucp/webdav/SerfSession.cxx4
-rw-r--r--ucb/source/ucp/webdav/webdavcontent.cxx9
5 files changed, 8 insertions, 24 deletions
diff --git a/ucb/source/ucp/cmis/cmis_content.cxx b/ucb/source/ucp/cmis/cmis_content.cxx
index 202e0a07b169..7ba1a129ebf5 100644
--- a/ucb/source/ucp/cmis/cmis_content.cxx
+++ b/ucb/source/ucp/cmis/cmis_content.cxx
@@ -2080,8 +2080,6 @@ namespace cmis
return;
std::map< std::string, libcmis::PropertyPtr >::iterator propIt = m_pObjectProps.find(rName);
- std::vector< std::string > values;
- values.push_back(rValue);
if ( propIt == m_pObjectProps.end( ) && getObjectType( xEnv ).get( ) )
{
@@ -2091,13 +2089,13 @@ namespace cmis
if ( typeIt != propsTypes.end( ) )
{
libcmis::PropertyTypePtr propType = typeIt->second;
- libcmis::PropertyPtr property( new libcmis::Property( propType, values ) );
+ libcmis::PropertyPtr property( new libcmis::Property( propType, { rValue }) );
m_pObjectProps.insert(std::pair< std::string, libcmis::PropertyPtr >(rName, property));
}
}
else if ( propIt != m_pObjectProps.end( ) )
{
- propIt->second->setValues( values );
+ propIt->second->setValues( { rValue } );
}
}
}
diff --git a/ucb/source/ucp/webdav-neon/NeonSession.cxx b/ucb/source/ucp/webdav-neon/NeonSession.cxx
index 979537a52e28..246b42fb7fb7 100644
--- a/ucb/source/ucp/webdav-neon/NeonSession.cxx
+++ b/ucb/source/ucp/webdav-neon/NeonSession.cxx
@@ -1776,10 +1776,8 @@ bool NeonSession::removeExpiredLocktoken( const OUString & inURL,
// @@@ Alternative: use ne_lock_discover() => less overhead
std::vector< DAVResource > aResources;
- std::vector< OUString > aPropNames;
- aPropNames.push_back( DAVProperties::LOCKDISCOVERY );
- PROPFIND( rEnv.m_aRequestURI, DAVZERO, aPropNames, aResources, rEnv );
+ PROPFIND( rEnv.m_aRequestURI, DAVZERO, { DAVProperties::LOCKDISCOVERY }, aResources, rEnv );
if ( aResources.empty() )
return false;
diff --git a/ucb/source/ucp/webdav-neon/webdavcontent.cxx b/ucb/source/ucp/webdav-neon/webdavcontent.cxx
index 45907b8a53d3..a40d4e1dcf1a 100644
--- a/ucb/source/ucp/webdav-neon/webdavcontent.cxx
+++ b/ucb/source/ucp/webdav-neon/webdavcontent.cxx
@@ -867,9 +867,6 @@ void Content::addProperty( const ucb::PropertyCommandArgument& aCmdArg,
ProppatchValue aValue(
PROPSET, aCmdArg.Property.Name, aCmdArg.DefaultValue );
- std::vector< ProppatchValue > aProppatchValues;
- aProppatchValues.push_back( aValue );
-
try
{
// Set property value at server.
@@ -882,7 +879,7 @@ void Content::addProperty( const ucb::PropertyCommandArgument& aCmdArg,
// clean cached value of PROPFIND property names
// PROPPATCH can change them
removeCachedPropertyNames( xResAccess->getURL() );
- xResAccess->PROPPATCH( aProppatchValues, xEnv );
+ xResAccess->PROPPATCH( { aValue }, xEnv );
{
osl::Guard< osl::Mutex > aGuard( m_aMutex );
m_xResAccess.reset(new DAVResourceAccess(*xResAccess));
@@ -958,9 +955,7 @@ void Content::removeProperty( const OUString& Name,
try
{
- std::vector< ProppatchValue > aProppatchValues;
ProppatchValue aValue( PROPREMOVE, Name, uno::Any() );
- aProppatchValues.push_back( aValue );
// Remove property value from server.
std::unique_ptr< DAVResourceAccess > xResAccess;
@@ -972,7 +967,7 @@ void Content::removeProperty( const OUString& Name,
// clean cached value of PROPFIND property names
// PROPPATCH can change them
removeCachedPropertyNames( xResAccess->getURL() );
- xResAccess->PROPPATCH( aProppatchValues, xEnv );
+ xResAccess->PROPPATCH( { aValue }, xEnv );
{
osl::Guard< osl::Mutex > aGuard( m_aMutex );
m_xResAccess.reset(new DAVResourceAccess(*xResAccess));
diff --git a/ucb/source/ucp/webdav/SerfSession.cxx b/ucb/source/ucp/webdav/SerfSession.cxx
index 2f1b4d2626c9..a4aba7726931 100644
--- a/ucb/source/ucp/webdav/SerfSession.cxx
+++ b/ucb/source/ucp/webdav/SerfSession.cxx
@@ -1175,10 +1175,8 @@ bool SerfSession::removeExpiredLocktoken( const OUString & /*inURL*/,
// @@@ Alternative: use ne_lock_discover() => less overhead
std::vector< DAVResource > aResources;
- std::vector< OUString > aPropNames;
- aPropNames.push_back( DAVProperties::LOCKDISCOVERY );
- PROPFIND( rEnv.m_aRequestURI, DAVZERO, aPropNames, aResources, rEnv );
+ PROPFIND( rEnv.m_aRequestURI, DAVZERO, { DAVProperties::LOCKDISCOVERY }, aResources, rEnv );
if ( aResources.empty() )
return false;
diff --git a/ucb/source/ucp/webdav/webdavcontent.cxx b/ucb/source/ucp/webdav/webdavcontent.cxx
index 4cf298bdf471..bdeebbba04e7 100644
--- a/ucb/source/ucp/webdav/webdavcontent.cxx
+++ b/ucb/source/ucp/webdav/webdavcontent.cxx
@@ -831,9 +831,6 @@ void Content::addProperty( const css::ucb::PropertyCommandArgument &aCmdArg,
ProppatchValue aValue( PROPSET, aProperty.Name, aDefaultValue );
- std::vector< ProppatchValue > aProppatchValues;
- aProppatchValues.push_back( aValue );
-
try
{
// Set property value at server.
@@ -842,7 +839,7 @@ void Content::addProperty( const css::ucb::PropertyCommandArgument &aCmdArg,
osl::Guard< osl::Mutex > aGuard( m_aMutex );
xResAccess.reset( new DAVResourceAccess( *m_xResAccess ) );
}
- xResAccess->PROPPATCH( aProppatchValues, xEnv );
+ xResAccess->PROPPATCH( { aValue }, xEnv );
{
osl::Guard< osl::Mutex > aGuard( m_aMutex );
m_xResAccess.reset( new DAVResourceAccess( *xResAccess ) );
@@ -938,9 +935,7 @@ void Content::removeProperty( const OUString& Name,
// Try to remove property from server.
try
{
- std::vector< ProppatchValue > aProppatchValues;
ProppatchValue aValue( PROPREMOVE, Name, uno::Any() );
- aProppatchValues.push_back( aValue );
// Remove property value from server.
std::unique_ptr< DAVResourceAccess > xResAccess;
@@ -948,7 +943,7 @@ void Content::removeProperty( const OUString& Name,
osl::Guard< osl::Mutex > aGuard( m_aMutex );
xResAccess.reset( new DAVResourceAccess( *m_xResAccess ) );
}
- xResAccess->PROPPATCH( aProppatchValues, xEnv );
+ xResAccess->PROPPATCH( { aValue }, xEnv );
{
osl::Guard< osl::Mutex > aGuard( m_aMutex );
m_xResAccess.reset( new DAVResourceAccess( *xResAccess ) );