sal/rtl/math.cxx | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-)
New commits: commit 4f98b46d391719306c08e01a2c6b327647d738bd Author: Mike Kaganski <[email protected]> AuthorDate: Thu Sep 18 13:19:30 2025 +0500 Commit: Mike Kaganski <[email protected]> CommitDate: Sat Sep 20 15:20:50 2025 +0200 Small normalization/cleanup Change-Id: Ia1d3f6ae8f61ff2c3c380e191d16cdb9e23e6083 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/191146 Reviewed-by: Mike Kaganski <[email protected]> Tested-by: Jenkins diff --git a/sal/rtl/math.cxx b/sal/rtl/math.cxx index 756a4f263723..767e38883d60 100644 --- a/sal/rtl/math.cxx +++ b/sal/rtl/math.cxx @@ -212,7 +212,7 @@ double stringToDouble(CharT const* pBegin, CharT const* pEnd, CharT cDecSeparato else if (('I' == p[0]) && ('N' == p[1]) && ('F' == p[2])) { p += 3; - fVal = HUGE_VAL; + fVal = std::numeric_limits<double>::infinity(); eStatus = rtl_math_ConversionStatus_OutOfRange; bDone = true; } @@ -300,9 +300,8 @@ double stringToDouble(CharT const* pBegin, CharT const* pEnd, CharT cDecSeparato { CharT c = *p; if (!rtl::isAsciiDigit(c)) - { break; - } + buf.insert(c, p); } } @@ -335,7 +334,7 @@ double stringToDouble(CharT const* pBegin, CharT const* pEnd, CharT cDecSeparato { // "1.#INF", "+1.#INF", "-1.#INF" p += 4; - fVal = HUGE_VAL; + fVal = std::numeric_limits<double>::infinity(); eStatus = rtl_math_ConversionStatus_OutOfRange; // Eat any further digits: while (p != pEnd && rtl::isAsciiDigit(*p)) @@ -351,9 +350,7 @@ double stringToDouble(CharT const* pBegin, CharT const* pEnd, CharT cDecSeparato // Eat any further digits: while (p != pEnd && rtl::isAsciiDigit(*p)) - { ++p; - } bDone = true; } } @@ -392,16 +389,13 @@ double stringToDouble(CharT const* pBegin, CharT const* pEnd, CharT cDecSeparato } } - if (bSign) - fVal = -fVal; - if (pStatus) *pStatus = eStatus; if (pParsedEnd) *pParsedEnd = p == p0 ? pBegin : p; - return fVal; + return bSign ? -fVal : fVal; } }
