Kaydet (Commit) 5e649bc0 authored tarafından Chr. Rossmanith's avatar Chr. Rossmanith

Remove RTL_CONSTASCII_(U)STRINGPARAM in ucb

and use append() instead of appendAscii()

Change-Id: I7c9dd0e03e24a39240a82fc245b4722d4c424842
üst 46dfe0bc
...@@ -1222,8 +1222,7 @@ void SerfSession::abort() ...@@ -1222,8 +1222,7 @@ void SerfSession::abort()
// ------------------------------------------------------------------- // -------------------------------------------------------------------
const ucbhelper::InternetProxyServer & SerfSession::getProxySettings() const const ucbhelper::InternetProxyServer & SerfSession::getProxySettings() const
{ {
if ( m_aUri.GetScheme().equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "http" ) ) || if ( m_aUri.GetScheme() == "http" || m_aUri.GetScheme() == "https" )
m_aUri.GetScheme().equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "https" ) ) )
{ {
return m_rProxyDecider.getProxy( m_aUri.GetScheme(), return m_rProxyDecider.getProxy( m_aUri.GetScheme(),
m_aUri.GetHost(), m_aUri.GetHost(),
......
...@@ -140,19 +140,19 @@ SerfUri::~SerfUri( ) ...@@ -140,19 +140,19 @@ SerfUri::~SerfUri( )
void SerfUri::calculateURI () void SerfUri::calculateURI ()
{ {
rtl::OUStringBuffer aBuf( mScheme ); rtl::OUStringBuffer aBuf( mScheme );
aBuf.appendAscii( "://" ); aBuf.append( "://" );
if ( mUserInfo.getLength() > 0 ) if ( mUserInfo.getLength() > 0 )
{ {
aBuf.append( mUserInfo ); aBuf.append( mUserInfo );
aBuf.appendAscii( "@" ); aBuf.append( "@" );
} }
// Is host a numeric IPv6 address? // Is host a numeric IPv6 address?
if ( ( mHostName.indexOf( ':' ) != -1 ) && if ( ( mHostName.indexOf( ':' ) != -1 ) &&
( mHostName[ 0 ] != sal_Unicode( '[' ) ) ) ( mHostName[ 0 ] != sal_Unicode( '[' ) ) )
{ {
aBuf.appendAscii( "[" ); aBuf.append( "[" );
aBuf.append( mHostName ); aBuf.append( mHostName );
aBuf.appendAscii( "]" ); aBuf.append( "]" );
} }
else else
{ {
...@@ -164,16 +164,16 @@ void SerfUri::calculateURI () ...@@ -164,16 +164,16 @@ void SerfUri::calculateURI ()
switch ( mPort ) switch ( mPort )
{ {
case DEFAULT_HTTP_PORT: case DEFAULT_HTTP_PORT:
bAppendPort = !mScheme.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "http" ) ); bAppendPort = (mScheme != "http");
break; break;
case DEFAULT_HTTPS_PORT: case DEFAULT_HTTPS_PORT:
bAppendPort = !mScheme.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "https" ) ); bAppendPort = (mScheme != "https");
break; break;
} }
if ( bAppendPort ) if ( bAppendPort )
{ {
aBuf.appendAscii( ":" ); aBuf.append( ":" );
aBuf.append( rtl::OUString::valueOf( mPort ) ); aBuf.append( rtl::OUString::valueOf( mPort ) );
} }
aBuf.append( mPath ); aBuf.append( mPath );
...@@ -256,9 +256,9 @@ rtl::OUString SerfUri::makeConnectionEndPointString( ...@@ -256,9 +256,9 @@ rtl::OUString SerfUri::makeConnectionEndPointString(
if ( ( rHostName.indexOf( ':' ) != -1 ) && if ( ( rHostName.indexOf( ':' ) != -1 ) &&
( rHostName[ 0 ] != sal_Unicode( '[' ) ) ) ( rHostName[ 0 ] != sal_Unicode( '[' ) ) )
{ {
aBuf.appendAscii( "[" ); aBuf.append( "[" );
aBuf.append( rHostName ); aBuf.append( rHostName );
aBuf.appendAscii( "]" ); aBuf.append( "]" );
} }
else else
{ {
...@@ -267,7 +267,7 @@ rtl::OUString SerfUri::makeConnectionEndPointString( ...@@ -267,7 +267,7 @@ rtl::OUString SerfUri::makeConnectionEndPointString(
if ( ( nPort != DEFAULT_HTTP_PORT ) && ( nPort != DEFAULT_HTTPS_PORT ) ) if ( ( nPort != DEFAULT_HTTP_PORT ) && ( nPort != DEFAULT_HTTPS_PORT ) )
{ {
aBuf.appendAscii( ":" ); aBuf.append( ":" );
aBuf.append( rtl::OUString::valueOf( sal_Int32( nPort ) ) ); aBuf.append( rtl::OUString::valueOf( sal_Int32( nPort ) ) );
} }
return aBuf.makeStringAndClear(); return aBuf.makeStringAndClear();
......
...@@ -109,16 +109,9 @@ ContentProvider::queryContent( ...@@ -109,16 +109,9 @@ ContentProvider::queryContent(
const rtl::OUString aScheme const rtl::OUString aScheme
= Identifier->getContentProviderScheme().toAsciiLowerCase(); = Identifier->getContentProviderScheme().toAsciiLowerCase();
if ( !aScheme.equalsAsciiL( if ( aScheme != HTTP_URL_SCHEME && aScheme != HTTPS_URL_SCHEME &&
RTL_CONSTASCII_STRINGPARAM( HTTP_URL_SCHEME ) ) && aScheme != WEBDAV_URL_SCHEME && aScheme != DAV_URL_SCHEME &&
!aScheme.equalsAsciiL( aScheme != DAVS_URL_SCHEME )
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 ) ) )
throw ucb::IllegalIdentifierException(); throw ucb::IllegalIdentifierException();
// Normalize URL and create new Id, if nessacary. // Normalize URL and create new Id, if nessacary.
...@@ -136,8 +129,7 @@ ContentProvider::queryContent( ...@@ -136,8 +129,7 @@ ContentProvider::queryContent(
uno::Reference< ucb::XContentIdentifier > xCanonicId; uno::Reference< ucb::XContentIdentifier > xCanonicId;
bool bNewId = false; bool bNewId = false;
if ( aScheme.equalsAsciiL( if ( aScheme == WEBDAV_URL_SCHEME )
RTL_CONSTASCII_STRINGPARAM( WEBDAV_URL_SCHEME ) ) )
{ {
aURL = aURL.replaceAt( 0, aURL = aURL.replaceAt( 0,
WEBDAV_URL_SCHEME_LENGTH, WEBDAV_URL_SCHEME_LENGTH,
...@@ -145,8 +137,7 @@ ContentProvider::queryContent( ...@@ -145,8 +137,7 @@ ContentProvider::queryContent(
HTTP_URL_SCHEME ) ); HTTP_URL_SCHEME ) );
bNewId = true; bNewId = true;
} }
else if ( aScheme.equalsAsciiL( else if ( aScheme == DAV_URL_SCHEME )
RTL_CONSTASCII_STRINGPARAM( DAV_URL_SCHEME ) ) )
{ {
aURL = aURL.replaceAt( 0, aURL = aURL.replaceAt( 0,
DAV_URL_SCHEME_LENGTH, DAV_URL_SCHEME_LENGTH,
...@@ -154,8 +145,7 @@ ContentProvider::queryContent( ...@@ -154,8 +145,7 @@ ContentProvider::queryContent(
HTTP_URL_SCHEME ) ); HTTP_URL_SCHEME ) );
bNewId = true; bNewId = true;
} }
else if ( aScheme.equalsAsciiL( else if ( aScheme == DAVS_URL_SCHEME )
RTL_CONSTASCII_STRINGPARAM( DAVS_URL_SCHEME ) ) )
{ {
aURL = aURL.replaceAt( 0, aURL = aURL.replaceAt( 0,
DAVS_URL_SCHEME_LENGTH, DAVS_URL_SCHEME_LENGTH,
......
...@@ -1096,12 +1096,10 @@ void UcbContent::open( const rtl::OUString & rName, const OUString& rInput, ...@@ -1096,12 +1096,10 @@ void UcbContent::open( const rtl::OUString & rName, const OUString& rInput,
if ( bPrint ) if ( bPrint )
{ {
if ( !bFolder && xRow->wasNull() ) if ( !bFolder && xRow->wasNull() )
aText.AppendAscii( RTL_CONSTASCII_STRINGPARAM( aText.AppendAscii( "<null>" );
"<null>" ) );
else else
aText += bFolder ? OUString("true") : OUString("false"); aText += bFolder ? OUString("true") : OUString("false");
aText.AppendAscii( RTL_CONSTASCII_STRINGPARAM( aText.AppendAscii( " : " );
" : " ) );
} }
// IsDocument: // IsDocument:
...@@ -1109,8 +1107,7 @@ void UcbContent::open( const rtl::OUString & rName, const OUString& rInput, ...@@ -1109,8 +1107,7 @@ void UcbContent::open( const rtl::OUString & rName, const OUString& rInput,
if ( bPrint ) if ( bPrint )
{ {
if ( !bFolder && xRow->wasNull() ) if ( !bFolder && xRow->wasNull() )
aText.AppendAscii( RTL_CONSTASCII_STRINGPARAM( aText.AppendAscii( "<null>" );
"<null>" ) );
else else
aText aText
+= bDocument ? OUString("true") : OUString("false"); // IsDocument += bDocument ? OUString("true") : OUString("false"); // IsDocument
...@@ -1606,12 +1603,12 @@ void SAL_CALL UcbContent::contentEvent( const ucb::ContentEvent& evt ) ...@@ -1606,12 +1603,12 @@ void SAL_CALL UcbContent::contentEvent( const ucb::ContentEvent& evt )
aMatch += String(evt.Id->getContentIdentifier()); aMatch += String(evt.Id->getContentIdentifier());
if (evt.Content.is()) if (evt.Content.is())
{ {
aMatch.AppendAscii(RTL_CONSTASCII_STRINGPARAM(" - ")); aMatch.AppendAscii(" - ");
aMatch += String(evt.Content->getContentType()); aMatch += String(evt.Content->getContentType());
} }
} }
else else
aMatch.AppendAscii(RTL_CONSTASCII_STRINGPARAM("<no id>")); aMatch.AppendAscii("<no id>");
print(aMatch); print(aMatch);
break; break;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment