summaryrefslogtreecommitdiffstats
path: root/connectivity/source
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2017-05-28 19:41:52 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-08-17 11:55:13 +0200
commit9881bea8d41997fb46579eb5f0314300159c96cc (patch)
treef52daa7055d2d28959e2d1ad576d963b7c0d3b2d /connectivity/source
parentEPUB export: use real chapter names (diff)
downloadcore-9881bea8d41997fb46579eb5f0314300159c96cc.tar.gz
core-9881bea8d41997fb46579eb5f0314300159c96cc.zip
remove unnecessary use of OUString::getStr
Change-Id: I3d13e1c0bb6aa4a7aacc463198747c1368ebc9b4 Reviewed-on: https://gerrit.libreoffice.org/38114 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'connectivity/source')
-rw-r--r--connectivity/source/commontools/FValue.cxx4
-rw-r--r--connectivity/source/drivers/dbase/DTable.cxx2
-rw-r--r--connectivity/source/drivers/odbc/OConnection.cxx4
-rw-r--r--connectivity/source/drivers/odbc/ODatabaseMetaDataResultSet.cxx2
-rw-r--r--connectivity/source/drivers/odbc/OResultSet.cxx8
5 files changed, 9 insertions, 11 deletions
diff --git a/connectivity/source/commontools/FValue.cxx b/connectivity/source/commontools/FValue.cxx
index 55b639eab9d6..9bd18eef6df6 100644
--- a/connectivity/source/commontools/FValue.cxx
+++ b/connectivity/source/commontools/FValue.cxx
@@ -1867,8 +1867,8 @@ Sequence<sal_Int8> ORowSetValue::getSequence() const
case DataType::VARCHAR:
case DataType::LONGVARCHAR:
{
- OUString sVal(m_aValue.m_pString);
- aSeq = Sequence<sal_Int8>(reinterpret_cast<const sal_Int8*>(sVal.getStr()),sizeof(sal_Unicode)*sVal.getLength());
+ aSeq = Sequence<sal_Int8>(reinterpret_cast<const sal_Int8*>(m_aValue.m_pString->buffer),
+ sizeof(sal_Unicode) * m_aValue.m_pString->length);
}
break;
case DataType::BINARY:
diff --git a/connectivity/source/drivers/dbase/DTable.cxx b/connectivity/source/drivers/dbase/DTable.cxx
index 297c2933f122..8f8f0f0543dc 100644
--- a/connectivity/source/drivers/dbase/DTable.cxx
+++ b/connectivity/source/drivers/dbase/DTable.cxx
@@ -1006,7 +1006,7 @@ bool ODbaseTable::CreateImpl()
if ( aIdent.lastIndexOf('/') != (aIdent.getLength()-1) )
aIdent += "/";
aIdent += m_Name;
- aName = aIdent.getStr();
+ aName = aIdent;
}
aURL.SetURL(aName);
diff --git a/connectivity/source/drivers/odbc/OConnection.cxx b/connectivity/source/drivers/odbc/OConnection.cxx
index eac88ca27899..711fc1b96a5b 100644
--- a/connectivity/source/drivers/odbc/OConnection.cxx
+++ b/connectivity/source/drivers/odbc/OConnection.cxx
@@ -297,7 +297,7 @@ OUString SAL_CALL OConnection::nativeSQL( const OUString& sql )
{
::osl::MutexGuard aGuard( m_aMutex );
- OString aSql(OUStringToOString(sql.getStr(),getTextEncoding()));
+ OString aSql(OUStringToOString(sql,getTextEncoding()));
char pOut[2048];
SQLINTEGER nOutLen;
OTools::ThrowException(this,N3SQLNativeSql(m_aConnectionHandle,reinterpret_cast<SDB_ODBC_CHAR *>(const_cast<char *>(aSql.getStr())),aSql.getLength(),reinterpret_cast<SDB_ODBC_CHAR*>(pOut),sizeof pOut - 1,&nOutLen),m_aConnectionHandle,SQL_HANDLE_DBC,*this);
@@ -391,7 +391,7 @@ void SAL_CALL OConnection::setCatalog( const OUString& catalog )
checkDisposed(OConnection_BASE::rBHelper.bDisposed);
- OString aCat(OUStringToOString(catalog.getStr(),getTextEncoding()));
+ OString aCat(OUStringToOString(catalog,getTextEncoding()));
OTools::ThrowException(this,
N3SQLSetConnectAttr(m_aConnectionHandle,SQL_ATTR_CURRENT_CATALOG,const_cast<char *>(aCat.getStr()),SQL_NTS),
m_aConnectionHandle,SQL_HANDLE_DBC,*this);
diff --git a/connectivity/source/drivers/odbc/ODatabaseMetaDataResultSet.cxx b/connectivity/source/drivers/odbc/ODatabaseMetaDataResultSet.cxx
index e52999a2a007..a5ee72690dde 100644
--- a/connectivity/source/drivers/odbc/ODatabaseMetaDataResultSet.cxx
+++ b/connectivity/source/drivers/odbc/ODatabaseMetaDataResultSet.cxx
@@ -252,7 +252,7 @@ Sequence< sal_Int8 > SAL_CALL ODatabaseMetaDataResultSet::getBytes( sal_Int32 co
case DataType::VARCHAR:
case DataType::LONGVARCHAR:
{
- OUString aRet = OTools::getStringValue(m_pConnection.get(),m_aStatementHandle,columnIndex,SQL_C_BINARY,m_bWasNull,**this,m_nTextEncoding);
+ OUString const & aRet = OTools::getStringValue(m_pConnection.get(),m_aStatementHandle,columnIndex,SQL_C_BINARY,m_bWasNull,**this,m_nTextEncoding);
return Sequence<sal_Int8>(reinterpret_cast<const sal_Int8*>(aRet.getStr()),sizeof(sal_Unicode)*aRet.getLength());
}
}
diff --git a/connectivity/source/drivers/odbc/OResultSet.cxx b/connectivity/source/drivers/odbc/OResultSet.cxx
index dec1e86ef635..b9089952dd6a 100644
--- a/connectivity/source/drivers/odbc/OResultSet.cxx
+++ b/connectivity/source/drivers/odbc/OResultSet.cxx
@@ -481,8 +481,7 @@ Sequence< sal_Int8 > SAL_CALL OResultSet::getBytes( sal_Int32 columnIndex )
break;
default:
{
- OUString sRet;
- sRet = m_aRow[columnIndex].getString();
+ OUString const & sRet = m_aRow[columnIndex].getString();
nRet = Sequence<sal_Int8>(reinterpret_cast<const sal_Int8*>(sRet.getStr()),sizeof(sal_Unicode)*sRet.getLength());
}
}
@@ -501,7 +500,7 @@ Sequence< sal_Int8 > OResultSet::impl_getBytes( sal_Int32 columnIndex )
case SQL_CHAR:
case SQL_LONGVARCHAR:
{
- OUString aRet = OTools::getStringValue(m_pStatement->getOwnConnection(),m_aStatementHandle,columnIndex,nColumnType,m_bWasNull,**this,m_nTextEncoding);
+ OUString const & aRet = OTools::getStringValue(m_pStatement->getOwnConnection(),m_aStatementHandle,columnIndex,nColumnType,m_bWasNull,**this,m_nTextEncoding);
return Sequence<sal_Int8>(reinterpret_cast<const sal_Int8*>(aRet.getStr()),sizeof(sal_Unicode)*aRet.getLength());
}
default:
@@ -1787,8 +1786,7 @@ void OResultSet::fillNeededData(SQLRETURN _nRet)
break;
case SQL_WLONGVARCHAR:
{
- OUString sRet;
- sRet = m_aRow[nColumnIndex].getString();
+ OUString const & sRet = m_aRow[nColumnIndex].getString();
N3SQLPutData (m_aStatementHandle, static_cast<SQLPOINTER>(const_cast<sal_Unicode *>(sRet.getStr())), sizeof(sal_Unicode)*sRet.getLength());
break;
}