diff options
author | Noel Grandin <noel@peralex.com> | 2014-06-04 11:43:58 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2014-06-04 11:52:34 +0200 |
commit | cc25f70ef1e9fa7637b4bfd332ebdc33844a41c2 (patch) | |
tree | 76fe846c5b4ec24faa6ee53d34c49554eac3d4a8 /ucb | |
parent | adc20c3937f3119d39af5a0c8e4a439d8127fe63 (diff) |
compareTo -> equals
convert OUString::compareTo usage to equals to startsWith where it
is more appropriate
Change-Id: I6f5b5b7942429c0099ad082ba4984fd18e422121
Diffstat (limited to 'ucb')
-rw-r--r-- | ucb/source/ucp/file/bc.cxx | 5 | ||||
-rw-r--r-- | ucb/source/ucp/file/filglob.cxx | 2 | ||||
-rw-r--r-- | ucb/source/ucp/gio/gio_content.cxx | 2 | ||||
-rw-r--r-- | ucb/source/ucp/gvfs/gvfs_content.cxx | 2 | ||||
-rw-r--r-- | ucb/source/ucp/hierarchy/hierarchycontent.cxx | 5 | ||||
-rw-r--r-- | ucb/source/ucp/package/pkgcontent.cxx | 5 | ||||
-rw-r--r-- | ucb/source/ucp/tdoc/tdoc_content.cxx | 5 | ||||
-rw-r--r-- | ucb/source/ucp/webdav-neon/webdavcontent.cxx | 2 | ||||
-rw-r--r-- | ucb/source/ucp/webdav/webdavcontent.cxx | 2 |
9 files changed, 13 insertions, 17 deletions
diff --git a/ucb/source/ucp/file/bc.cxx b/ucb/source/ucp/file/bc.cxx index 6faafb969f0d..6d7bdcb7f7bb 100644 --- a/ucb/source/ucp/file/bc.cxx +++ b/ucb/source/ucp/file/bc.cxx @@ -625,11 +625,10 @@ BaseContent::createNewContent( if ( Info.Type.isEmpty() ) return Reference< XContent >(); - bool bFolder - = ( Info.Type.compareTo( m_pMyShell->FolderContentType ) == 0 ); + bool bFolder = Info.Type == m_pMyShell->FolderContentType; if ( !bFolder ) { - if ( Info.Type.compareTo( m_pMyShell->FileContentType ) != 0 ) + if ( Info.Type != m_pMyShell->FileContentType ) { // Neither folder nor file to create! return Reference< XContent >(); diff --git a/ucb/source/ucp/file/filglob.cxx b/ucb/source/ucp/file/filglob.cxx index ea12bf72d97f..2d074c927ac9 100644 --- a/ucb/source/ucp/file/filglob.cxx +++ b/ucb/source/ucp/file/filglob.cxx @@ -166,7 +166,7 @@ namespace fileaccess { || ( ( dstL > srcL ) && - ( srcUnqPath.compareTo( dstUnqPath, srcL ) == 0 ) + dstUnqPath.startsWith(srcUnqPath) && ( dstUnqPath[ srcL ] == slash ) ) ); diff --git a/ucb/source/ucp/gio/gio_content.cxx b/ucb/source/ucp/gio/gio_content.cxx index adba80d8fae0..2d5acc09d595 100644 --- a/ucb/source/ucp/gio/gio_content.cxx +++ b/ucb/source/ucp/gio/gio_content.cxx @@ -563,7 +563,7 @@ void Content::queryChildren( ContentRefList& rChildren ) OUString aChildURL = xChild->getIdentifier()->getContentIdentifier(); // Is aURL a prefix of aChildURL? - if ( ( aChildURL.getLength() > nLen ) && ( aChildURL.compareTo( aURL, nLen ) == 0 ) ) + if ( ( aChildURL.getLength() > nLen ) && aChildURL.startsWith( aURL ) ) { sal_Int32 nPos = nLen; nPos = aChildURL.indexOf( '/', nPos ); diff --git a/ucb/source/ucp/gvfs/gvfs_content.cxx b/ucb/source/ucp/gvfs/gvfs_content.cxx index 8f82888d124f..68f2e1d340cd 100644 --- a/ucb/source/ucp/gvfs/gvfs_content.cxx +++ b/ucb/source/ucp/gvfs/gvfs_content.cxx @@ -896,7 +896,7 @@ void Content::queryChildren( ContentRefList& rChildren ) // Is aURL a prefix of aChildURL? if ( ( aChildURL.getLength() > nLen ) && - ( aChildURL.compareTo( aURL, nLen ) == 0 ) ) { + ( aChildURL.startsWith( aURL ) ) ) { sal_Int32 nPos = nLen; nPos = aChildURL.indexOf( '/', nPos ); diff --git a/ucb/source/ucp/hierarchy/hierarchycontent.cxx b/ucb/source/ucp/hierarchy/hierarchycontent.cxx index e541288dc411..9a00a14a2f76 100644 --- a/ucb/source/ucp/hierarchy/hierarchycontent.cxx +++ b/ucb/source/ucp/hierarchy/hierarchycontent.cxx @@ -814,7 +814,7 @@ void HierarchyContent::queryChildren( HierarchyContentRefList& rChildren ) // Is aURL a prefix of aChildURL? if ( ( aChildURL.getLength() > nLen ) && - ( aChildURL.compareTo( aURL, nLen ) == 0 ) ) + ( aChildURL.startsWith( aURL ) ) ) { sal_Int32 nPos = nLen; nPos = aChildURL.indexOf( '/', nPos ); @@ -1621,8 +1621,7 @@ void HierarchyContent::transfer( if ( rInfo.SourceURL.getLength() <= aId.getLength() ) { - if ( aId.compareTo( - rInfo.SourceURL, rInfo.SourceURL.getLength() ) == 0 ) + if ( aId.startsWith( rInfo.SourceURL ) ) { uno::Any aProps = uno::makeAny(beans::PropertyValue( diff --git a/ucb/source/ucp/package/pkgcontent.cxx b/ucb/source/ucp/package/pkgcontent.cxx index 2b85a29025ec..288525bdefd5 100644 --- a/ucb/source/ucp/package/pkgcontent.cxx +++ b/ucb/source/ucp/package/pkgcontent.cxx @@ -1839,8 +1839,7 @@ void Content::transfer( if ( rInfo.SourceURL.getLength() <= aId.getLength() ) { - if ( aId.compareTo( - rInfo.SourceURL, rInfo.SourceURL.getLength() ) == 0 ) + if ( aId.startsWith( rInfo.SourceURL ) ) { uno::Any aProps = uno::makeAny(beans::PropertyValue( @@ -2193,7 +2192,7 @@ void Content::queryChildren( ContentRefList& rChildren ) // Is aURL a prefix of aChildURL? if ( ( aChildURL.getLength() > nLen ) && - ( aChildURL.compareTo( aURL, nLen ) == 0 ) ) + ( aChildURL.startsWith( aURL ) ) ) { if ( aChildURL.indexOf( '/', nLen ) == -1 ) { diff --git a/ucb/source/ucp/tdoc/tdoc_content.cxx b/ucb/source/ucp/tdoc/tdoc_content.cxx index 5b3b0420c310..6a2676b62a77 100644 --- a/ucb/source/ucp/tdoc/tdoc_content.cxx +++ b/ucb/source/ucp/tdoc/tdoc_content.cxx @@ -799,7 +799,7 @@ void Content::queryChildren( ContentRefList& rChildren ) // Is aURL a prefix of aChildURL? if ( ( aChildURL.getLength() > nLen ) && - ( aChildURL.compareTo( aURL, nLen ) == 0 ) ) + ( aChildURL.startsWith( aURL ) ) ) { sal_Int32 nPos = nLen; nPos = aChildURL.indexOf( '/', nPos ); @@ -1985,8 +1985,7 @@ void Content::transfer( if ( rInfo.SourceURL.getLength() <= aId.getLength() ) { - if ( aId.compareTo( - rInfo.SourceURL, rInfo.SourceURL.getLength() ) == 0 ) + if ( aId.startsWith( rInfo.SourceURL ) ) { uno::Any aProps = uno::makeAny(beans::PropertyValue( diff --git a/ucb/source/ucp/webdav-neon/webdavcontent.cxx b/ucb/source/ucp/webdav-neon/webdavcontent.cxx index f67c85240b80..fe49180627da 100644 --- a/ucb/source/ucp/webdav-neon/webdavcontent.cxx +++ b/ucb/source/ucp/webdav-neon/webdavcontent.cxx @@ -2240,7 +2240,7 @@ void Content::queryChildren( ContentRefList& rChildren ) // Is aURL a prefix of aChildURL? if ( ( aChildURL.getLength() > nLen ) && - ( aChildURL.compareTo( aURL, nLen ) == 0 ) ) + ( aChildURL.startsWith( aURL ) ) ) { sal_Int32 nPos = nLen; nPos = aChildURL.indexOf( '/', nPos ); diff --git a/ucb/source/ucp/webdav/webdavcontent.cxx b/ucb/source/ucp/webdav/webdavcontent.cxx index cf1a55e601b1..b783e166a52a 100644 --- a/ucb/source/ucp/webdav/webdavcontent.cxx +++ b/ucb/source/ucp/webdav/webdavcontent.cxx @@ -2367,7 +2367,7 @@ void Content::queryChildren( ContentRefList& rChildren ) // Is aURL a prefix of aChildURL? if ( ( aChildURL.getLength() > nLen ) && - ( aChildURL.compareTo( aURL, nLen ) == 0 ) ) + ( aChildURL.startsWith( aURL ) ) ) { sal_Int32 nPos = nLen; nPos = aChildURL.indexOf( '/', nPos ); |