diff options
-rw-r--r-- | configmgr/source/valueparser.cxx | 4 | ||||
-rw-r--r-- | oox/source/ppt/comments.cxx | 5 | ||||
-rw-r--r-- | xmloff/source/draw/animationimport.cxx | 8 |
3 files changed, 13 insertions, 4 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; } diff --git a/oox/source/ppt/comments.cxx b/oox/source/ppt/comments.cxx index 78dc5295497f..8034a3978b45 100644 --- a/oox/source/ppt/comments.cxx +++ b/oox/source/ppt/comments.cxx @@ -9,6 +9,7 @@ #include <oox/ppt/comments.hxx> #include <com/sun/star/lang/IllegalArgumentException.hpp> +#include <rtl/math.h> #include <rtl/math.hxx> namespace oox::ppt @@ -37,7 +38,9 @@ void Comment::setDateTime(const OUString& sDateTime) aDateTime.Day = sDateTime.getToken(0, 'T', nIdx).toUInt32(); aDateTime.Hours = sDateTime.getToken(0, ':', nIdx).toUInt32(); aDateTime.Minutes = sDateTime.getToken(0, ':', nIdx).toUInt32(); - double seconds = sDateTime.copy(nIdx).toDouble(); + double seconds = rtl_math_uStringToDouble(sDateTime.getStr() + nIdx, + sDateTime.getStr() + sDateTime.getLength(), '.', 0, + nullptr, nullptr); aDateTime.Seconds = floor(seconds); seconds -= aDateTime.Seconds; aDateTime.NanoSeconds = ::rtl::math::round(seconds * 1000000000); diff --git a/xmloff/source/draw/animationimport.cxx b/xmloff/source/draw/animationimport.cxx index f39922967f48..1c8ff364bccd 100644 --- a/xmloff/source/draw/animationimport.cxx +++ b/xmloff/source/draw/animationimport.cxx @@ -50,6 +50,7 @@ #include <comphelper/processfactory.hxx> #include <comphelper/string.hxx> +#include <rtl/math.h> #include <sal/log.hxx> #include <tools/diagnose_ex.h> #include <sax/tools/converter.hxx> @@ -408,8 +409,11 @@ Sequence< TimeFilterPair > AnimationsImportHelperImpl::convertTimeFilter( const sal_Int32 nPos = aToken.indexOf( ',' ); if( nPos >= 0 ) { - pValues->Time = aToken.copy( 0, nPos ).toDouble(); - pValues->Progress = aToken.copy( nPos+1 ).toDouble(); + pValues->Time = rtl_math_uStringToDouble( + aToken.getStr(), aToken.getStr() + nPos, '.', 0, nullptr, nullptr); + pValues->Progress = rtl_math_uStringToDouble( + aToken.getStr() + nPos + 1, aToken.getStr() + aToken.getLength(), '.', 0, + nullptr, nullptr); } pValues++; } |