summaryrefslogtreecommitdiff
path: root/sax
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2021-07-21 09:42:47 +0200
committerStephan Bergmann <sbergman@redhat.com>2021-07-21 15:38:03 +0200
commit99a1290b3f2c8584db0a33fe48adf93dccce3a92 (patch)
tree85695dc2f8988b195ee26e3caa1f09bb6c91e141 /sax
parente854abe076155fc085b56549ced50b3ee9a095d2 (diff)
Use existing rtl_math_stringToDouble
...like it is also already done in LineParser::readDouble in sdext/source/pdfimport/wrapper/wrapper.cxx (esp. since the code should be changed to use C++17 std::from_chars once that is available in all our baselines), reverting again the introduction of rtl_str_toDouble_WithLength in b1df9c67349cf4cc5be4128d797aefb87f50e38f "[API CHANGE] reduce cost of numeric conversion" Change-Id: If7e3a15649f80093d3407157412fd3deb3a38b12 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119318 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Tested-by: Jenkins
Diffstat (limited to 'sax')
-rw-r--r--sax/source/tools/fastattribs.cxx4
1 files changed, 3 insertions, 1 deletions
diff --git a/sax/source/tools/fastattribs.cxx b/sax/source/tools/fastattribs.cxx
index 2512f6296aee..9bf4a3f4ae6e 100644
--- a/sax/source/tools/fastattribs.cxx
+++ b/sax/source/tools/fastattribs.cxx
@@ -20,6 +20,7 @@
#include <algorithm>
#include <com/sun/star/xml/sax/SAXException.hpp>
+#include <rtl/math.h>
#include <sax/fastattribs.hxx>
using namespace ::com::sun::star::uno;
@@ -221,7 +222,8 @@ bool FastAttributeList::getAsDouble( sal_Int32 nToken, double &rDouble) const
for (size_t i = 0; i < maAttributeTokens.size(); ++i)
if (maAttributeTokens[i] == nToken)
{
- rDouble = rtl_str_toDouble_WithLength( getFastAttributeValue(i), AttributeValueLength(i) );
+ auto const p = getFastAttributeValue(i);
+ rDouble = rtl_math_stringToDouble( p, p + AttributeValueLength(i), '.', 0, nullptr, nullptr );
return true;
}
return false;