summaryrefslogtreecommitdiff
path: root/sdext/source/pdfimport
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2022-04-04 14:02:02 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2022-04-05 09:22:48 +0200
commit9b2ad2e29e69fa5b7561f738cc82e49268f2b4ec (patch)
tree4bf668dae5866506267c5ab13322c6f1da03a979 /sdext/source/pdfimport
parentabf73d576c10482a8e22cb0df3ab1520d751cbd7 (diff)
add some comphelper::string::toInt* functions for string_views
Change-Id: Icf42e00575edf8fc847bccf9c9505cd9710fc9b2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132509 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sdext/source/pdfimport')
-rw-r--r--sdext/source/pdfimport/wrapper/wrapper.cxx13
1 files changed, 4 insertions, 9 deletions
diff --git a/sdext/source/pdfimport/wrapper/wrapper.cxx b/sdext/source/pdfimport/wrapper/wrapper.cxx
index 9a79e939046d..9f9e9a3c3c87 100644
--- a/sdext/source/pdfimport/wrapper/wrapper.cxx
+++ b/sdext/source/pdfimport/wrapper/wrapper.cxx
@@ -36,6 +36,7 @@
#include <sal/log.hxx>
#include <comphelper/propertysequence.hxx>
+#include <comphelper/string.hxx>
#include <com/sun/star/io/XInputStream.hpp>
#include <com/sun/star/uno/XComponentContext.hpp>
#include <com/sun/star/rendering/PathCapType.hpp>
@@ -254,25 +255,19 @@ std::string_view LineParser::readNextToken()
void LineParser::readInt32( sal_Int32& o_Value )
{
std::string_view tok = readNextToken();
- sal_Int64 n = rtl_str_toInt64_WithLength(tok.data(), 10, tok.size());
- if (n < SAL_MIN_INT32 || n > SAL_MAX_INT32)
- n = 0;
- o_Value = n;
+ o_Value = comphelper::string::toInt32(tok);
}
sal_Int32 LineParser::readInt32()
{
std::string_view tok = readNextToken();
- sal_Int64 n =rtl_str_toInt64_WithLength(tok.data(), 10, tok.size());
- if (n < SAL_MIN_INT32 || n > SAL_MAX_INT32)
- n = 0;
- return n;
+ return comphelper::string::toInt32(tok);
}
void LineParser::readInt64( sal_Int64& o_Value )
{
std::string_view tok = readNextToken();
- o_Value = rtl_str_toInt64_WithLength(tok.data(), 10, tok.size());
+ o_Value = comphelper::string::toInt64(tok);
}
void LineParser::readDouble( double& o_Value )