diff options
author | Noel Grandin <noel@peralex.com> | 2014-11-06 07:45:00 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2014-11-06 13:51:10 +0200 |
commit | 05050cdb23de586870bf479a9df5ced06828d498 (patch) | |
tree | a34c3bba9a921a5e9abf23d5757c15dfaea0ceac /connectivity/source/drivers/postgresql | |
parent | 8f266781a6bd6a629bce65c0f613683047c9a794 (diff) |
use the new OUString::fromUtf8 method
Change-Id: I771004b7ccab3344a67e827e45bc34c22ffa5f77
Diffstat (limited to 'connectivity/source/drivers/postgresql')
-rw-r--r-- | connectivity/source/drivers/postgresql/pq_tools.cxx | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/connectivity/source/drivers/postgresql/pq_tools.cxx b/connectivity/source/drivers/postgresql/pq_tools.cxx index 17428fd96fe2..e077f8420109 100644 --- a/connectivity/source/drivers/postgresql/pq_tools.cxx +++ b/connectivity/source/drivers/postgresql/pq_tools.cxx @@ -125,7 +125,7 @@ void bufferEscapeConstant( OUStringBuffer & buf, const OUString & value, Connect strbuf.setLength( len ); // Previously here RTL_TEXTENCODING_ASCII_US; as we set the PostgreSQL client_encoding to UTF8, // we get UTF8 here, too. I'm not sure why it worked well before... - buf.append( OStringToOUString( strbuf.makeStringAndClear(), RTL_TEXTENCODING_UTF8 ) ); + buf.append( OUString::fromUtf8( strbuf.makeStringAndClear() ) ); } static inline void ibufferQuoteConstant( OUStringBuffer & buf, const OUString & value, ConnectionSettings *settings ) @@ -168,7 +168,7 @@ static inline void ibufferQuoteIdentifier( OUStringBuffer & buf, const OUString -1, Any()); } - buf.append( OStringToOUString( cstr, RTL_TEXTENCODING_UTF8 ) ); + buf.append( OUString::fromUtf8( cstr ) ); PQfreemem( cstr ); } @@ -553,11 +553,11 @@ void splitConcatenatedIdentifier( const OUString & source, OUString *first, OUSt { case 1: *first = OUString(); - *second = OStringToOUString( vec[0], RTL_TEXTENCODING_UTF8 ); + *second = OUString::fromUtf8( vec[0] ); break; case 3: - *first = OStringToOUString( vec[0], RTL_TEXTENCODING_UTF8 ); - *second = OStringToOUString( vec[2], RTL_TEXTENCODING_UTF8 ); + *first = OUString::fromUtf8( vec[0] ); + *second = OUString::fromUtf8( vec[2] ); break; default: SAL_WARN("connectivity.postgresql", @@ -706,15 +706,12 @@ com::sun::star::uno::Sequence< sal_Int32 > parseIntArray( const OUString & str ) { sal_Int32 start = 0; IntVector vec; -// printf( ">%s<\n" , OUStringToOString( str, RTL_TEXTENCODING_UTF8 ).getStr() ); for( sal_Int32 i = str.indexOf( ' ' ) ; i != -1 ; i = str.indexOf( ' ', start) ) { vec.push_back( (sal_Int32)rtl_ustr_toInt32( &str.pData->buffer[start], 10 ) ); -// printf( "found %d\n" , rtl_ustr_toInt32( &str.pData->buffer[start], 10 )); start = i + 1; } vec.push_back( (sal_Int32)rtl_ustr_toInt32( &str.pData->buffer[start], 10 ) ); -// printf( "found %d\n" , rtl_ustr_toInt32( &str.pData->buffer[start], 10 )); return sequence_of_vector(vec); } |