diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-04-29 20:52:46 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-04-30 21:21:34 +0200 |
commit | fbff7af0a1a31e82c3a3eb6dac77d5a48ef3371d (patch) | |
tree | 2aad7e48c6f7a260e0c3ebf6799fbfb95bb6a210 /editeng | |
parent | 40077fe30919494f0ecd04c4620cac2334d3d382 (diff) |
split comphelper::string::strip functions into String and view version
which is more obvious, from the perspective of the caller, and lets us
avoid creating a new String if nothing needs to be stripped
Change-Id: I66a980eaf4aa818251bec49bdb16c2dddb0745e7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133657
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'editeng')
-rw-r--r-- | editeng/source/outliner/outliner.cxx | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/editeng/source/outliner/outliner.cxx b/editeng/source/outliner/outliner.cxx index 36d2f1ca6999..b885bbd310c2 100644 --- a/editeng/source/outliner/outliner.cxx +++ b/editeng/source/outliner/outliner.cxx @@ -47,6 +47,7 @@ #include <libxml/xmlwriter.h> #include <sal/log.hxx> #include <o3tl/safeint.hxx> +#include <o3tl/string_view.hxx> #include <osl/diagnose.h> #include <memory> @@ -523,8 +524,8 @@ bool Outliner::ImpConvertEdtToOut( sal_Int32 nPara ) } sal_Int32 nPos = nHeadingNumberStart ? nHeadingNumberStart : nNumberingNumberStart; - OUString aLevel = comphelper::string::stripStart(aName.subView(nPos), ' '); - nTabs = aLevel.toInt32(); + std::u16string_view aLevel = comphelper::string::stripStart(aName.subView(nPos), ' '); + nTabs = o3tl::toInt32(aLevel); if( nTabs ) nTabs--; // Level 0 = "heading 1" bConverted = true; |