summaryrefslogtreecommitdiff
path: root/dbaccess
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2020-12-09 22:42:32 +0100
committerStephan Bergmann <sbergman@redhat.com>2020-12-09 23:31:17 +0100
commitdf810a82058a07dd8b1c2268955d64328e53cf97 (patch)
tree060003d876f4aad232475144e1df1ca65d7cc7c5 /dbaccess
parentff8d82dc4cc0841f11ad6d51d3ed37450a6f6971 (diff)
Fix loplugin:stringviewparam handling of comparison operators
Change-Id: I58456efb9588b544d998ac6a4c27d55457280742 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107510 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'dbaccess')
-rw-r--r--dbaccess/source/ui/inc/RelationController.hxx4
-rw-r--r--dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx10
-rw-r--r--dbaccess/source/ui/querydesign/SelectionBrowseBox.hxx6
-rw-r--r--dbaccess/source/ui/relationdesign/RelationController.cxx2
4 files changed, 16 insertions, 6 deletions
diff --git a/dbaccess/source/ui/inc/RelationController.hxx b/dbaccess/source/ui/inc/RelationController.hxx
index ed3b2a8faf99..a457f38b8057 100644
--- a/dbaccess/source/ui/inc/RelationController.hxx
+++ b/dbaccess/source/ui/inc/RelationController.hxx
@@ -19,6 +19,8 @@
#pragma once
#include <memory>
+#include <string_view>
+
#include "JoinController.hxx"
namespace weld
@@ -43,7 +45,7 @@ namespace dbaui
virtual void Execute(sal_uInt16 nId, const css::uno::Sequence< css::beans::PropertyValue>& aArgs) override;
void loadData();
- TTableWindowData::value_type existsTable(const OUString& _rComposedTableName) const;
+ TTableWindowData::value_type existsTable(std::u16string_view _rComposedTableName) const;
// load the window positions out of the datasource
void loadLayoutInformation();
diff --git a/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx b/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx
index 3429f9843c65..1bcb127d9ba6 100644
--- a/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx
+++ b/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx
@@ -17,6 +17,10 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
+#include <sal/config.h>
+
+#include <string_view>
+
#include "SelectionBrowseBox.hxx"
#include <com/sun/star/sdbc/XDatabaseMetaData.hpp>
#include <com/sun/star/sdbc/DataType.hpp>
@@ -596,12 +600,12 @@ bool OSelectionBrowseBox::fillColumnRef(const OSQLParseNode* _pColumnRef, const
return fillColumnRef(sColumnName,sTableRange,_rxConnection->getMetaData(),_pEntry,_bListAction);
}
-bool OSelectionBrowseBox::fillColumnRef(const OUString& _sColumnName, const OUString& _sTableRange, const Reference<XDatabaseMetaData>& _xMetaData, OTableFieldDescRef const & _pEntry, bool& _bListAction)
+bool OSelectionBrowseBox::fillColumnRef(const OUString& _sColumnName, std::u16string_view _sTableRange, const Reference<XDatabaseMetaData>& _xMetaData, OTableFieldDescRef const & _pEntry, bool& _bListAction)
{
bool bError = false;
::comphelper::UStringMixEqual bCase(_xMetaData->supportsMixedCaseQuotedIdentifiers());
// check if the table name is the same
- if ( !_sTableRange.isEmpty() && (bCase(_pEntry->GetTable(),_sTableRange) || bCase(_pEntry->GetAlias(),_sTableRange)) )
+ if ( !_sTableRange.empty() && (bCase(_pEntry->GetTable(),_sTableRange) || bCase(_pEntry->GetAlias(),_sTableRange)) )
{ // a table was already inserted and the tables contains that column name
if ( !_pEntry->GetTabWindow() )
@@ -807,7 +811,7 @@ bool OSelectionBrowseBox::saveField(OUString& _sFieldName ,OTableFieldDescRef co
if ( nFunCount == 4 && SQL_ISRULE(pColumnRef->getChild(3),column_ref) )
bError = fillColumnRef( pColumnRef->getChild(3), xConnection, aSelEntry, _bListAction );
else if ( nFunCount == 3 ) // we have a COUNT(*) here, so take the first table
- bError = fillColumnRef( "*", OUString(), xMetaData, aSelEntry, _bListAction );
+ bError = fillColumnRef( "*", std::u16string_view(), xMetaData, aSelEntry, _bListAction );
else
{
nFunctionType |= FKT_NUMERIC;
diff --git a/dbaccess/source/ui/querydesign/SelectionBrowseBox.hxx b/dbaccess/source/ui/querydesign/SelectionBrowseBox.hxx
index c3cd5641d3e1..b156b721a421 100644
--- a/dbaccess/source/ui/querydesign/SelectionBrowseBox.hxx
+++ b/dbaccess/source/ui/querydesign/SelectionBrowseBox.hxx
@@ -18,6 +18,10 @@
*/
#pragma once
+#include <sal/config.h>
+
+#include <string_view>
+
#include <svtools/editbrowsebox.hxx>
#include <TableFieldDescription.hxx>
#include <TableWindowListBox.hxx>
@@ -268,7 +272,7 @@ namespace dbaui
OTableFieldDescRef const & _pEntry,
bool& _bListAction);
bool fillColumnRef( const OUString& _sColumnName,
- const OUString& _sTableRange,
+ std::u16string_view _sTableRange,
const css::uno::Reference< css::sdbc::XDatabaseMetaData >& _xMetaData,
OTableFieldDescRef const & _pEntry,
bool& _bListAction);
diff --git a/dbaccess/source/ui/relationdesign/RelationController.cxx b/dbaccess/source/ui/relationdesign/RelationController.cxx
index e16054f6b768..0750a77a01df 100644
--- a/dbaccess/source/ui/relationdesign/RelationController.cxx
+++ b/dbaccess/source/ui/relationdesign/RelationController.cxx
@@ -492,7 +492,7 @@ void ORelationController::loadData()
}
}
-TTableWindowData::value_type ORelationController::existsTable(const OUString& _rComposedTableName) const
+TTableWindowData::value_type ORelationController::existsTable(std::u16string_view _rComposedTableName) const
{
::comphelper::UStringMixEqual bCase(true);
for (auto const& elem : m_vTableData)