diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-09-28 16:12:45 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-09-29 10:08:42 +0200 |
commit | 6c2ec9794db85a4ff2de71c7f50587c4fd7ac703 (patch) | |
tree | e5a6b1e3ca747811f9b89724d0caddcaa4ab716d /writerfilter/source/rtftok/rtfdocumentimpl.cxx | |
parent | 4b95451f859bac8e05956ce12df17f1ee410032d (diff) |
use more string_view in writerfilter
Change-Id: Idd4582138e8da9cc60e0a728bdea5542a509a4f8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140711
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'writerfilter/source/rtftok/rtfdocumentimpl.cxx')
-rw-r--r-- | writerfilter/source/rtftok/rtfdocumentimpl.cxx | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx index 3df44f0124c9..7fa664ea26b1 100644 --- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx +++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx @@ -58,20 +58,20 @@ using namespace com::sun::star; namespace { /// Returns an util::DateTime from a 'YYYY. MM. DD.' string. -util::DateTime getDateTimeFromUserProp(const OUString& rString) +util::DateTime getDateTimeFromUserProp(std::u16string_view rString) { util::DateTime aRet; - sal_Int32 nLen = rString.getLength(); + size_t nLen = rString.size(); if (nLen >= 4) { - aRet.Year = o3tl::toInt32(rString.subView(0, 4)); + aRet.Year = o3tl::toInt32(rString.substr(0, 4)); - if (nLen >= 8 && rString.match(". ", 4)) + if (nLen >= 8 && o3tl::starts_with(rString.substr(4), u". ")) { - aRet.Month = o3tl::toInt32(rString.subView(6, 2)); + aRet.Month = o3tl::toInt32(rString.substr(6, 2)); - if (nLen >= 12 && rString.match(". ", 8)) - aRet.Day = o3tl::toInt32(rString.subView(10, 2)); + if (nLen >= 12 && o3tl::starts_with(rString.substr(8), u". ")) + aRet.Day = o3tl::toInt32(rString.substr(10, 2)); } } return aRet; |