diff options
author | Noel Grandin <noel@peralex.com> | 2013-10-21 10:21:01 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2013-10-23 08:29:15 +0200 |
commit | 7a06928bcf638e1eeedebc9d53c306a1b852cc9b (patch) | |
tree | c0402c2da4e2c522ecf32a0b413128f727cbc0fa /svl | |
parent | a55d02bacb2c8f21cba759c8fe3931df07a85b0c (diff) |
convert code to use OUString::endsWith
Convert places that call
aStr[aStr.getLength()-1] == 'x'
to use the shorter form
aStr.endsWith("x")
Change-Id: I1b3a19c0e89b8989cdbeed440f95fc76f9a4b6b6
Diffstat (limited to 'svl')
-rw-r--r-- | svl/qa/unit/test_URIHelper.cxx | 2 | ||||
-rw-r--r-- | svl/source/passwordcontainer/passwordcontainer.cxx | 8 | ||||
-rw-r--r-- | svl/source/passwordcontainer/syscreds.cxx | 4 |
3 files changed, 7 insertions, 7 deletions
diff --git a/svl/qa/unit/test_URIHelper.cxx b/svl/qa/unit/test_URIHelper.cxx index 3d160d66bee5..313ce6538c96 100644 --- a/svl/qa/unit/test_URIHelper.cxx +++ b/svl/qa/unit/test_URIHelper.cxx @@ -162,7 +162,7 @@ css::uno::Any Content::execute( uri += "/"; break; case '2': - if (uri.getLength() > 0 && uri[uri.getLength() - 1] == '/') { + if (uri.endsWith("/")) { uri = uri.copy(0, uri.getLength() -1); } break; diff --git a/svl/source/passwordcontainer/passwordcontainer.cxx b/svl/source/passwordcontainer/passwordcontainer.cxx index 8c4f7d28361f..ad99f8bb19bc 100644 --- a/svl/source/passwordcontainer/passwordcontainer.cxx +++ b/svl/source/passwordcontainer/passwordcontainer.cxx @@ -788,8 +788,8 @@ UrlRecord PasswordContainer::find( else { OUString tmpUrl( aUrl ); - if ( tmpUrl.getStr()[tmpUrl.getLength() - 1] != (sal_Unicode)'/' ) - tmpUrl += OUString("/"); + if ( !tmpUrl.endsWith("/") ) + tmpUrl += "/"; aIter = m_aContainer.lower_bound( tmpUrl ); if( aIter != m_aContainer.end() && aIter->first.match( tmpUrl ) ) @@ -919,7 +919,7 @@ void SAL_CALL PasswordContainer::remove( const OUString& aURL, const OUString& a if( aInd > 0 && aUrl.getLength()-1 == aInd ) aUrl = aUrl.copy( 0, aUrl.getLength() - 1 ); else - aUrl += OUString("/"); + aUrl += "/"; aIter = m_aContainer.find( aUrl ); } @@ -960,7 +960,7 @@ void SAL_CALL PasswordContainer::removePersistent( const OUString& aURL, const O if( aInd > 0 && aUrl.getLength()-1 == aInd ) aUrl = aUrl.copy( 0, aUrl.getLength() - 1 ); else - aUrl += OUString("/"); + aUrl += "/"; aIter = m_aContainer.find( aUrl ); } diff --git a/svl/source/passwordcontainer/syscreds.cxx b/svl/source/passwordcontainer/syscreds.cxx index 9423acfc005f..5bd60dcf8537 100644 --- a/svl/source/passwordcontainer/syscreds.cxx +++ b/svl/source/passwordcontainer/syscreds.cxx @@ -141,8 +141,8 @@ namespace else { OUString tmpUrl( aUrl ); - if ( tmpUrl.getStr()[tmpUrl.getLength() - 1] != (sal_Unicode)'/' ) - tmpUrl += OUString("/"); + if ( !tmpUrl.endsWith("/") ) + tmpUrl += "/"; aIter = rContainer.lower_bound( tmpUrl ); if( aIter != rContainer.end() && aIter->match( tmpUrl ) ) |