summaryrefslogtreecommitdiff
path: root/sd
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 /sd
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 'sd')
-rw-r--r--sd/source/ui/dlg/copydlg.cxx13
1 files changed, 7 insertions, 6 deletions
diff --git a/sd/source/ui/dlg/copydlg.cxx b/sd/source/ui/dlg/copydlg.cxx
index eedae722a5a4..66a13be8ed74 100644
--- a/sd/source/ui/dlg/copydlg.cxx
+++ b/sd/source/ui/dlg/copydlg.cxx
@@ -27,6 +27,7 @@
#include <unotools/viewoptions.hxx>
#include <svtools/unitconv.hxx>
+#include <o3tl/string_view.hxx>
#include <sdattr.hrc>
#include <View.hxx>
@@ -162,12 +163,12 @@ void CopyDlg::Reset()
else
{
sal_Int32 nIdx {0};
- m_xNumFldCopies->set_value(aStr.getToken(0, TOKEN, nIdx).toInt64());
- m_xMtrFldMoveX->set_value(aStr.getToken(0, TOKEN, nIdx).toInt64(), FieldUnit::NONE);
- m_xMtrFldMoveY->set_value(aStr.getToken(0, TOKEN, nIdx).toInt64(), FieldUnit::NONE);
- m_xMtrFldAngle->set_value(aStr.getToken(0, TOKEN, nIdx).toInt64(), FieldUnit::NONE);
- m_xMtrFldWidth->set_value(aStr.getToken(0, TOKEN, nIdx).toInt64(), FieldUnit::NONE);
- m_xMtrFldHeight->set_value(aStr.getToken(0, TOKEN, nIdx).toInt64(), FieldUnit::NONE);
+ m_xNumFldCopies->set_value(o3tl::toInt64(o3tl::getToken(aStr, 0, TOKEN, nIdx)));
+ m_xMtrFldMoveX->set_value(o3tl::toInt64(o3tl::getToken(aStr, 0, TOKEN, nIdx)), FieldUnit::NONE);
+ m_xMtrFldMoveY->set_value(o3tl::toInt64(o3tl::getToken(aStr, 0, TOKEN, nIdx)), FieldUnit::NONE);
+ m_xMtrFldAngle->set_value(o3tl::toInt64(o3tl::getToken(aStr, 0, TOKEN, nIdx)), FieldUnit::NONE);
+ m_xMtrFldWidth->set_value(o3tl::toInt64(o3tl::getToken(aStr, 0, TOKEN, nIdx)), FieldUnit::NONE);
+ m_xMtrFldHeight->set_value(o3tl::toInt64(o3tl::getToken(aStr, 0, TOKEN, nIdx)), FieldUnit::NONE);
m_xLbStartColor->SelectEntry( Color( ColorTransparency, aStr.getToken(0, TOKEN, nIdx).toUInt32() ) );
m_xLbEndColor->SelectEntry( Color( ColorTransparency, aStr.getToken(0, TOKEN, nIdx).toUInt32() ) );
}