summaryrefslogtreecommitdiffstats
path: root/configmgr
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2021-09-17 07:42:32 +0200
committerStephan Bergmann <sbergman@redhat.com>2021-09-17 11:14:40 +0200
commita6db8971bf37b696ae7b1d0f8fb4d11a1e541da1 (patch)
tree139c3e7059e5f9761fefddf87e18b5bd1acc8eb1 /configmgr
parenttdf#140226: Make use of SfxPoolItems more typesafe by using StaticWhichCast (diff)
downloadcore-a6db8971bf37b696ae7b1d0f8fb4d11a1e541da1.tar.gz
core-a6db8971bf37b696ae7b1d0f8fb4d11a1e541da1.zip
Some more uses of rtl_math_(u)StringToDouble
...to avoid construction of temporary O(U)Strings, in anticipation of using C++17 std::from_chars once that is available in all our baselines, similar to 99a1290b3f2c8584db0a33fe48adf93dccce3a92 "Use existing rtl_math_stringToDouble" Change-Id: Ib92504341c3ae9dd599f91725b0af5b7219a201d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122219 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'configmgr')
-rw-r--r--configmgr/source/valueparser.cxx4
1 files changed, 3 insertions, 1 deletions
diff --git a/configmgr/source/valueparser.cxx b/configmgr/source/valueparser.cxx
index 49ddba36fc27..6245cb11b654 100644
--- a/configmgr/source/valueparser.cxx
+++ b/configmgr/source/valueparser.cxx
@@ -25,6 +25,7 @@
#include <com/sun/star/uno/RuntimeException.hpp>
#include <com/sun/star/uno/Sequence.hxx>
#include <comphelper/sequence.hxx>
+#include <rtl/math.h>
#include <rtl/string.h>
#include <rtl/string.hxx>
#include <rtl/ustring.hxx>
@@ -128,7 +129,8 @@ bool parseValue(xmlreader::Span const & text, sal_Int64 * value) {
bool parseValue(xmlreader::Span const & text, double * value) {
assert(text.is() && value != nullptr);
- *value = OString(text.begin, text.length).toDouble();
+ *value = rtl_math_stringToDouble(
+ text.begin, text.begin + text.length, '.', 0, nullptr, nullptr);
//TODO: check valid lexical representation
return true;
}