summaryrefslogtreecommitdiff
path: root/ucb
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2013-10-21 10:21:01 +0200
committerNoel Grandin <noel@peralex.com>2013-10-23 08:29:15 +0200
commit7a06928bcf638e1eeedebc9d53c306a1b852cc9b (patch)
treec0402c2da4e2c522ecf32a0b413128f727cbc0fa /ucb
parenta55d02bacb2c8f21cba759c8fe3931df07a85b0c (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 'ucb')
-rw-r--r--ucb/source/ucp/cmis/cmis_content.cxx4
-rw-r--r--ucb/source/ucp/file/filglob.cxx6
-rw-r--r--ucb/source/ucp/ftp/ftpurl.cxx2
3 files changed, 6 insertions, 6 deletions
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);