summaryrefslogtreecommitdiff
path: root/dbaccess/source
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2020-11-12 08:13:40 +0100
committerStephan Bergmann <sbergman@redhat.com>2020-11-12 16:53:30 +0100
commitf34ac579fac16fff37bf00fe85d43ad6b938eca7 (patch)
tree0747c4d86bbf40a5093fb7a3215dd52a8e8586b2 /dbaccess/source
parentc45753847dfc2b4645dc2f7500a18ec2c5d438df (diff)
New loplugin:stringviewparam
...to "Find functions that take rtl::O[U]String parameters that can be generalized to take std::[u16]string_view instead." (Which in turn can avoid costly O[U]String constructions, see e.g. loplugin:stringview and subView.) Some of those functions' call sites, passing plain char string literals, needed to be adapted when converting them. Change-Id: I644ab546d7a0ce9e470ab9b3196e3e60d1e812bc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105622 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'dbaccess/source')
-rw-r--r--dbaccess/source/ui/browser/genericcontroller.cxx2
-rw-r--r--dbaccess/source/ui/dlg/DbAdminImpl.cxx2
-rw-r--r--dbaccess/source/ui/inc/UITools.hxx3
-rw-r--r--dbaccess/source/ui/misc/UITools.cxx2
-rw-r--r--dbaccess/source/ui/misc/defaultobjectnamecheck.cxx3
5 files changed, 7 insertions, 5 deletions
diff --git a/dbaccess/source/ui/browser/genericcontroller.cxx b/dbaccess/source/ui/browser/genericcontroller.cxx
index 4c12a3ae7b51..bdc1876e9607 100644
--- a/dbaccess/source/ui/browser/genericcontroller.cxx
+++ b/dbaccess/source/ui/browser/genericcontroller.cxx
@@ -198,7 +198,7 @@ bool OGenericUnoController::Construct(vcl::Window* /*pParent*/)
{
SAL_WARN("dbaccess.ui","OGenericUnoController::Construct: could not create (or start listening at) the database context!");
// at least notify the user. Though the whole component does not make any sense without the database context ...
- ShowServiceNotAvailableError(getFrameWeld(), "com.sun.star.sdb.DatabaseContext", true);
+ ShowServiceNotAvailableError(getFrameWeld(), u"com.sun.star.sdb.DatabaseContext", true);
}
return true;
diff --git a/dbaccess/source/ui/dlg/DbAdminImpl.cxx b/dbaccess/source/ui/dlg/DbAdminImpl.cxx
index 2437196f14e3..2853110b1959 100644
--- a/dbaccess/source/ui/dlg/DbAdminImpl.cxx
+++ b/dbaccess/source/ui/dlg/DbAdminImpl.cxx
@@ -194,7 +194,7 @@ ODbDataSourceAdministrationHelper::ODbDataSourceAdministrationHelper(const Refer
}
catch(const Exception&)
{
- ShowServiceNotAvailableError(pTopParent, "com.sun.star.sdb.DatabaseContext", true);
+ ShowServiceNotAvailableError(pTopParent, u"com.sun.star.sdb.DatabaseContext", true);
}
}
diff --git a/dbaccess/source/ui/inc/UITools.hxx b/dbaccess/source/ui/inc/UITools.hxx
index c6fafa1b0926..190d5e192b2d 100644
--- a/dbaccess/source/ui/inc/UITools.hxx
+++ b/dbaccess/source/ui/inc/UITools.hxx
@@ -26,6 +26,7 @@
#include <connectivity/dbtools.hxx>
#include <memory>
+#include <string_view>
#define RET_ALL 100
@@ -309,7 +310,7 @@ namespace dbaui
@return
RET_YES, RET_NO, RET_ALL
*/
- sal_Int32 askForUserAction(weld::Window* pParent, const char* pTitle, const char* pText, bool bAll, const OUString& rName);
+ sal_Int32 askForUserAction(weld::Window* pParent, const char* pTitle, const char* pText, bool bAll, std::u16string_view rName);
/** creates a new view from a query or table
@param _sName
diff --git a/dbaccess/source/ui/misc/UITools.cxx b/dbaccess/source/ui/misc/UITools.cxx
index d75ea241ed95..5147ab3271df 100644
--- a/dbaccess/source/ui/misc/UITools.cxx
+++ b/dbaccess/source/ui/misc/UITools.cxx
@@ -1150,7 +1150,7 @@ TOTypeInfoSP queryTypeInfoByType(sal_Int32 _nDataType,const OTypeInfoMap& _rType
return pTypeInfo;
}
-sal_Int32 askForUserAction(weld::Window* pParent, const char* pTitle, const char* pText, bool _bAll, const OUString& _sName)
+sal_Int32 askForUserAction(weld::Window* pParent, const char* pTitle, const char* pText, bool _bAll, std::u16string_view _sName)
{
SolarMutexGuard aGuard;
OUString aMsg = DBA_RES(pText);
diff --git a/dbaccess/source/ui/misc/defaultobjectnamecheck.cxx b/dbaccess/source/ui/misc/defaultobjectnamecheck.cxx
index 34fac13d18d5..53ef26fa3284 100644
--- a/dbaccess/source/ui/misc/defaultobjectnamecheck.cxx
+++ b/dbaccess/source/ui/misc/defaultobjectnamecheck.cxx
@@ -36,6 +36,7 @@
#include <cppuhelper/exc_hlp.hxx>
#include <memory>
+#include <string_view>
namespace dbaui
{
@@ -57,7 +58,7 @@ namespace dbaui
// helper
namespace
{
- void lcl_fillNameExistsError( const OUString& _rObjectName, SQLExceptionInfo& _out_rErrorToDisplay )
+ void lcl_fillNameExistsError( std::u16string_view _rObjectName, SQLExceptionInfo& _out_rErrorToDisplay )
{
SQLException aError;
OUString sErrorMessage = DBA_RES(STR_NAMED_OBJECT_ALREADY_EXISTS);