summaryrefslogtreecommitdiff
path: root/dbaccess/source
diff options
context:
space:
mode:
authorNoel <noel.grandin@collabora.co.uk>2021-01-28 20:29:16 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-01-29 09:25:12 +0100
commit1250aecd71fabde4dba990bfceb61bbe8e06b8ea (patch)
tree3c42ffdf68b7e81aba29228631a8cd34e2f11830 /dbaccess/source
parent4f3987e0b1a995431478769c898b5ef151745254 (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 'dbaccess/source')
-rw-r--r--dbaccess/source/core/api/OptimisticSet.cxx2
-rw-r--r--dbaccess/source/core/api/SingleSelectQueryComposer.cxx6
-rw-r--r--dbaccess/source/core/recovery/settingsimport.cxx2
-rw-r--r--dbaccess/source/core/recovery/settingsimport.hxx2
-rw-r--r--dbaccess/source/filter/hsqldb/fbcreateparser.cxx14
-rw-r--r--dbaccess/source/filter/hsqldb/hsqlimport.cxx5
-rw-r--r--dbaccess/source/filter/hsqldb/hsqlimport.hxx2
7 files changed, 17 insertions, 16 deletions
diff --git a/dbaccess/source/core/api/OptimisticSet.cxx b/dbaccess/source/core/api/OptimisticSet.cxx
index 7db4ca08740b..ee05bd49d968 100644
--- a/dbaccess/source/core/api/OptimisticSet.cxx
+++ b/dbaccess/source/core/api/OptimisticSet.cxx
@@ -56,7 +56,7 @@ using namespace ::osl;
typedef std::map<OUString, OUStringBuffer> TSQLStatements;
namespace
{
- void lcl_fillKeyCondition(const OUString& i_sTableName,const OUString& i_sQuotedColumnName,const ORowSetValue& i_aValue,TSQLStatements& io_aKeyConditions)
+ void lcl_fillKeyCondition(const OUString& i_sTableName,std::u16string_view i_sQuotedColumnName,const ORowSetValue& i_aValue,TSQLStatements& io_aKeyConditions)
{
OUStringBuffer& rKeyCondition = io_aKeyConditions[i_sTableName];
if ( !rKeyCondition.isEmpty() )
diff --git a/dbaccess/source/core/api/SingleSelectQueryComposer.cxx b/dbaccess/source/core/api/SingleSelectQueryComposer.cxx
index f3f401b3cb99..6439941912dc 100644
--- a/dbaccess/source/core/api/SingleSelectQueryComposer.cxx
+++ b/dbaccess/source/core/api/SingleSelectQueryComposer.cxx
@@ -169,7 +169,7 @@ namespace
delete pSqlParseNode;
_rIterator.dispose();
}
- void lcl_addFilterCriteria_throw(sal_Int32 i_nFilterOperator,const OUString& i_sValue,OUStringBuffer& o_sRet)
+ void lcl_addFilterCriteria_throw(sal_Int32 i_nFilterOperator,std::u16string_view i_sValue,OUStringBuffer& o_sRet)
{
switch( i_nFilterOperator )
{
@@ -1647,7 +1647,7 @@ void OSingleSelectQueryComposer::setConditionByColumn( const Reference< XPropert
if ( nType != DataType::BOOLEAN && DataType::BIT != nType )
{
- lcl_addFilterCriteria_throw(filterOperator,"",aSQL);
+ lcl_addFilterCriteria_throw(filterOperator,u"",aSQL);
}
switch(nType)
@@ -1716,7 +1716,7 @@ void OSingleSelectQueryComposer::setConditionByColumn( const Reference< XPropert
sal_Int32 nFilterOp = filterOperator;
if ( filterOperator != SQLFilterOperator::SQLNULL && filterOperator != SQLFilterOperator::NOT_SQLNULL )
nFilterOp = SQLFilterOperator::SQLNULL;
- lcl_addFilterCriteria_throw(nFilterOp,"",aSQL);
+ lcl_addFilterCriteria_throw(nFilterOp,u"",aSQL);
}
// Attach filter
diff --git a/dbaccess/source/core/recovery/settingsimport.cxx b/dbaccess/source/core/recovery/settingsimport.cxx
index b64787aa82a4..2353202681c4 100644
--- a/dbaccess/source/core/recovery/settingsimport.cxx
+++ b/dbaccess/source/core/recovery/settingsimport.cxx
@@ -54,7 +54,7 @@ namespace dbaccess
{
}
- void SettingsImport::characters( const OUString& i_rCharacters )
+ void SettingsImport::characters( std::u16string_view i_rCharacters )
{
m_aCharacters.append( i_rCharacters );
}
diff --git a/dbaccess/source/core/recovery/settingsimport.hxx b/dbaccess/source/core/recovery/settingsimport.hxx
index 38bce0228e29..bc29bd727b8f 100644
--- a/dbaccess/source/core/recovery/settingsimport.hxx
+++ b/dbaccess/source/core/recovery/settingsimport.hxx
@@ -48,7 +48,7 @@ namespace dbaccess
const css::uno::Reference< css::xml::sax::XAttributeList >& i_rAttributes
);
virtual void endElement();
- void characters( const OUString& i_rCharacters );
+ void characters( std::u16string_view i_rCharacters );
protected:
virtual ~SettingsImport() override;
diff --git a/dbaccess/source/filter/hsqldb/fbcreateparser.cxx b/dbaccess/source/filter/hsqldb/fbcreateparser.cxx
index 4f8fb8667d1e..8ee1196a1618 100644
--- a/dbaccess/source/filter/hsqldb/fbcreateparser.cxx
+++ b/dbaccess/source/filter/hsqldb/fbcreateparser.cxx
@@ -29,7 +29,7 @@ using namespace css::sdbc;
namespace
{
-void lcl_appendWithSpace(OUStringBuffer& sBuff, const OUString& sStr)
+void lcl_appendWithSpace(OUStringBuffer& sBuff, std::u16string_view sStr)
{
sBuff.append(" ");
sBuff.append(sStr);
@@ -138,7 +138,7 @@ OUString FbCreateStmtParser::compose() const
sSql.append("CREATE TABLE ");
sSql.append(getTableName());
- lcl_appendWithSpace(sSql, "("); // column declaration
+ lcl_appendWithSpace(sSql, u"("); // column declaration
auto& rColumns = getColumnDef();
auto columnIter = rColumns.cbegin();
while (columnIter != rColumns.end())
@@ -178,7 +178,7 @@ OUString FbCreateStmtParser::compose() const
if (columnIter->isAutoIncremental())
{
- lcl_appendWithSpace(sSql, "GENERATED BY DEFAULT AS IDENTITY (START WITH ");
+ lcl_appendWithSpace(sSql, u"GENERATED BY DEFAULT AS IDENTITY (START WITH ");
// start with 0:
// HSQLDB: first value will be 0.
@@ -187,17 +187,17 @@ OUString FbCreateStmtParser::compose() const
sSql.append(")");
}
else if (!columnIter->isNullable())
- lcl_appendWithSpace(sSql, "NOT NULL");
+ lcl_appendWithSpace(sSql, u"NOT NULL");
if (columnIter->isCaseInsensitive())
- lcl_appendWithSpace(sSql, "COLLATE UNICODE_CI");
+ lcl_appendWithSpace(sSql, u"COLLATE UNICODE_CI");
const OUString& sDefaultVal = columnIter->getDefault();
if (!sDefaultVal.isEmpty())
{
- lcl_appendWithSpace(sSql, "DEFAULT");
+ lcl_appendWithSpace(sSql, u"DEFAULT");
if (sDefaultVal.equalsIgnoreAsciiCase("NOW"))
- lcl_appendWithSpace(sSql, "\'NOW\'"); // Fb likes it single quoted
+ lcl_appendWithSpace(sSql, u"\'NOW\'"); // Fb likes it single quoted
else
lcl_appendWithSpace(sSql, sDefaultVal);
}
diff --git a/dbaccess/source/filter/hsqldb/hsqlimport.cxx b/dbaccess/source/filter/hsqldb/hsqlimport.cxx
index f24ceb6f2ff0..045a32f93ce3 100644
--- a/dbaccess/source/filter/hsqldb/hsqlimport.cxx
+++ b/dbaccess/source/filter/hsqldb/hsqlimport.cxx
@@ -176,7 +176,7 @@ void lcl_setParams(const std::vector<Any>& row, Reference<XParameters> const& xP
}
}
-OUString lcl_createInsertStatement(const OUString& sTableName,
+OUString lcl_createInsertStatement(std::u16string_view sTableName,
const std::vector<dbahsql::ColumnDefinition>& rColTypes)
{
assert(rColTypes.size() > 0);
@@ -216,7 +216,8 @@ HsqlImporter::HsqlImporter(Reference<XConnection>& rConnection, const Reference<
m_xStorage.set(rStorage);
}
-void HsqlImporter::insertRow(const std::vector<css::uno::Any>& xRows, const OUString& sTableName,
+void HsqlImporter::insertRow(const std::vector<css::uno::Any>& xRows,
+ std::u16string_view sTableName,
const std::vector<ColumnDefinition>& rColTypes)
{
OUString sStatement = lcl_createInsertStatement(sTableName, rColTypes);
diff --git a/dbaccess/source/filter/hsqldb/hsqlimport.hxx b/dbaccess/source/filter/hsqldb/hsqlimport.hxx
index f414d327565d..7bab53c24b88 100644
--- a/dbaccess/source/filter/hsqldb/hsqlimport.hxx
+++ b/dbaccess/source/filter/hsqldb/hsqlimport.hxx
@@ -30,7 +30,7 @@ private:
css::uno::Reference<css::embed::XStorage> m_xStorage;
protected:
- void insertRow(const std::vector<css::uno::Any>& xRows, const OUString& sTable,
+ void insertRow(const std::vector<css::uno::Any>& xRows, std::u16string_view sTable,
const std::vector<ColumnDefinition>& rColTypes);
void processTree(HsqlBinaryNode& rNode, HsqlRowInputStream& rStream,
const std::vector<ColumnDefinition>& rColTypes, const OUString& sTableName,