summaryrefslogtreecommitdiff
path: root/ucb
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2013-03-20 13:02:46 +0100
committerStephan Bergmann <sbergman@redhat.com>2013-03-20 13:05:35 +0100
commit2d9ce9191da681e4fd9f1d08933ca5117c56601b (patch)
treeeecfa2690dcaffca064cc5712d7a5c9662a32b87 /ucb
parentdc06576d8809760b79f771831bed3122878e0505 (diff)
Remove uses of rtl::OUString::compareToAscii(asciiStr, maxLength)
...which is a confusing overload with unexpectedly different semantics from the one-parameter form. In preparation of marking it as deprecated. Change-Id: I4f176995546ae583fc570d770647ffc315eecc75
Diffstat (limited to 'ucb')
-rw-r--r--ucb/source/ucp/expand/ucpexpand.cxx3
-rw-r--r--ucb/source/ucp/hierarchy/hierarchycontent.cxx5
-rw-r--r--ucb/source/ucp/webdav-neon/DAVProperties.cxx20
3 files changed, 9 insertions, 19 deletions
diff --git a/ucb/source/ucp/expand/ucpexpand.cxx b/ucb/source/ucp/expand/ucpexpand.cxx
index 9dd95fa5d7fd..b823a2d91470 100644
--- a/ucb/source/ucp/expand/ucpexpand.cxx
+++ b/ucb/source/ucp/expand/ucpexpand.cxx
@@ -177,8 +177,7 @@ OUString ExpandContentProviderImpl::expandUri(
uno::Reference< ucb::XContentIdentifier > const & xIdentifier ) const
{
OUString uri( xIdentifier->getContentIdentifier() );
- if (uri.compareToAscii(
- RTL_CONSTASCII_STRINGPARAM(EXPAND_PROTOCOL ":") ) != 0)
+ if (!uri.startsWith(EXPAND_PROTOCOL ":"))
{
throw ucb::IllegalIdentifierException(
"expected protocol " EXPAND_PROTOCOL "!",
diff --git a/ucb/source/ucp/hierarchy/hierarchycontent.cxx b/ucb/source/ucp/hierarchy/hierarchycontent.cxx
index 3676019219fc..92313ca5c078 100644
--- a/ucb/source/ucp/hierarchy/hierarchycontent.cxx
+++ b/ucb/source/ucp/hierarchy/hierarchycontent.cxx
@@ -1602,10 +1602,7 @@ void HierarchyContent::transfer(
}
// Is source a hierarchy content?
- if ( ( rInfo.SourceURL.getLength() < HIERARCHY_URL_SCHEME_LENGTH + 2 ) ||
- ( rInfo.SourceURL.compareToAscii( HIERARCHY_URL_SCHEME ":/",
- HIERARCHY_URL_SCHEME_LENGTH + 2 )
- != 0 ) )
+ if ( !rInfo.SourceURL.startsWith( HIERARCHY_URL_SCHEME ":/" ) )
{
ucbhelper::cancelCommandExecution(
uno::makeAny( ucb::InteractiveBadTransferURLException(
diff --git a/ucb/source/ucp/webdav-neon/DAVProperties.cxx b/ucb/source/ucp/webdav-neon/DAVProperties.cxx
index 4b89cef5dcdc..576f87b89479 100644
--- a/ucb/source/ucp/webdav-neon/DAVProperties.cxx
+++ b/ucb/source/ucp/webdav-neon/DAVProperties.cxx
@@ -51,7 +51,7 @@ const ::rtl::OUString DAVProperties::EXECUTABLE("http://apache.org/dav/props/exe
void DAVProperties::createNeonPropName( const rtl::OUString & rFullName,
NeonPropName & rName )
{
- if ( rFullName.compareToAscii( RTL_CONSTASCII_STRINGPARAM( "DAV:" ) ) == 0 )
+ if ( rFullName.startsWith( "DAV:" ) )
{
rName.nspace = "DAV:";
rName.name
@@ -59,8 +59,7 @@ void DAVProperties::createNeonPropName( const rtl::OUString & rFullName,
rFullName.copy( RTL_CONSTASCII_LENGTH( "DAV:" ) ),
RTL_TEXTENCODING_UTF8 ).getStr() );
}
- else if ( rFullName.compareToAscii( RTL_CONSTASCII_STRINGPARAM(
- "http://apache.org/dav/props/" ) ) == 0 )
+ else if ( rFullName.startsWith( "http://apache.org/dav/props/" ) )
{
rName.nspace = "http://apache.org/dav/props/";
rName.name
@@ -70,8 +69,7 @@ void DAVProperties::createNeonPropName( const rtl::OUString & rFullName,
"http://apache.org/dav/props/" ) ),
RTL_TEXTENCODING_UTF8 ).getStr() );
}
- else if ( rFullName.compareToAscii( RTL_CONSTASCII_STRINGPARAM(
- "http://ucb.openoffice.org/dav/props/" ) ) == 0 )
+ else if ( rFullName.startsWith( "http://ucb.openoffice.org/dav/props/" ) )
{
rName.nspace = "http://ucb.openoffice.org/dav/props/";
rName.name
@@ -81,8 +79,7 @@ void DAVProperties::createNeonPropName( const rtl::OUString & rFullName,
"http://ucb.openoffice.org/dav/props/" ) ),
RTL_TEXTENCODING_UTF8 ).getStr() );
}
- else if ( rFullName.compareToAscii( RTL_CONSTASCII_STRINGPARAM(
- "<prop:" ) ) == 0 )
+ else if ( rFullName.startsWith( "<prop:" ) )
{
// Support for 3rd party namespaces/props
@@ -145,18 +142,15 @@ void DAVProperties::createUCBPropName( const char * nspace,
rFullName = aNameSpace;
rFullName += aName;
- if ( rFullName.compareToAscii( RTL_CONSTASCII_STRINGPARAM(
- "DAV:" ) ) == 0 )
+ if ( rFullName.startsWith( "DAV:" ) )
{
// Okay, Just concat strings.
}
- else if ( rFullName.compareToAscii( RTL_CONSTASCII_STRINGPARAM(
- "http://apache.org/dav/props/" ) ) == 0 )
+ else if ( rFullName.startsWith( "http://apache.org/dav/props/" ) )
{
// Okay, Just concat strings.
}
- else if ( rFullName.compareToAscii( RTL_CONSTASCII_STRINGPARAM(
- "http://ucb.openoffice.org/dav/props/" ) ) == 0 )
+ else if ( rFullName.startsWith( "http://ucb.openoffice.org/dav/props/" ) )
{
// Remove namespace from our own properties.
rFullName = rFullName.copy(