summaryrefslogtreecommitdiff
path: root/connectivity
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2022-04-07 10:46:26 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2022-04-08 10:26:10 +0200
commit3a88b513fd90f4793b6de7a7412fa33369542f40 (patch)
tree293467f4143a28a2a19f037f3215f4391794c854 /connectivity
parent388b4fc1085074da759903a9b1768bded43dd0d3 (diff)
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 <noel.grandin@collabora.co.uk>
Diffstat (limited to 'connectivity')
-rw-r--r--connectivity/source/drivers/firebird/Util.cxx9
-rw-r--r--connectivity/source/drivers/firebird/Util.hxx2
2 files changed, 6 insertions, 5 deletions
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 <com/sun/star/sdbc/DataType.hpp>
#include <com/sun/star/sdbc/SQLException.hpp>
+#include <o3tl/string_view.hxx>
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)
{