From 05050cdb23de586870bf479a9df5ced06828d498 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Thu, 6 Nov 2014 07:45:00 +0200 Subject: use the new OUString::fromUtf8 method Change-Id: I771004b7ccab3344a67e827e45bc34c22ffa5f77 --- ucb/source/ucp/webdav-neon/DAVProperties.cxx | 6 ++---- ucb/source/ucp/webdav-neon/NeonPropFindRequest.cxx | 8 +++----- ucb/source/ucp/webdav-neon/NeonUri.cxx | 24 +++++++++------------- ucb/source/ucp/webdav/DAVProperties.cxx | 6 ++---- ucb/source/ucp/webdav/SerfUri.cxx | 12 +++++------ 5 files changed, 23 insertions(+), 33 deletions(-) (limited to 'ucb') diff --git a/ucb/source/ucp/webdav-neon/DAVProperties.cxx b/ucb/source/ucp/webdav-neon/DAVProperties.cxx index 5d5634936dca..09960488ac89 100644 --- a/ucb/source/ucp/webdav-neon/DAVProperties.cxx +++ b/ucb/source/ucp/webdav-neon/DAVProperties.cxx @@ -108,10 +108,8 @@ void DAVProperties::createUCBPropName( const char * nspace, const char * name, OUString & rFullName ) { - OUString aNameSpace - = OStringToOUString( nspace, RTL_TEXTENCODING_UTF8 ); - OUString aName - = OStringToOUString( name, RTL_TEXTENCODING_UTF8 ); + OUString aNameSpace = OUString::fromUtf8( nspace ); + OUString aName = OUString::fromUtf8( name ); if ( aNameSpace.isEmpty() ) { diff --git a/ucb/source/ucp/webdav-neon/NeonPropFindRequest.cxx b/ucb/source/ucp/webdav-neon/NeonPropFindRequest.cxx index 73b6c7c5df32..f4a58ccb5def 100644 --- a/ucb/source/ucp/webdav-neon/NeonPropFindRequest.cxx +++ b/ucb/source/ucp/webdav-neon/NeonPropFindRequest.cxx @@ -175,7 +175,7 @@ extern "C" int NPFR_propfind_iter( void* userdata, else { thePropertyValue.Value - <<= OStringToOUString( value, RTL_TEXTENCODING_UTF8 ); + <<= OUString::fromUtf8( value ); } } @@ -192,8 +192,7 @@ extern "C" void NPFR_propfind_results( void* userdata, { // @@@ href is not the uri! DAVResource ctor wants uri! - DAVResource theResource( - OStringToOUString( uri->path, RTL_TEXTENCODING_UTF8 ) ); + DAVResource theResource( OUString::fromUtf8( uri->path ) ); ne_propset_iterate( set, NPFR_propfind_iter, &theResource ); @@ -224,8 +223,7 @@ extern "C" void NPFR_propnames_results( void* userdata, { // @@@ href is not the uri! DAVResourceInfo ctor wants uri! // Create entry for the resource. - DAVResourceInfo theResource( - OStringToOUString( uri->path, RTL_TEXTENCODING_UTF8 ) ); + DAVResourceInfo theResource( OUString::fromUtf8( uri->path ) ); // Fill entry. ne_propset_iterate( results, NPFR_propnames_iter, &theResource ); diff --git a/ucb/source/ucp/webdav-neon/NeonUri.cxx b/ucb/source/ucp/webdav-neon/NeonUri.cxx index d378cfb46ddf..bec91bcb8759 100644 --- a/ucb/source/ucp/webdav-neon/NeonUri.cxx +++ b/ucb/source/ucp/webdav-neon/NeonUri.cxx @@ -124,28 +124,24 @@ void NeonUri::init( const OString & rUri, const ne_uri * pUri ) &g_sUriDefaultsHTTPS : &g_sUriDefaultsHTTP; - mScheme = OStringToOUString( - pUri->scheme ? pUri->scheme : pUriDefs->scheme, - RTL_TEXTENCODING_UTF8 ); - mUserInfo = OStringToOUString( - pUri->userinfo ? pUri->userinfo : pUriDefs->userinfo, - RTL_TEXTENCODING_UTF8 ); - mHostName = OStringToOUString( - pUri->host ? pUri->host : pUriDefs->host, - RTL_TEXTENCODING_UTF8 ); + mScheme = OUString::fromUtf8( + pUri->scheme ? pUri->scheme : pUriDefs->scheme); + mUserInfo = OUString::fromUtf8( + pUri->userinfo ? pUri->userinfo : pUriDefs->userinfo); + mHostName = OUString::fromUtf8( + pUri->host ? pUri->host : pUriDefs->host); mPort = pUri->port > 0 ? pUri->port : pUriDefs->port; - mPath = OStringToOUString( - pUri->path ? pUri->path : pUriDefs->path, - RTL_TEXTENCODING_UTF8 ); + mPath = OUString::fromUtf8( + pUri->path ? pUri->path : pUriDefs->path); if ( pUri->query ) { - mPath += "?" + OStringToOUString( pUri->query, RTL_TEXTENCODING_UTF8 ); + mPath += "?" + OUString::fromUtf8( pUri->query ); } if ( pUri->fragment ) { - mPath += "#" + OStringToOUString( pUri->fragment, RTL_TEXTENCODING_UTF8 ); + mPath += "#" + OUString::fromUtf8( pUri->fragment ); } } diff --git a/ucb/source/ucp/webdav/DAVProperties.cxx b/ucb/source/ucp/webdav/DAVProperties.cxx index 34537d29e663..4162f4f6db09 100644 --- a/ucb/source/ucp/webdav/DAVProperties.cxx +++ b/ucb/source/ucp/webdav/DAVProperties.cxx @@ -113,10 +113,8 @@ void DAVProperties::createUCBPropName( const char * nspace, const char * name, OUString & rFullName ) { - OUString aNameSpace - = OStringToOUString( nspace, RTL_TEXTENCODING_UTF8 ); - OUString aName - = OStringToOUString( name, RTL_TEXTENCODING_UTF8 ); + OUString aNameSpace = OUString::fromUtf8( nspace ); + OUString aName = OUString::fromUtf8( name ); if ( !aNameSpace.getLength() ) { diff --git a/ucb/source/ucp/webdav/SerfUri.cxx b/ucb/source/ucp/webdav/SerfUri.cxx index df299338667e..5c44cca7f200 100644 --- a/ucb/source/ucp/webdav/SerfUri.cxx +++ b/ucb/source/ucp/webdav/SerfUri.cxx @@ -93,22 +93,22 @@ SerfUri::SerfUri( const OUString & inUri ) void SerfUri::init( const apr_uri_t * pUri ) { - mScheme = OStringToOUString( pUri->scheme, RTL_TEXTENCODING_UTF8 ); - mUserInfo = OStringToOUString( pUri->user, RTL_TEXTENCODING_UTF8 ); - mHostName = OStringToOUString( pUri->hostname, RTL_TEXTENCODING_UTF8 ); + mScheme = OUString::fromUtf8( pUri->scheme ); + mUserInfo = OUString::fromUtf8( pUri->user ); + mHostName = OUString::fromUtf8( pUri->hostname ); mPort = pUri->port; - mPath = OStringToOUString( pUri->path, RTL_TEXTENCODING_UTF8 ); + mPath = OUString::fromUtf8( pUri->path ); if ( pUri->query ) { mPath += "?"; - mPath += OStringToOUString( pUri->query, RTL_TEXTENCODING_UTF8 ); + mPath += OUString::fromUtf8( pUri->query ); } if ( pUri->fragment ) { mPath += "#"; - mPath += OStringToOUString( pUri->fragment, RTL_TEXTENCODING_UTF8 ); + mPath += OUString::fromUtf8( pUri->fragment ); } } -- cgit