From 43a6b59539ad573436f43303e9fbe17c12dc9c84 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Mon, 10 Jul 2017 12:42:24 +0200 Subject: simplify some OUString compareTo calls to either startsWith or == or != Change-Id: Ie4b4662f5b8e4532cbc1ab36910389e0b3d41ef0 Reviewed-on: https://gerrit.libreoffice.org/39750 Tested-by: Jenkins Reviewed-by: Noel Grandin --- ucbhelper/source/provider/providerhelper.cxx | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'ucbhelper') diff --git a/ucbhelper/source/provider/providerhelper.cxx b/ucbhelper/source/provider/providerhelper.cxx index 9547ece9a982..f5e3163b5658 100644 --- a/ucbhelper/source/provider/providerhelper.cxx +++ b/ucbhelper/source/provider/providerhelper.cxx @@ -313,9 +313,7 @@ bool ContentProviderImplHelper::renameAdditionalPropertySet( for ( sal_Int32 n = 0; n < nCount; ++n ) { const OUString& rKey = pKeys[ n ]; - if ( rKey.compareTo( - aOldKeyWithSlash, - aOldKeyWithSlash.getLength() ) == 0 + if ( rKey.startsWith( aOldKeyWithSlash ) || rKey.equals( aOldKeyWithoutSlash ) ) { OUString aNewKey @@ -397,9 +395,7 @@ bool ContentProviderImplHelper::copyAdditionalPropertySet( for ( sal_Int32 n = 0; n < nCount; ++n ) { const OUString& rKey = pKeys[ n ]; - if ( rKey.compareTo( - aSrcKeyWithSlash, - aSrcKeyWithSlash.getLength() ) == 0 + if ( rKey.startsWith(aSrcKeyWithSlash ) || rKey.equals( aSrcKeyWithoutSlash ) ) { OUString aNewKey @@ -533,9 +529,7 @@ bool ContentProviderImplHelper::removeAdditionalPropertySet( for ( sal_Int32 n = 0; n < nCount; ++n ) { const OUString& rCurrKey = pKeys[ n ]; - if ( rCurrKey.compareTo( - aKeyWithSlash, - aKeyWithSlash.getLength() ) == 0 + if ( rCurrKey.startsWith(aKeyWithSlash ) || rCurrKey.equals( aKeyWithoutSlash ) ) { if ( !removeAdditionalPropertySet( -- cgit v1.2.3