diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-04-11 14:49:08 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-04-11 17:44:46 +0200 |
commit | 6fc3dfd3f1b5cb13101299df42444f2ff0493846 (patch) | |
tree | 404a816727baa934e77c6e474cc57e83a7aa2754 /connectivity | |
parent | 8cbb08de38fc1a2f9d2ea0dfbdc2be8e8110ff73 (diff) |
use more string_view
found by tweaking the loplugin:stringview and making it whitelist
getLength
Change-Id: Ic41cd4e3026d93b70a76fe1279c6de3abbe6b4a0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132820
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'connectivity')
-rw-r--r-- | connectivity/source/commontools/dbconversion.cxx | 4 | ||||
-rw-r--r-- | connectivity/source/parse/sqlnode.cxx | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/connectivity/source/commontools/dbconversion.cxx b/connectivity/source/commontools/dbconversion.cxx index 289eb0c2de3e..af80efb60eb1 100644 --- a/connectivity/source/commontools/dbconversion.cxx +++ b/connectivity/source/commontools/dbconversion.cxx @@ -441,7 +441,7 @@ namespace dbtools const sal_Unicode *const begin = p; while (rtl::isAsciiWhiteSpace(*p)) { ++p; } nSeparation += p - begin; - aTime = toTime( _sSQLString.copy( nSeparation ) ); + aTime = toTime( _sSQLString.subView( nSeparation ) ); } return css::util::DateTime(aTime.NanoSeconds, aTime.Seconds, aTime.Minutes, aTime.Hours, @@ -449,7 +449,7 @@ namespace dbtools } - css::util::Time DBTypeConversion::toTime(const OUString& _sSQLString) + css::util::Time DBTypeConversion::toTime(std::u16string_view _sSQLString) { css::util::Time aTime; ::utl::ISO8601parseTime(_sSQLString, aTime); diff --git a/connectivity/source/parse/sqlnode.cxx b/connectivity/source/parse/sqlnode.cxx index 23a46246278d..c121eb05b474 100644 --- a/connectivity/source/parse/sqlnode.cxx +++ b/connectivity/source/parse/sqlnode.cxx @@ -234,7 +234,7 @@ OUString OSQLParseNode::convertDateTimeString(const SQLParseNodeParameter& rPara } -OUString OSQLParseNode::convertTimeString(const SQLParseNodeParameter& rParam, const OUString& rString) +OUString OSQLParseNode::convertTimeString(const SQLParseNodeParameter& rParam, std::u16string_view rString) { css::util::Time aTime = DBTypeConversion::toTime(rString); Reference< XNumberFormatsSupplier > xSupplier(rParam.xFormatter->getNumberFormatsSupplier()); |