diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-04-10 20:17:54 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-04-11 14:45:38 +0200 |
commit | 85c2ed8dc790689ce69ff0a08ff5a4de98df54b7 (patch) | |
tree | f7d7f6fce51d1a4443608971da7d9c42b1201fa3 /sw/source/ui/fldui/flddok.cxx | |
parent | 117688bd3f51a7a50b2620aa7dcc0c065f29d402 (diff) |
loplugin:stringview add check for getToken().toInt32
where we can convert that to
o3tl::toInt32(o3tl::getToken(
and avoid the heap allocation of a temporary string
Change-Id: Ib11c19c6e6cdc0de3e551affd3578d181e292de4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132810
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw/source/ui/fldui/flddok.cxx')
-rw-r--r-- | sw/source/ui/fldui/flddok.cxx | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sw/source/ui/fldui/flddok.cxx b/sw/source/ui/fldui/flddok.cxx index 4546dfd34ded..25e77775a2ba 100644 --- a/sw/source/ui/fldui/flddok.cxx +++ b/sw/source/ui/fldui/flddok.cxx @@ -26,6 +26,7 @@ #include <wrtsh.hxx> #include <svl/numformat.hxx> #include <svl/zformat.hxx> +#include <o3tl/string_view.hxx> #define USER_DATA_VERSION_1 "1" #define USER_DATA_VERSION USER_DATA_VERSION_1 @@ -155,7 +156,7 @@ void SwFieldDokPage::Reset(const SfxItemSet* ) sal_Int32 nIdx{ 0 }; if (sUserData.getToken(0, ';', nIdx).equalsIgnoreAsciiCase(USER_DATA_VERSION_1)) { - const sal_uInt16 nVal = static_cast< sal_uInt16 >(sUserData.getToken(0, ';', nIdx).toInt32()); + const sal_uInt16 nVal = static_cast< sal_uInt16 >(o3tl::toInt32(o3tl::getToken(sUserData, 0, ';', nIdx))); if(nVal != USHRT_MAX) { for (int i = 0, nEntryCount = m_xTypeLB->n_children(); i < nEntryCount; i++) |