From 3a88b513fd90f4793b6de7a7412fa33369542f40 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Thu, 7 Apr 2022 10:46:26 +0200 Subject: loplugin:stringviewparam convert methods using trim for which we add a new o3tl::trim method Change-Id: I9d37b6264eea106aa2f3502bd24b8cccf7850938 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132658 Tested-by: Jenkins Reviewed-by: Noel Grandin --- connectivity/source/drivers/firebird/Util.cxx | 9 +++++---- connectivity/source/drivers/firebird/Util.hxx | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) (limited to 'connectivity/source/drivers') diff --git a/connectivity/source/drivers/firebird/Util.cxx b/connectivity/source/drivers/firebird/Util.cxx index 344c0164ac66..c015f2d47d14 100644 --- a/connectivity/source/drivers/firebird/Util.cxx +++ b/connectivity/source/drivers/firebird/Util.cxx @@ -13,6 +13,7 @@ #include #include +#include using namespace ::connectivity; @@ -22,12 +23,12 @@ using namespace ::com::sun::star::uno; using namespace firebird; -OUString firebird::sanitizeIdentifier(const OUString& rIdentifier) +OUString firebird::sanitizeIdentifier(std::u16string_view rIdentifier) { - OUString sRet = rIdentifier.trim(); - assert(sRet.getLength() <= 31); // Firebird identifiers cannot be longer than this. + std::u16string_view sRet = o3tl::trim(rIdentifier); + assert(sRet.size() <= 31); // Firebird identifiers cannot be longer than this. - return sRet; + return OUString(sRet); } OUString firebird::StatusVectorToString(const ISC_STATUS_ARRAY& rStatusVector, diff --git a/connectivity/source/drivers/firebird/Util.hxx b/connectivity/source/drivers/firebird/Util.hxx index 46fadebb1a20..bf1a172ed2c8 100644 --- a/connectivity/source/drivers/firebird/Util.hxx +++ b/connectivity/source/drivers/firebird/Util.hxx @@ -86,7 +86,7 @@ public: * for such shorter strings, however any trailing padding makes the gui * editing of such names harder, hence we remove all trailing whitespace. */ - OUString sanitizeIdentifier(const OUString& rIdentifier); + OUString sanitizeIdentifier(std::u16string_view rIdentifier); inline bool IndicatesError(const ISC_STATUS_ARRAY& rStatusVector) { -- cgit