From 5e649bc002ca49a5a3db43cf48149709d446bb0e Mon Sep 17 00:00:00 2001 From: "Chr. Rossmanith" Date: Thu, 28 Mar 2013 21:56:43 +0100 Subject: Remove RTL_CONSTASCII_(U)STRINGPARAM in ucb and use append() instead of appendAscii() Change-Id: I7c9dd0e03e24a39240a82fc245b4722d4c424842 --- ucb/source/ucp/webdav/SerfSession.cxx | 3 +-- ucb/source/ucp/webdav/SerfUri.cxx | 20 ++++++++++---------- ucb/source/ucp/webdav/webdavprovider.cxx | 22 ++++++---------------- ucb/workben/ucb/ucbdemo.cxx | 13 +++++-------- 4 files changed, 22 insertions(+), 36 deletions(-) (limited to 'ucb') diff --git a/ucb/source/ucp/webdav/SerfSession.cxx b/ucb/source/ucp/webdav/SerfSession.cxx index 32201ef410a0..40641676df02 100644 --- a/ucb/source/ucp/webdav/SerfSession.cxx +++ b/ucb/source/ucp/webdav/SerfSession.cxx @@ -1222,8 +1222,7 @@ void SerfSession::abort() // ------------------------------------------------------------------- const ucbhelper::InternetProxyServer & SerfSession::getProxySettings() const { - if ( m_aUri.GetScheme().equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "http" ) ) || - m_aUri.GetScheme().equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "https" ) ) ) + if ( m_aUri.GetScheme() == "http" || m_aUri.GetScheme() == "https" ) { return m_rProxyDecider.getProxy( m_aUri.GetScheme(), m_aUri.GetHost(), diff --git a/ucb/source/ucp/webdav/SerfUri.cxx b/ucb/source/ucp/webdav/SerfUri.cxx index 704d8eb3627b..550524f965ae 100644 --- a/ucb/source/ucp/webdav/SerfUri.cxx +++ b/ucb/source/ucp/webdav/SerfUri.cxx @@ -140,19 +140,19 @@ SerfUri::~SerfUri( ) void SerfUri::calculateURI () { rtl::OUStringBuffer aBuf( mScheme ); - aBuf.appendAscii( "://" ); + aBuf.append( "://" ); if ( mUserInfo.getLength() > 0 ) { aBuf.append( mUserInfo ); - aBuf.appendAscii( "@" ); + aBuf.append( "@" ); } // Is host a numeric IPv6 address? if ( ( mHostName.indexOf( ':' ) != -1 ) && ( mHostName[ 0 ] != sal_Unicode( '[' ) ) ) { - aBuf.appendAscii( "[" ); + aBuf.append( "[" ); aBuf.append( mHostName ); - aBuf.appendAscii( "]" ); + aBuf.append( "]" ); } else { @@ -164,16 +164,16 @@ void SerfUri::calculateURI () switch ( mPort ) { case DEFAULT_HTTP_PORT: - bAppendPort = !mScheme.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "http" ) ); + bAppendPort = (mScheme != "http"); break; case DEFAULT_HTTPS_PORT: - bAppendPort = !mScheme.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "https" ) ); + bAppendPort = (mScheme != "https"); break; } if ( bAppendPort ) { - aBuf.appendAscii( ":" ); + aBuf.append( ":" ); aBuf.append( rtl::OUString::valueOf( mPort ) ); } aBuf.append( mPath ); @@ -256,9 +256,9 @@ rtl::OUString SerfUri::makeConnectionEndPointString( if ( ( rHostName.indexOf( ':' ) != -1 ) && ( rHostName[ 0 ] != sal_Unicode( '[' ) ) ) { - aBuf.appendAscii( "[" ); + aBuf.append( "[" ); aBuf.append( rHostName ); - aBuf.appendAscii( "]" ); + aBuf.append( "]" ); } else { @@ -267,7 +267,7 @@ rtl::OUString SerfUri::makeConnectionEndPointString( if ( ( nPort != DEFAULT_HTTP_PORT ) && ( nPort != DEFAULT_HTTPS_PORT ) ) { - aBuf.appendAscii( ":" ); + aBuf.append( ":" ); aBuf.append( rtl::OUString::valueOf( sal_Int32( nPort ) ) ); } return aBuf.makeStringAndClear(); diff --git a/ucb/source/ucp/webdav/webdavprovider.cxx b/ucb/source/ucp/webdav/webdavprovider.cxx index 07d1e9a4cb4a..21befa3fb5ea 100644 --- a/ucb/source/ucp/webdav/webdavprovider.cxx +++ b/ucb/source/ucp/webdav/webdavprovider.cxx @@ -109,16 +109,9 @@ ContentProvider::queryContent( const rtl::OUString aScheme = Identifier->getContentProviderScheme().toAsciiLowerCase(); - if ( !aScheme.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( HTTP_URL_SCHEME ) ) && - !aScheme.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( HTTPS_URL_SCHEME ) ) && - !aScheme.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( WEBDAV_URL_SCHEME ) ) && - !aScheme.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( DAV_URL_SCHEME ) ) && - !aScheme.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( DAVS_URL_SCHEME ) ) ) + if ( aScheme != HTTP_URL_SCHEME && aScheme != HTTPS_URL_SCHEME && + aScheme != WEBDAV_URL_SCHEME && aScheme != DAV_URL_SCHEME && + aScheme != DAVS_URL_SCHEME ) throw ucb::IllegalIdentifierException(); // Normalize URL and create new Id, if nessacary. @@ -136,8 +129,7 @@ ContentProvider::queryContent( uno::Reference< ucb::XContentIdentifier > xCanonicId; bool bNewId = false; - if ( aScheme.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( WEBDAV_URL_SCHEME ) ) ) + if ( aScheme == WEBDAV_URL_SCHEME ) { aURL = aURL.replaceAt( 0, WEBDAV_URL_SCHEME_LENGTH, @@ -145,8 +137,7 @@ ContentProvider::queryContent( HTTP_URL_SCHEME ) ); bNewId = true; } - else if ( aScheme.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( DAV_URL_SCHEME ) ) ) + else if ( aScheme == DAV_URL_SCHEME ) { aURL = aURL.replaceAt( 0, DAV_URL_SCHEME_LENGTH, @@ -154,8 +145,7 @@ ContentProvider::queryContent( HTTP_URL_SCHEME ) ); bNewId = true; } - else if ( aScheme.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( DAVS_URL_SCHEME ) ) ) + else if ( aScheme == DAVS_URL_SCHEME ) { aURL = aURL.replaceAt( 0, DAVS_URL_SCHEME_LENGTH, diff --git a/ucb/workben/ucb/ucbdemo.cxx b/ucb/workben/ucb/ucbdemo.cxx index fd5860933da7..27fd41540777 100644 --- a/ucb/workben/ucb/ucbdemo.cxx +++ b/ucb/workben/ucb/ucbdemo.cxx @@ -1096,12 +1096,10 @@ void UcbContent::open( const rtl::OUString & rName, const OUString& rInput, if ( bPrint ) { if ( !bFolder && xRow->wasNull() ) - aText.AppendAscii( RTL_CONSTASCII_STRINGPARAM( - "" ) ); + aText.AppendAscii( "" ); else aText += bFolder ? OUString("true") : OUString("false"); - aText.AppendAscii( RTL_CONSTASCII_STRINGPARAM( - " : " ) ); + aText.AppendAscii( " : " ); } // IsDocument: @@ -1109,8 +1107,7 @@ void UcbContent::open( const rtl::OUString & rName, const OUString& rInput, if ( bPrint ) { if ( !bFolder && xRow->wasNull() ) - aText.AppendAscii( RTL_CONSTASCII_STRINGPARAM( - "" ) ); + aText.AppendAscii( "" ); else aText += bDocument ? OUString("true") : OUString("false"); // IsDocument @@ -1606,12 +1603,12 @@ void SAL_CALL UcbContent::contentEvent( const ucb::ContentEvent& evt ) aMatch += String(evt.Id->getContentIdentifier()); if (evt.Content.is()) { - aMatch.AppendAscii(RTL_CONSTASCII_STRINGPARAM(" - ")); + aMatch.AppendAscii(" - "); aMatch += String(evt.Content->getContentType()); } } else - aMatch.AppendAscii(RTL_CONSTASCII_STRINGPARAM("")); + aMatch.AppendAscii(""); print(aMatch); break; } -- cgit