diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-04-29 11:06:33 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-05-01 08:30:18 +0200 |
commit | 5200a73627d13e2997f81b53f61e143e77e328ee (patch) | |
tree | f95c8346d061ecd0ad33d574895d18e169662785 /lotuswordpro | |
parent | b90d3d316dd9c720c83180b31f6bbd7003fead78 (diff) |
use more string_view in various
found by examining uses of OUString::copy() for likely places
Change-Id: I6ff20e7b273ad6005410b82719183c1122f8c018
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133617
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'lotuswordpro')
-rw-r--r-- | lotuswordpro/source/filter/lwpfribmark.cxx | 4 | ||||
-rw-r--r-- | lotuswordpro/source/filter/lwpmarker.cxx | 18 |
2 files changed, 11 insertions, 11 deletions
diff --git a/lotuswordpro/source/filter/lwpfribmark.cxx b/lotuswordpro/source/filter/lwpfribmark.cxx index eba748865d10..f29d4f4c3aeb 100644 --- a/lotuswordpro/source/filter/lwpfribmark.cxx +++ b/lotuswordpro/source/filter/lwpfribmark.cxx @@ -373,8 +373,8 @@ void LwpFribField::RegisterTimeField(const LwpFieldMark* pFieldMark) if (index < 0) return; - OUString tag = sFormula.copy(0, index); - if (tag == "Now()" || tag == "CreateDate" || tag == "EditDate") + std::u16string_view tag = sFormula.subView(0, index); + if (tag == u"Now()" || tag == u"CreateDate" || tag == u"EditDate") RegisterDateTimeStyle(sFormula.copy(index + 1)); } } diff --git a/lotuswordpro/source/filter/lwpmarker.cxx b/lotuswordpro/source/filter/lwpmarker.cxx index 86591fd8917e..e6b29c23c55c 100644 --- a/lotuswordpro/source/filter/lwpmarker.cxx +++ b/lotuswordpro/source/filter/lwpmarker.cxx @@ -429,27 +429,27 @@ bool LwpFieldMark::IsDateTimeField(sal_uInt8& type,OUString& formula) return false; } - OUString tag = sFormula.copy(0,index); - if (tag == "Now()") + std::u16string_view tag = sFormula.subView(0,index); + if (tag == u"Now()") { type = DATETIME_NOW; formula = sFormula.copy(index+1); return true; } - else if (tag == "CreateDate") + else if (tag == u"CreateDate") { type = DATETIME_CREATE; formula = sFormula.copy(index+1); return true; } - else if (tag == "EditDate") + else if (tag == u"EditDate") { type = DATETIME_LASTEDIT; formula = sFormula.copy(index+1); return true; } - else if (tag == "YesterdaysDate" || tag == "TomorrowsDate" - || tag == "TodaysDate") + else if (tag == u"YesterdaysDate" || tag == u"TomorrowsDate" + || tag == u"TodaysDate") { type = DATETIME_SKIP; return true; @@ -476,14 +476,14 @@ bool LwpFieldMark::IsCrossRefField(sal_uInt8& nType, OUString& sMarkName) return false; } - OUString tag = sFormula.copy(0,index); - if (tag == "PageRef") + std::u16string_view tag = sFormula.subView(0,index); + if (tag == u"PageRef") { sMarkName = sFormula.copy(index+1); nType = CROSSREF_PAGE; return true; } - else if (tag == "ParaRef") + else if (tag == u"ParaRef") { sMarkName = sFormula.copy(index+1); nType = CROSSREF_PARANUMBER; |