From 7a06928bcf638e1eeedebc9d53c306a1b852cc9b Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Mon, 21 Oct 2013 10:21:01 +0200 Subject: 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 --- ucb/source/ucp/cmis/cmis_content.cxx | 4 ++-- ucb/source/ucp/file/filglob.cxx | 6 +++--- ucb/source/ucp/ftp/ftpurl.cxx | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) (limited to 'ucb') diff --git a/ucb/source/ucp/cmis/cmis_content.cxx b/ucb/source/ucp/cmis/cmis_content.cxx index 81590189371f..d7987c6f487f 100644 --- a/ucb/source/ucp/cmis/cmis_content.cxx +++ b/ucb/source/ucp/cmis/cmis_content.cxx @@ -569,7 +569,7 @@ namespace cmis OUString sPath = m_sObjectPath; // Get rid of the trailing slash problem - if ( sPath[ sPath.getLength( ) - 1 ] == '/' ) + if ( sPath.endsWith("/") ) sPath = sPath.copy( 0, sPath.getLength() - 1 ); // Get the last segment @@ -1862,7 +1862,7 @@ namespace cmis URL aUrl( m_sURL ); OUString sPath( m_sObjectPath ); - if ( sPath[sPath.getLength( ) - 1] != '/' ) + if ( !sPath.endsWith("/") ) sPath += "/"; sPath += STD_TO_OUSTR( ( *it )->getName( ) ); OUString sId = STD_TO_OUSTR( ( *it )->getId( ) ); diff --git a/ucb/source/ucp/file/filglob.cxx b/ucb/source/ucp/file/filglob.cxx index e2172875fcfa..e830a5e1d5b2 100644 --- a/ucb/source/ucp/file/filglob.cxx +++ b/ucb/source/ucp/file/filglob.cxx @@ -199,11 +199,11 @@ namespace fileaccess { sal_Int32 lastIndex = aFileName.lastIndexOf( sal_Unicode('/') ); OUString aParent = aFileName.copy( 0,lastIndex ); - if( aParent[ aParent.getLength()-1] == sal_Unicode(':') && aParent.getLength() == 6 ) - aParent += OUString("/"); + if( aParent.endsWith(":") && aParent.getLength() == 6 ) + aParent += "/"; if ( aParent == "file://" ) - aParent = OUString("file:///"); + aParent = "file:///"; return aParent; } diff --git a/ucb/source/ucp/ftp/ftpurl.cxx b/ucb/source/ucp/ftp/ftpurl.cxx index 70c15c4e84fa..ba0e29840dca 100644 --- a/ucb/source/ucp/ftp/ftpurl.cxx +++ b/ucb/source/ucp/ftp/ftpurl.cxx @@ -278,7 +278,7 @@ OUString FTPURL::ident(bool withslash,bool internal) const else bff.append(sal_Unicode('/')).append(m_aPathSegmentVec[i]); if(withslash) - if(!bff.isEmpty() && bff[bff.getLength()-1] != sal_Unicode('/')) + if(!bff.isEmpty() && bff[bff.getLength()-1] != '/') bff.append(sal_Unicode('/')); bff.append(m_aType); -- cgit