diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-10-14 14:27:57 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-10-15 14:33:57 +0200 |
commit | f13c6ad5f020a196a0e3aa6f28bda3dc185d465b (patch) | |
tree | f9aaab122974d36c134fb1723ec3c1c8df51eeef /ucb | |
parent | 9270f74466d0eb841babaa24997f608631c70341 (diff) |
new loplugin:bufferadd
look for OUStringBuffer append sequences that can be turned
into creating an OUString with + operations
Change-Id: Ica840dc096000307b4a105fb4d9ec7588a15ade6
Reviewed-on: https://gerrit.libreoffice.org/80809
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'ucb')
-rw-r--r-- | ucb/source/core/ucb.cxx | 12 | ||||
-rw-r--r-- | ucb/source/ucp/ext/ucpext_content.cxx | 6 | ||||
-rw-r--r-- | ucb/source/ucp/tdoc/tdoc_provider.cxx | 6 |
3 files changed, 6 insertions, 18 deletions
diff --git a/ucb/source/core/ucb.cxx b/ucb/source/core/ucb.cxx index cc2490120173..991ea410149d 100644 --- a/ucb/source/core/ucb.cxx +++ b/ucb/source/core/ucb.cxx @@ -178,14 +178,12 @@ bool createContentProviderData( ContentProviderData & rInfo) { // Obtain service name. - OUStringBuffer aKeyBuffer (rProvider); - aKeyBuffer.append( "/ServiceName" ); OUString aValue; try { if ( !( rxHierNameAccess->getByHierarchicalName( - aKeyBuffer.makeStringAndClear() ) >>= aValue ) ) + rProvider + "/ServiceName" ) >>= aValue ) ) { OSL_FAIL( "UniversalContentBroker::getContentProviderData - " "Error getting item value!" ); @@ -199,11 +197,9 @@ bool createContentProviderData( rInfo.ServiceName = aValue; // Obtain URL Template. - aKeyBuffer.append(rProvider); - aKeyBuffer.append( "/URLTemplate" ); if ( !( rxHierNameAccess->getByHierarchicalName( - aKeyBuffer.makeStringAndClear() ) >>= aValue ) ) + rProvider + "/URLTemplate" ) >>= aValue ) ) { OSL_FAIL( "UniversalContentBroker::getContentProviderData - " "Error getting item value!" ); @@ -212,11 +208,9 @@ bool createContentProviderData( rInfo.URLTemplate = aValue; // Obtain Arguments. - aKeyBuffer.append(rProvider); - aKeyBuffer.append( "/Arguments" ); if ( !( rxHierNameAccess->getByHierarchicalName( - aKeyBuffer.makeStringAndClear() ) >>= aValue ) ) + rProvider + "/Arguments" ) >>= aValue ) ) { OSL_FAIL( "UniversalContentBroker::getContentProviderData - " "Error getting item value!" ); diff --git a/ucb/source/ucp/ext/ucpext_content.cxx b/ucb/source/ucp/ext/ucpext_content.cxx index 823bdea776ab..757a0b49cec4 100644 --- a/ucb/source/ucp/ext/ucpext_content.cxx +++ b/ucb/source/ucp/ext/ucpext_content.cxx @@ -357,11 +357,7 @@ namespace ucb { namespace ucp { namespace ext const sal_Int32 nLastSep = sRelativeURL.lastIndexOf( '/' ); sRelativeURL = sRelativeURL.copy( 0, nLastSep != -1 ? nLastSep : 0 ); - OUStringBuffer aComposer; - aComposer.append( sRootURL ); - aComposer.append( sSeparatedExtensionId ); - aComposer.append( sRelativeURL ); - return aComposer.makeStringAndClear(); + return sRootURL + sSeparatedExtensionId + sRelativeURL; } default: diff --git a/ucb/source/ucp/tdoc/tdoc_provider.cxx b/ucb/source/ucp/tdoc/tdoc_provider.cxx index 801dbc40daeb..d738d59bb935 100644 --- a/ucb/source/ucp/tdoc/tdoc_provider.cxx +++ b/ucb/source/ucp/tdoc/tdoc_provider.cxx @@ -189,12 +189,10 @@ ContentProvider::createDocumentContentIdentifier( 1 ); } - OUStringBuffer aBuffer; - aBuffer.append( TDOC_URL_SCHEME ":/" ); - aBuffer.append( aDocId ); + OUString aBuffer = TDOC_URL_SCHEME ":/" + aDocId; uno::Reference< ucb::XContentIdentifier > xId - = new ::ucbhelper::ContentIdentifier( aBuffer.makeStringAndClear() ); + = new ::ucbhelper::ContentIdentifier( aBuffer ); return xId; } |