summaryrefslogtreecommitdiff
path: root/sdext
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2021-05-17 15:17:13 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-05-18 12:58:55 +0200
commit7462343cb9c7a61cd28c7eae245f21b6bfc56b40 (patch)
treefef10a16712d4bc070dd0905ebd8ae437d2f947c /sdext
parent5c5b058c83e31e798a63a96d0e16b35927ce519f (diff)
update "add OString::getTokenView"
update commit 3669d4ec43a6aa2d410d8351d631548db45a5302 Date: Fri May 14 15:51:38 2021 +0200 add OString::getTokenView (tdf#42374 related) with suggested changes from gerrit review Change-Id: I861d960deaa010740a4aa964e402c4c76a85cbc7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115706 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sdext')
-rw-r--r--sdext/source/pdfimport/wrapper/wrapper.cxx10
1 files changed, 8 insertions, 2 deletions
diff --git a/sdext/source/pdfimport/wrapper/wrapper.cxx b/sdext/source/pdfimport/wrapper/wrapper.cxx
index 5672249c3e15..f2439a5bb83c 100644
--- a/sdext/source/pdfimport/wrapper/wrapper.cxx
+++ b/sdext/source/pdfimport/wrapper/wrapper.cxx
@@ -261,13 +261,19 @@ std::string_view LineParser::readNextToken()
void LineParser::readInt32( sal_Int32& o_Value )
{
std::string_view tok = readNextToken();
- o_Value = rtl_str_toInt32_WithLength(tok.data(), 10, tok.size());
+ 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;
}
sal_Int32 LineParser::readInt32()
{
std::string_view tok = readNextToken();
- return rtl_str_toInt32_WithLength(tok.data(), 10, tok.size());
+ 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;
}
void LineParser::readInt64( sal_Int64& o_Value )