summaryrefslogtreecommitdiff
path: root/desktop/qa/desktop_lib
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 /desktop/qa/desktop_lib
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 'desktop/qa/desktop_lib')
-rw-r--r--desktop/qa/desktop_lib/test_desktop_lib.cxx7
1 files changed, 4 insertions, 3 deletions
diff --git a/desktop/qa/desktop_lib/test_desktop_lib.cxx b/desktop/qa/desktop_lib/test_desktop_lib.cxx
index 1d36f54f3ffc..1aff45ab0cde 100644
--- a/desktop/qa/desktop_lib/test_desktop_lib.cxx
+++ b/desktop/qa/desktop_lib/test_desktop_lib.cxx
@@ -55,6 +55,7 @@
#include <config_mpl.h>
#include <tools/json_writer.hxx>
#include <o3tl/unit_conversion.hxx>
+#include <o3tl/string_view.hxx>
#include <lib/init.hxx>
#include <svx/svxids.hrc>
@@ -860,7 +861,7 @@ void DesktopLOKTest::testRowColumnHeaders()
bool bNotEnoughHeaders = true;
for (const boost::property_tree::ptree::value_type& rValue : aTree.get_child("rows"))
{
- sal_Int32 nSize = OString(rValue.second.get<std::string>("size").c_str()).toInt32();
+ sal_Int32 nSize = o3tl::toInt32(rValue.second.get<std::string>("size"));
nSize = o3tl::convert(nSize, o3tl::Length::px, o3tl::Length::twip);
OString aText(rValue.second.get<std::string>("text").c_str());
@@ -889,7 +890,7 @@ void DesktopLOKTest::testRowColumnHeaders()
bNotEnoughHeaders = true;
for (const boost::property_tree::ptree::value_type& rValue : aTree.get_child("columns"))
{
- sal_Int32 nSize = OString(rValue.second.get<std::string>("size").c_str()).toInt32();
+ sal_Int32 nSize = o3tl::toInt32(rValue.second.get<std::string>("size"));
nSize = o3tl::convert(nSize, o3tl::Length::px, o3tl::Length::twip);
OString aText(rValue.second.get<std::string>("text").c_str());
if (bFirstHeader)
@@ -939,7 +940,7 @@ void DesktopLOKTest::testHiddenRowHeaders()
sal_Int32 nIndex = 0;
for (const boost::property_tree::ptree::value_type& rValue : aTree.get_child("rows"))
{
- sal_Int32 nSize = OString(rValue.second.get<std::string>("size").c_str()).toInt32();
+ sal_Int32 nSize = o3tl::toInt32(rValue.second.get<std::string>("size"));
if (nIndex++ == 2)
{