From 52bbd9cc00b5a1e15e4f96b5c5fa5e75855692c1 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Tue, 19 Nov 2013 17:06:06 +0200 Subject: remove unnecessary RTL_CONSTASCII_STRINGPARAM in appendAscii calls Convert code like: aStrBuf.appendAscii( RTL_CONSTASCII_STRINGPARAM( "ln(x)" )); to: aStrBuf.append( "ln(x)" ); which compiles down to the same code. Change-Id: I24c7cb45ceb32fd7cd6ec7ed203c2a5d746f1c5c --- ucb/source/ucp/webdav/SerfPropFindReqProcImpl.cxx | 10 +++---- ucb/source/ucp/webdav/SerfPropPatchReqProcImpl.cxx | 32 +++++++++++----------- ucb/source/ucp/webdav/webdavprovider.cxx | 8 +++--- 3 files changed, 25 insertions(+), 25 deletions(-) (limited to 'ucb/source/ucp') diff --git a/ucb/source/ucp/webdav/SerfPropFindReqProcImpl.cxx b/ucb/source/ucp/webdav/SerfPropFindReqProcImpl.cxx index ccceaf486d5b..d3f9faa72ccf 100644 --- a/ucb/source/ucp/webdav/SerfPropFindReqProcImpl.cxx +++ b/ucb/source/ucp/webdav/SerfPropFindReqProcImpl.cxx @@ -96,7 +96,7 @@ serf_bucket_t * SerfPropFindReqProcImpl::createSerfRequestBucket( serf_request_t // TODO is it really needed a Unicode string buffer? // All properties and property names aren't supposed to be ASCII? rtl::OUStringBuffer aBuffer; - aBuffer.appendAscii( RTL_CONSTASCII_STRINGPARAM( PROPFIND_HEADER )); + aBuffer.append( PROPFIND_HEADER ); // create and fill body bucket with requested properties const int nPropCount = ( !mbOnlyPropertyNames && mpPropNames ) @@ -104,7 +104,7 @@ serf_bucket_t * SerfPropFindReqProcImpl::createSerfRequestBucket( serf_request_t : 0; if ( nPropCount > 0 ) { - aBuffer.appendAscii( RTL_CONSTASCII_STRINGPARAM( "" ) ); + aBuffer.append( "" ); SerfPropName thePropName; for ( int theIndex = 0; theIndex < nPropCount; theIndex ++ ) { @@ -128,15 +128,15 @@ serf_bucket_t * SerfPropFindReqProcImpl::createSerfRequestBucket( serf_request_t { if ( mbOnlyPropertyNames ) { - aBuffer.appendAscii( RTL_CONSTASCII_STRINGPARAM( "" )); + aBuffer.append( "" ); } else { - aBuffer.appendAscii( RTL_CONSTASCII_STRINGPARAM( "" )); + aBuffer.append( "" ); } } - aBuffer.appendAscii( RTL_CONSTASCII_STRINGPARAM( PROPFIND_TRAILER )); + aBuffer.append( PROPFIND_TRAILER ); aBodyText = rtl::OUStringToOString( aBuffer.makeStringAndClear(), RTL_TEXTENCODING_UTF8 ); body_bkt = serf_bucket_simple_copy_create( aBodyText.getStr(), aBodyText.getLength(), diff --git a/ucb/source/ucp/webdav/SerfPropPatchReqProcImpl.cxx b/ucb/source/ucp/webdav/SerfPropPatchReqProcImpl.cxx index c3e95b4a60d9..809a81e12cdd 100644 --- a/ucb/source/ucp/webdav/SerfPropPatchReqProcImpl.cxx +++ b/ucb/source/ucp/webdav/SerfPropPatchReqProcImpl.cxx @@ -68,14 +68,14 @@ serf_bucket_t * SerfPropPatchReqProcImpl::createSerfRequestBucket( serf_request_ { rtl::OUStringBuffer aBuffer; // add PropPatch xml header in front - aBuffer.appendAscii( RTL_CONSTASCII_STRINGPARAM( PROPPATCH_HEADER )); + aBuffer.append( PROPPATCH_HEADER ); // <*operation code*> ProppatchOperation lastOp = (*mpProperties)[ 0 ].operation; - aBuffer.appendAscii( RTL_CONSTASCII_STRINGPARAM( "<" )); + aBuffer.append( "<" ); aBuffer.appendAscii( OpCode[lastOp].str, OpCode[lastOp].len ); - aBuffer.appendAscii( RTL_CONSTASCII_STRINGPARAM( ">" )); + aBuffer.append( ">" ); SerfPropName thePropName; for ( int n = 0; n < nPropCount; ++n ) @@ -88,24 +88,24 @@ serf_bucket_t * SerfPropPatchReqProcImpl::createSerfRequestBucket( serf_request_ if ( rProperty.operation != lastOp ) { // <*operation code> - aBuffer.appendAscii( RTL_CONSTASCII_STRINGPARAM( "<" )); + aBuffer.append( "><" ); aBuffer.appendAscii( OpCode[rProperty.operation].str, OpCode[rProperty.operation].len ); - aBuffer.appendAscii( RTL_CONSTASCII_STRINGPARAM( ">" )); + aBuffer.append( ">" ); } // <*propname* xmlns="*propns*" - aBuffer.appendAscii( RTL_CONSTASCII_STRINGPARAM( "<" )); + aBuffer.append( "<" ); aBuffer.appendAscii( thePropName.name ); - aBuffer.appendAscii( RTL_CONSTASCII_STRINGPARAM( " xmlns=\"" )); + aBuffer.append( " xmlns=\"" ); aBuffer.appendAscii( thePropName.nspace ); - aBuffer.appendAscii( RTL_CONSTASCII_STRINGPARAM( "\"" )); + aBuffer.append( "\"" ); if ( rProperty.operation == PROPSET ) { // >*property value* - aBuffer.appendAscii( RTL_CONSTASCII_STRINGPARAM( ">" )); + aBuffer.append( ">" ); OUString aStringValue; if ( DAVProperties::isUCBDeadProperty( thePropName ) ) @@ -118,26 +118,26 @@ serf_bucket_t * SerfPropPatchReqProcImpl::createSerfRequestBucket( serf_request_ rProperty.value >>= aStringValue; } aBuffer.append( aStringValue ); - aBuffer.appendAscii( RTL_CONSTASCII_STRINGPARAM( "" )); + aBuffer.append( ">" ); } else { // /> - aBuffer.appendAscii( RTL_CONSTASCII_STRINGPARAM( "/>" )); + aBuffer.append( "/>" ); } lastOp = rProperty.operation; } // - aBuffer.appendAscii( RTL_CONSTASCII_STRINGPARAM( "" )); + aBuffer.append( ">" ); // add PropPatch xml trailer at end - aBuffer.appendAscii( RTL_CONSTASCII_STRINGPARAM( PROPPATCH_TRAILER )); + aBuffer.append( PROPPATCH_TRAILER ); aBodyText = rtl::OUStringToOString( aBuffer.makeStringAndClear(), RTL_TEXTENCODING_UTF8 ); body_bkt = serf_bucket_simple_copy_create( aBodyText.getStr(), diff --git a/ucb/source/ucp/webdav/webdavprovider.cxx b/ucb/source/ucp/webdav/webdavprovider.cxx index 2389dc479b3f..3bbd12b7a260 100644 --- a/ucb/source/ucp/webdav/webdavprovider.cxx +++ b/ucb/source/ucp/webdav/webdavprovider.cxx @@ -35,18 +35,18 @@ using namespace http_dav_ucp; OUString &WebDAVUserAgent::operator()() const { OUStringBuffer aBuffer; - aBuffer.appendAscii( RTL_CONSTASCII_STRINGPARAM( "$ooName/$ooSetupVersion" )); + aBuffer.append( "$ooName/$ooSetupVersion" ); #if OSL_DEBUG_LEVEL > 0 #ifdef APR_VERSION - aBuffer.appendAscii( RTL_CONSTASCII_STRINGPARAM( " apr/" APR_VERSION )); + aBuffer.append( " apr/" APR_VERSION ); #endif #ifdef APR_UTIL_VERSION - aBuffer.appendAscii( RTL_CONSTASCII_STRINGPARAM( " apr-util/" APR_UTIL_VERSION )); + aBuffer.append( " apr-util/" APR_UTIL_VERSION ); #endif #ifdef SERF_VERSION - aBuffer.appendAscii( RTL_CONSTASCII_STRINGPARAM( " serf/" SERF_VERSION )); + aBuffer.append( " serf/" SERF_VERSION ); #endif #endif static OUString aUserAgent( aBuffer.makeStringAndClear() ); -- cgit