From 54013188b24a1a02491a2853f731461253065424 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Wed, 8 Jul 2015 15:02:31 +0200 Subject: cleanup some unnecessary direct usage of the OString/OUString C API. Change-Id: I6edee95aae1c169ce70063562a0c1b287e0c4735 Reviewed-on: https://gerrit.libreoffice.org/16861 Tested-by: Jenkins Reviewed-by: Noel Grandin --- connectivity/source/drivers/file/fcode.cxx | 7 +------ connectivity/source/drivers/postgresql/pq_tools.cxx | 16 ++++------------ 2 files changed, 5 insertions(+), 18 deletions(-) (limited to 'connectivity') diff --git a/connectivity/source/drivers/file/fcode.cxx b/connectivity/source/drivers/file/fcode.cxx index 96793912a33e..e4c14261fa2d 100644 --- a/connectivity/source/drivers/file/fcode.cxx +++ b/connectivity/source/drivers/file/fcode.cxx @@ -305,12 +305,7 @@ bool OOp_COMPARE::operate(const OOperand* pLeft, const OOperand* pRight) const case DataType::LONGVARCHAR: { OUString sLH = aLH, sRH = aRH; - sal_Int32 nRes = rtl_ustr_compareIgnoreAsciiCase_WithLength - ( - sLH.pData->buffer, - sLH.pData->length, - sRH.pData->buffer, - sRH.pData->length ); + sal_Int32 nRes = sLH.compareToIgnoreAsciiCase(sRH); switch(aPredicateType) { case SQLFilterOperator::EQUAL: bResult = (nRes == 0); break; diff --git a/connectivity/source/drivers/postgresql/pq_tools.cxx b/connectivity/source/drivers/postgresql/pq_tools.cxx index 4d75e8c3bc57..ae9b304ad2af 100644 --- a/connectivity/source/drivers/postgresql/pq_tools.cxx +++ b/connectivity/source/drivers/postgresql/pq_tools.cxx @@ -769,9 +769,7 @@ OString extractSingleTableFromSelect( const OStringVector &vec ) token ++; } - if( token < vec.size() && rtl_str_compare_WithLength( - vec[token].getStr(), vec[token].getLength(), - RTL_CONSTASCII_STRINGPARAM("(") ) ) + if( token < vec.size() && vec[token] == "(" ) { // it is a table or a function name OStringBuffer buf(128); @@ -783,9 +781,7 @@ OString extractSingleTableFromSelect( const OStringVector &vec ) if( token < vec.size() ) { - if( rtl_str_compare_WithLength( - vec[token].getStr(), vec[token].getLength(), - RTL_CONSTASCII_STRINGPARAM( "." ) ) == 0 ) + if( vec[token] == "." ) { buf.append( vec[token] ); token ++; @@ -803,9 +799,7 @@ OString extractSingleTableFromSelect( const OStringVector &vec ) ret = buf.makeStringAndClear(); // now got my table candidate - if( token < vec.size() && rtl_str_compare_WithLength( - vec[token].getStr(), vec[token].getLength(), - RTL_CONSTASCII_STRINGPARAM( "(" ) ) == 0 ) + if( token < vec.size() && vec[token] == "(" ) { // whoops, it is a function ret.clear(); @@ -823,9 +817,7 @@ OString extractSingleTableFromSelect( const OStringVector &vec ) if( token < vec.size() ) { - if( rtl_str_compare_WithLength( - vec[token].getStr(), vec[token].getLength(), - RTL_CONSTASCII_STRINGPARAM( "," ) ) == 0 ) + if( vec[token] == "," ) { // whoops, multiple tables are used ret.clear(); -- cgit