diff options
author | Noel <noel.grandin@collabora.co.uk> | 2021-01-28 20:29:16 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-01-29 09:25:12 +0100 |
commit | 1250aecd71fabde4dba990bfceb61bbe8e06b8ea (patch) | |
tree | 3c42ffdf68b7e81aba29228631a8cd34e2f11830 /connectivity | |
parent | 4f3987e0b1a995431478769c898b5ef151745254 (diff) |
loplugin:stringviewparam extend to new..
O[U]StringBuffer methods
Change-Id: I0ffbc33d54ae7c98b5652434f3370ee4f819f6f4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110090
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'connectivity')
-rw-r--r-- | connectivity/source/commontools/dbtools.cxx | 2 | ||||
-rw-r--r-- | connectivity/source/commontools/filtermanager.cxx | 2 | ||||
-rw-r--r-- | connectivity/source/drivers/firebird/Blob.cxx | 10 | ||||
-rw-r--r-- | connectivity/source/drivers/firebird/Connection.cxx | 18 | ||||
-rw-r--r-- | connectivity/source/drivers/firebird/PreparedStatement.cxx | 16 | ||||
-rw-r--r-- | connectivity/source/drivers/firebird/ResultSet.cxx | 2 | ||||
-rw-r--r-- | connectivity/source/drivers/firebird/StatementCommonBase.cxx | 14 | ||||
-rw-r--r-- | connectivity/source/drivers/firebird/Util.cxx | 4 | ||||
-rw-r--r-- | connectivity/source/drivers/firebird/Util.hxx | 4 | ||||
-rw-r--r-- | connectivity/source/drivers/hsqldb/HTools.cxx | 8 | ||||
-rw-r--r-- | connectivity/source/inc/hsqldb/HTools.hxx | 4 |
11 files changed, 42 insertions, 42 deletions
diff --git a/connectivity/source/commontools/dbtools.cxx b/connectivity/source/commontools/dbtools.cxx index cd9f2c9fc48f..31e54c1b0606 100644 --- a/connectivity/source/commontools/dbtools.cxx +++ b/connectivity/source/commontools/dbtools.cxx @@ -1908,7 +1908,7 @@ void setObjectWithInfo(const Reference<XParameters>& _xParams, } } -void getBooleanComparisonPredicate( const OUString& _rExpression, const bool _bValue, const sal_Int32 _nBooleanComparisonMode, +void getBooleanComparisonPredicate( std::u16string_view _rExpression, const bool _bValue, const sal_Int32 _nBooleanComparisonMode, OUStringBuffer& _out_rSQLPredicate ) { switch ( _nBooleanComparisonMode ) diff --git a/connectivity/source/commontools/filtermanager.cxx b/connectivity/source/commontools/filtermanager.cxx index a6180dd00666..ee39aa87830e 100644 --- a/connectivity/source/commontools/filtermanager.cxx +++ b/connectivity/source/commontools/filtermanager.cxx @@ -152,7 +152,7 @@ namespace dbtools } - void FilterManager::appendFilterComponent( OUStringBuffer& io_appendTo, const OUString& i_component ) + void FilterManager::appendFilterComponent( OUStringBuffer& io_appendTo, std::u16string_view i_component ) { if ( !io_appendTo.isEmpty() ) { diff --git a/connectivity/source/drivers/firebird/Blob.cxx b/connectivity/source/drivers/firebird/Blob.cxx index 8ed9fc4a8ac7..9cbc0a1b6d03 100644 --- a/connectivity/source/drivers/firebird/Blob.cxx +++ b/connectivity/source/drivers/firebird/Blob.cxx @@ -67,7 +67,7 @@ void Blob::ensureBlobIsOpened() nullptr); if (aErr) - evaluateStatusVector(m_statusVector, "isc_open_blob2", *this); + evaluateStatusVector(m_statusVector, u"isc_open_blob2", *this); m_bBlobOpened = true; m_nBlobPosition = 0; @@ -90,7 +90,7 @@ void Blob::ensureBlobIsOpened() aResultBuffer); if (aErr) - evaluateStatusVector(m_statusVector, "isc_blob_info", *this); + evaluateStatusVector(m_statusVector, u"isc_blob_info", *this); char* pIt = aResultBuffer; while( *pIt != isc_info_end ) // info is in clusters @@ -141,7 +141,7 @@ bool Blob::readOneSegment(uno::Sequence< sal_Int8 >& rDataOut) if (aRet && aRet != isc_segstr_eof && IndicatesError(m_statusVector)) { - OUString sError(StatusVectorToString(m_statusVector, "isc_get_segment")); + OUString sError(StatusVectorToString(m_statusVector, u"isc_get_segment")); throw IOException(sError, *this); } m_nBlobPosition += nActualSize; @@ -160,7 +160,7 @@ void Blob::closeBlob() aErr = isc_close_blob(m_statusVector, &m_blobHandle); if (aErr) - evaluateStatusVector(m_statusVector, "isc_close_blob", *this); + evaluateStatusVector(m_statusVector, u"isc_close_blob", *this); m_bBlobOpened = false; #if SAL_TYPES_SIZEOFPOINTER == 8 @@ -299,7 +299,7 @@ sal_Int32 SAL_CALL Blob::readBytes(uno::Sequence< sal_Int8 >& rDataOut, reinterpret_cast<char*>(rDataOut.getArray()) + nTotalBytesRead); if (aErr && IndicatesError(m_statusVector)) { - OUString sError(StatusVectorToString(m_statusVector, "isc_get_segment")); + OUString sError(StatusVectorToString(m_statusVector, u"isc_get_segment")); throw IOException(sError, *this); } nTotalBytesRead += nBytesRead; diff --git a/connectivity/source/drivers/firebird/Connection.cxx b/connectivity/source/drivers/firebird/Connection.cxx index 05c24e9f73be..6ec8940cd8a4 100644 --- a/connectivity/source/drivers/firebird/Connection.cxx +++ b/connectivity/source/drivers/firebird/Connection.cxx @@ -274,7 +274,7 @@ void Connection::construct(const OUString& url, const Sequence< PropertyValue >& 0); if (aErr) { - evaluateStatusVector(status, "isc_create_database", *this); + evaluateStatusVector(status, u"isc_create_database", *this); } } else @@ -292,7 +292,7 @@ void Connection::construct(const OUString& url, const Sequence< PropertyValue >& dpbBuffer.c_str()); if (aErr) { - evaluateStatusVector(status, "isc_attach_database", *this); + evaluateStatusVector(status, u"isc_attach_database", *this); } } @@ -490,7 +490,7 @@ void Connection::setupTransaction() aTPB); evaluateStatusVector(status_vector, - "isc_start_transaction", + u"isc_start_transaction", *this); } @@ -516,7 +516,7 @@ void SAL_CALL Connection::commit() disposeStatements(); isc_commit_transaction(status_vector, &m_aTransactionHandle); evaluateStatusVector(status_vector, - "isc_commit_transaction", + u"isc_commit_transaction", *this); } } @@ -569,7 +569,7 @@ isc_svc_handle Connection::attachServiceManager() aSPBBuffer)) { evaluateStatusVector(aStatusVector, - "isc_service_attach", + u"isc_service_attach", *this); } @@ -583,7 +583,7 @@ void Connection::detachServiceManager(isc_svc_handle aServiceHandle) &aServiceHandle)) { evaluateStatusVector(aStatusVector, - "isc_service_detach", + u"isc_service_detach", *this); } } @@ -642,7 +642,7 @@ void Connection::runBackupService(const short nAction) aRequest.getLength(), aRequest.getStr())) { - evaluateStatusVector(aStatusVector, "isc_service_start", *this); + evaluateStatusVector(aStatusVector, u"isc_service_start", *this); } char aInfoSPB = isc_info_svc_line; @@ -658,7 +658,7 @@ void Connection::runBackupService(const short nAction) sizeof(aResults), aResults)) { - evaluateStatusVector(aStatusVector, "isc_service_query", *this); + evaluateStatusVector(aStatusVector, u"isc_service_query", *this); } detachServiceManager(aServiceHandle); @@ -911,7 +911,7 @@ void Connection::disposing() { if (isc_detach_database(status, &m_aDBHandle)) { - evaluateStatusVector(status, "isc_detach_database", *this); + evaluateStatusVector(status, u"isc_detach_database", *this); } } // TODO: write to storage again? diff --git a/connectivity/source/drivers/firebird/PreparedStatement.cxx b/connectivity/source/drivers/firebird/PreparedStatement.cxx index 56fa1827bdad..3f7859d1dba7 100644 --- a/connectivity/source/drivers/firebird/PreparedStatement.cxx +++ b/connectivity/source/drivers/firebird/PreparedStatement.cxx @@ -307,7 +307,7 @@ sal_Bool SAL_CALL OPreparedStatement::execute() // Do not throw error. Trying to close a closed cursor is not a // critical mistake. OUString sErrMsg = StatusVectorToString(m_statusVector, - "isc_dsql_free_statement: close cursor"); + u"isc_dsql_free_statement: close cursor"); SAL_WARN("connectivity.firebird", sErrMsg); } } @@ -320,7 +320,7 @@ sal_Bool SAL_CALL OPreparedStatement::execute() if (aErr) { SAL_WARN("connectivity.firebird", "isc_dsql_execute failed" ); - evaluateStatusVector(m_statusVector, "isc_dsql_execute", *this); + evaluateStatusVector(m_statusVector, u"isc_dsql_execute", *this); } m_xResultSet = new OResultSet(m_pConnection.get(), @@ -565,7 +565,7 @@ void OPreparedStatement::openBlobForWriting(isc_blob_handle& rBlobHandle, ISC_QU if (aErr) { evaluateStatusVector(m_statusVector, - "setBlob failed on " + m_sSqlStatement, + OUString("setBlob failed on " + m_sSqlStatement), *this); assert(false); } @@ -580,7 +580,7 @@ void OPreparedStatement::closeBlobAfterWriting(isc_blob_handle& rBlobHandle) if (aErr) { evaluateStatusVector(m_statusVector, - "isc_close_blob failed", + u"isc_close_blob failed", *this); assert(false); } @@ -632,7 +632,7 @@ void SAL_CALL OPreparedStatement::setClob(sal_Int32 nParameterIndex, const Refer if (aErr) { evaluateStatusVector(m_statusVector, - "isc_put_segment failed", + u"isc_put_segment failed", *this); assert(false); } @@ -670,7 +670,7 @@ void OPreparedStatement::setClob( sal_Int32 nParameterIndex, const OUString& rSt if (aErr) { evaluateStatusVector(m_statusVector, - "isc_put_segment failed", + u"isc_put_segment failed", *this); assert(false); } @@ -722,7 +722,7 @@ void SAL_CALL OPreparedStatement::setBlob(sal_Int32 nParameterIndex, if (aErr) { evaluateStatusVector(m_statusVector, - "isc_put_segment failed", + u"isc_put_segment failed", *this); assert(false); } @@ -890,7 +890,7 @@ void SAL_CALL OPreparedStatement::setBytes(sal_Int32 nParameterIndex, if (aErr) { evaluateStatusVector(m_statusVector, - "isc_put_segment failed", + u"isc_put_segment failed", *this); assert(false); } diff --git a/connectivity/source/drivers/firebird/ResultSet.cxx b/connectivity/source/drivers/firebird/ResultSet.cxx index 7ae77c607e0d..975d5c13ce97 100644 --- a/connectivity/source/drivers/firebird/ResultSet.cxx +++ b/connectivity/source/drivers/firebird/ResultSet.cxx @@ -144,7 +144,7 @@ sal_Bool SAL_CALL OResultSet::next() { SAL_WARN("connectivity.firebird", "Error when fetching data"); // Throws sql exception as appropriate - evaluateStatusVector(m_statusVector, "isc_dsql_fetch", *this); + evaluateStatusVector(m_statusVector, u"isc_dsql_fetch", *this); return false; } } diff --git a/connectivity/source/drivers/firebird/StatementCommonBase.cxx b/connectivity/source/drivers/firebird/StatementCommonBase.cxx index 1d7d5ef32bdf..3f44dcd3587b 100644 --- a/connectivity/source/drivers/firebird/StatementCommonBase.cxx +++ b/connectivity/source/drivers/firebird/StatementCommonBase.cxx @@ -78,7 +78,7 @@ void OStatementCommonBase::freeStatementHandle() &m_aStatementHandle, DSQL_drop); evaluateStatusVector(m_statusVector, - "isc_dsql_free_statement", + u"isc_dsql_free_statement", *this); } } @@ -146,7 +146,7 @@ void OStatementCommonBase::prepareAndDescribeStatement(std::u16string_view sql, if (aErr) { evaluateStatusVector(m_statusVector, - "isc_dsql_allocate_statement", + u"isc_dsql_allocate_statement", *this); } else @@ -162,7 +162,7 @@ void OStatementCommonBase::prepareAndDescribeStatement(std::u16string_view sql, if (aErr) { evaluateStatusVector(m_statusVector, - "isc_dsql_prepare", + u"isc_dsql_prepare", *this); } else @@ -176,7 +176,7 @@ void OStatementCommonBase::prepareAndDescribeStatement(std::u16string_view sql, { // TODO: free statement handle, etc.? evaluateStatusVector(m_statusVector, - "isc_dsql_describe", + u"isc_dsql_describe", *this); } else @@ -199,7 +199,7 @@ void OStatementCommonBase::prepareAndDescribeStatement(std::u16string_view sql, if (aErr) { evaluateStatusVector(m_statusVector, - "isc_dsql_describe", + u"isc_dsql_describe", *this); } else @@ -379,7 +379,7 @@ short OStatementCommonBase::getSqlInfoItem(char aInfoItem) } evaluateStatusVector(aStatusVector, - "isc_dsq_sql_info", + u"isc_dsq_sql_info", *this); return 0; } @@ -411,7 +411,7 @@ sal_Int32 OStatementCommonBase::getStatementChangeCount() if (aErr) { evaluateStatusVector(aStatusVector, - "isc_dsq_sql_info", + u"isc_dsq_sql_info", *this); return 0; } diff --git a/connectivity/source/drivers/firebird/Util.cxx b/connectivity/source/drivers/firebird/Util.cxx index 82d69a123c97..3bf3cfbc4d82 100644 --- a/connectivity/source/drivers/firebird/Util.cxx +++ b/connectivity/source/drivers/firebird/Util.cxx @@ -31,7 +31,7 @@ OUString firebird::sanitizeIdentifier(const OUString& rIdentifier) } OUString firebird::StatusVectorToString(const ISC_STATUS_ARRAY& rStatusVector, - const OUString& rCause) + std::u16string_view rCause) { OUStringBuffer buf; const ISC_STATUS* pStatus = reinterpret_cast<const ISC_STATUS*>(&rStatusVector); @@ -59,7 +59,7 @@ OUString firebird::StatusVectorToString(const ISC_STATUS_ARRAY& rStatusVector, } void firebird::evaluateStatusVector(const ISC_STATUS_ARRAY& rStatusVector, - const OUString& rCause, + std::u16string_view rCause, const uno::Reference< XInterface >& _rxContext) { if (IndicatesError(rStatusVector)) diff --git a/connectivity/source/drivers/firebird/Util.hxx b/connectivity/source/drivers/firebird/Util.hxx index efb222f3ff22..0724410165a2 100644 --- a/connectivity/source/drivers/firebird/Util.hxx +++ b/connectivity/source/drivers/firebird/Util.hxx @@ -95,7 +95,7 @@ public: } OUString StatusVectorToString(const ISC_STATUS_ARRAY& rStatusVector, - const OUString& rCause); + std::u16string_view rCause); /** * Evaluate a firebird status vector and throw exceptions as necessary. @@ -104,7 +104,7 @@ public: * @throws css::sdbc::SQLException */ void evaluateStatusVector(const ISC_STATUS_ARRAY& rStatusVector, - const OUString& aCause, + std::u16string_view aCause, const css::uno::Reference< css::uno::XInterface >& _rxContext); /** diff --git a/connectivity/source/drivers/hsqldb/HTools.cxx b/connectivity/source/drivers/hsqldb/HTools.cxx index b9854c01ce67..3dd388aceecb 100644 --- a/connectivity/source/drivers/hsqldb/HTools.cxx +++ b/connectivity/source/drivers/hsqldb/HTools.cxx @@ -23,18 +23,18 @@ namespace connectivity::hsqldb { - void HTools::appendTableFilterCrit( OUStringBuffer& _inout_rBuffer, const OUString& _rCatalog, - const OUString& _rSchema, const OUString& _rName, bool _bShortForm ) + void HTools::appendTableFilterCrit( OUStringBuffer& _inout_rBuffer, std::u16string_view _rCatalog, + std::u16string_view _rSchema, std::u16string_view _rName, bool _bShortForm ) { _inout_rBuffer.append( " WHERE " ); - if ( !_rCatalog.isEmpty() ) + if ( !_rCatalog.empty() ) { _inout_rBuffer.appendAscii( _bShortForm ? "TABLE_CAT" : "TABLE_CATALOG" ); _inout_rBuffer.append( " = '" ); _inout_rBuffer.append ( _rCatalog ); _inout_rBuffer.append( "' AND " ); } - if ( !_rSchema.isEmpty() ) + if ( !_rSchema.empty() ) { _inout_rBuffer.appendAscii( _bShortForm ? "TABLE_SCHEM" : "TABLE_SCHEMA" ); _inout_rBuffer.append( " = '" ); diff --git a/connectivity/source/inc/hsqldb/HTools.hxx b/connectivity/source/inc/hsqldb/HTools.hxx index be30e8e281ee..4e7e542141e0 100644 --- a/connectivity/source/inc/hsqldb/HTools.hxx +++ b/connectivity/source/inc/hsqldb/HTools.hxx @@ -37,8 +37,8 @@ namespace connectivity::hsqldb have the short form (TABLE_CAT instead of TABLE_CATALOG, and so on) */ static void appendTableFilterCrit( - OUStringBuffer& _inout_rBuffer, const OUString& _rCatalog, - const OUString& _rSchema, const OUString& _rName, + OUStringBuffer& _inout_rBuffer, std::u16string_view _rCatalog, + std::u16string_view _rSchema, std::u16string_view _rName, bool _bShortForm ); }; |