diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-06-27 14:06:27 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-06-28 08:55:10 +0200 |
commit | 26c82e22bf4f077022ae88d0a7f8ad0fa6d2a5ba (patch) | |
tree | 42bf27db4a1da0fa3ea3bdd7997e7058c1638f98 /ucb | |
parent | ef531e85d95fe18d553bce1a6926d24c08ffe2bf (diff) |
loplugin:oncevar in ucb..vbahelper
Change-Id: I1fc7c7505a42b3bf9d4a5ab22961930b9831d4ae
Reviewed-on: https://gerrit.libreoffice.org/39327
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'ucb')
-rw-r--r-- | ucb/source/core/ucbstore.cxx | 20 | ||||
-rw-r--r-- | ucb/source/ucp/cmis/auth_provider.cxx | 3 | ||||
-rw-r--r-- | ucb/source/ucp/ext/ucpext_content.cxx | 4 | ||||
-rw-r--r-- | ucb/source/ucp/file/filglob.cxx | 3 | ||||
-rw-r--r-- | ucb/source/ucp/file/filrset.cxx | 12 | ||||
-rw-r--r-- | ucb/source/ucp/file/filtask.cxx | 5 | ||||
-rw-r--r-- | ucb/source/ucp/tdoc/tdoc_storage.cxx | 2 | ||||
-rw-r--r-- | ucb/source/ucp/webdav-neon/LinkSequence.cxx | 10 |
8 files changed, 21 insertions, 38 deletions
diff --git a/ucb/source/core/ucbstore.cxx b/ucb/source/core/ucbstore.cxx index 18f3af60e1c1..d9e4154e7ed0 100644 --- a/ucb/source/core/ucbstore.cxx +++ b/ucb/source/core/ucbstore.cxx @@ -736,10 +736,10 @@ void PropertySetRegistry::renamePropertySet( const OUString& rOldKey, aOldValuesKey += "/"; - OUString aHandleKey("/Handle"); - OUString aValueKey("/Value"); - OUString aStateKey("/State"); - OUString aAttrKey("/Attributes"); + OUString const aHandleKey("/Handle"); + OUString const aValueKey("/Value"); + OUString const aStateKey("/State"); + OUString const aAttrKey("/Attributes"); for ( sal_Int32 n = 0; n < nCount; ++n ) { @@ -763,32 +763,28 @@ void PropertySetRegistry::renamePropertySet( const OUString& rOldKey, aKey += makeHierarchalNameSegment( rPropName ); // ... handle - OUString aNewKey1 = aKey; - aNewKey1 += aHandleKey; + OUString aNewKey1 = aKey + aHandleKey; Any aAny = xRootHierNameAccess->getByHierarchicalName( aNewKey1 ); xNewPropNameReplace->replaceByName( "Handle", aAny ); // ... value - aNewKey1 = aKey; - aNewKey1 += aValueKey; + aNewKey1 = aKey + aValueKey; aAny = xRootHierNameAccess->getByHierarchicalName( aNewKey1 ); xNewPropNameReplace->replaceByName( "Value", aAny ); // ... state - aNewKey1 = aKey; - aNewKey1 += aStateKey; + aNewKey1 = aKey + aStateKey; aAny = xRootHierNameAccess->getByHierarchicalName( aNewKey1 ); xNewPropNameReplace->replaceByName( "State", aAny ); // ... attributes - aNewKey1 = aKey; - aNewKey1 += aAttrKey; + aNewKey1 = aKey + aAttrKey; aAny = xRootHierNameAccess->getByHierarchicalName( aNewKey1 ); diff --git a/ucb/source/ucp/cmis/auth_provider.cxx b/ucb/source/ucp/cmis/auth_provider.cxx index b3370eb26fab..c6d5b28bcb56 100644 --- a/ucb/source/ucp/cmis/auth_provider.cxx +++ b/ucb/source/ucp/cmis/auth_provider.cxx @@ -126,7 +126,6 @@ namespace cmis const char* /*password*/ ) { OUString instructions = "PIN:"; - OUString url_oustr( "" ); const css::uno::Reference< css::ucb::XCommandEnvironment> xEnv = getXEnv( ); @@ -139,7 +138,7 @@ namespace cmis { rtl::Reference< ucbhelper::AuthenticationFallbackRequest > xRequest = new ucbhelper::AuthenticationFallbackRequest ( - instructions, url_oustr ); + instructions, "" ); xIH->handle( xRequest.get() ); diff --git a/ucb/source/ucp/ext/ucpext_content.cxx b/ucb/source/ucp/ext/ucpext_content.cxx index 1dd52774ab9f..378c402db518 100644 --- a/ucb/source/ucp/ext/ucpext_content.cxx +++ b/ucb/source/ucp/ext/ucpext_content.cxx @@ -528,10 +528,8 @@ namespace ucb { namespace ucp { namespace ext Sequence< CommandInfo > Content::getCommands( const Reference< XCommandEnvironment > & /*xEnv*/ ) { - sal_uInt32 nCommandCount = 5; static const CommandInfo aCommandInfoTable[] = { - // Mandatory commands CommandInfo( @@ -564,7 +562,7 @@ namespace ucb { namespace ucp { namespace ext ) }; - return Sequence< CommandInfo >( aCommandInfoTable, nCommandCount ); + return Sequence< CommandInfo >( aCommandInfoTable, SAL_N_ELEMENTS(aCommandInfoTable) ); } diff --git a/ucb/source/ucp/file/filglob.cxx b/ucb/source/ucp/file/filglob.cxx index 32010ebf050e..83c6e2ca1a9c 100644 --- a/ucb/source/ucp/file/filglob.cxx +++ b/ucb/source/ucp/file/filglob.cxx @@ -186,8 +186,7 @@ namespace fileaccess { OUString getTitle( const OUString& aPath ) { - sal_Unicode slash = '/'; - sal_Int32 lastIndex = aPath.lastIndexOf( slash ); + sal_Int32 lastIndex = aPath.lastIndexOf( '/' ); return aPath.copy( lastIndex + 1 ); } diff --git a/ucb/source/ucp/file/filrset.cxx b/ucb/source/ucp/file/filrset.cxx index 3234e975ab10..ff49703198a5 100644 --- a/ucb/source/ucp/file/filrset.cxx +++ b/ucb/source/ucp/file/filrset.cxx @@ -190,10 +190,8 @@ void XResultSet_impl::isFinalChanged() aEv.PropertyName = "IsRowCountFinal"; aEv.Further = false; aEv.PropertyHandle = -1; - bool fval = false; - bool tval = true; - aEv.OldValue <<= fval; - aEv.NewValue <<= tval; + aEv.OldValue <<= false; + aEv.NewValue <<= true; for( const auto& r : seq ) { uno::Reference< beans::XPropertyChangeListener > listener( @@ -609,12 +607,10 @@ XResultSet_impl::getMetaData() { if ( m_sProperty.getConstArray()[ n ].Name == "Title" ) { - // @@@ #82177# - Determine correct value! - bool bCaseSensitiveChildren = false; - std::vector< ::ucbhelper::ResultSetColumnData > aColumnData( m_sProperty.getLength() ); - aColumnData[ n ].isCaseSensitive = bCaseSensitiveChildren; + // @@@ #82177# - Determine correct value! + aColumnData[ n ].isCaseSensitive = false; ::ucbhelper::ResultSetMetaData* p = new ::ucbhelper::ResultSetMetaData( diff --git a/ucb/source/ucp/file/filtask.cxx b/ucb/source/ucp/file/filtask.cxx index efad9a8ed735..8ae56e8fba74 100644 --- a/ucb/source/ucp/file/filtask.cxx +++ b/ucb/source/ucp/file/filtask.cxx @@ -978,12 +978,11 @@ TaskManager::setv( const OUString& aUnqPath, "Uri", -1, uno::makeAny(aUnqPath), beans::PropertyState_DIRECT_VALUE); - IOErrorCode ioError(IOErrorCode_GENERAL); ret[i] <<= InteractiveAugmentedIOException( OUString(), nullptr, task::InteractionClassification_ERROR, - ioError, + IOErrorCode_GENERAL, names ); } } @@ -2069,7 +2068,7 @@ TaskManager::copy_recursive( const OUString& srcUnqPath, osl::FileBase::RC next = err; if( err == osl::FileBase::E_None ) { - sal_Int32 n_Mask = osl_FileStatus_Mask_FileURL | osl_FileStatus_Mask_FileName | osl_FileStatus_Mask_Type; + sal_Int32 const n_Mask = osl_FileStatus_Mask_FileURL | osl_FileStatus_Mask_FileName | osl_FileStatus_Mask_Type; osl::DirectoryItem aDirItem; diff --git a/ucb/source/ucp/tdoc/tdoc_storage.cxx b/ucb/source/ucp/tdoc/tdoc_storage.cxx index 39a0742d2ab8..f21c656795d2 100644 --- a/ucb/source/ucp/tdoc/tdoc_storage.cxx +++ b/ucb/source/ucp/tdoc/tdoc_storage.cxx @@ -456,7 +456,7 @@ uno::Reference< embed::XStorage > StorageElementFactory::queryStorage( { try { - sal_Int32 nOpenMode = embed::ElementModes::READ + sal_Int32 const nOpenMode = embed::ElementModes::READ | embed::ElementModes::NOCREATE; xStorage = xParentStorage->openStorageElement( rName, nOpenMode ); diff --git a/ucb/source/ucp/webdav-neon/LinkSequence.cxx b/ucb/source/ucp/webdav-neon/LinkSequence.cxx index 392584ebf5fc..cad12cda2894 100644 --- a/ucb/source/ucp/webdav-neon/LinkSequence.cxx +++ b/ucb/source/ucp/webdav-neon/LinkSequence.cxx @@ -197,17 +197,13 @@ bool LinkSequence::toXML( const uno::Sequence< ucb::Link > & rInData, sal_Int32 nCount = rInData.getLength(); if ( nCount ) { - OUString aPre( "<link><src>" ); - OUString aMid( "</src><dst>" ); - OUString aEnd( "</dst></link>" ); - for ( sal_Int32 n = 0; n < nCount; ++n ) { - rOutData += aPre; + rOutData += "<link><src>"; rOutData += rInData[ n ].Source; - rOutData += aMid; + rOutData += "</src><dst>"; rOutData += rInData[ n ].Destination; - rOutData += aEnd; + rOutData += "</dst></link>"; } return true; } |