summaryrefslogtreecommitdiff
path: root/sdext/source/minimizer
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2022-04-10 20:17:54 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2022-04-11 14:45:38 +0200
commit85c2ed8dc790689ce69ff0a08ff5a4de98df54b7 (patch)
treef7d7f6fce51d1a4443608971da7d9c42b1201fa3 /sdext/source/minimizer
parent117688bd3f51a7a50b2620aa7dcc0c065f29d402 (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 'sdext/source/minimizer')
-rw-r--r--sdext/source/minimizer/optimizerdialogcontrols.cxx3
1 files changed, 2 insertions, 1 deletions
diff --git a/sdext/source/minimizer/optimizerdialogcontrols.cxx b/sdext/source/minimizer/optimizerdialogcontrols.cxx
index 8b98f2a5faaf..92ecf16e09e1 100644
--- a/sdext/source/minimizer/optimizerdialogcontrols.cxx
+++ b/sdext/source/minimizer/optimizerdialogcontrols.cxx
@@ -35,6 +35,7 @@
#include <com/sun/star/frame/XStorable.hpp>
#include <rtl/ustrbuf.hxx>
#include <sal/macros.h>
+#include <o3tl/string_view.hxx>
using namespace ::com::sun::star::awt;
using namespace ::com::sun::star::uno;
@@ -480,7 +481,7 @@ namespace
bool lcl_getResolutionText(OUString& rResolutionText, const OUString& rImageResolution, sal_Int32 nTargetRes)
{
sal_Int32 nIdx{ 0 };
- if (rImageResolution.getToken(0, ';', nIdx).toInt32()!=nTargetRes)
+ if (o3tl::toInt32(o3tl::getToken(rImageResolution, 0, ';', nIdx))!=nTargetRes)
return false;
rResolutionText = rImageResolution.getToken(0, ';', nIdx);
return true;