diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2021-09-17 07:42:32 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2021-09-17 11:14:40 +0200 |
commit | a6db8971bf37b696ae7b1d0f8fb4d11a1e541da1 (patch) | |
tree | 139c3e7059e5f9761fefddf87e18b5bd1acc8eb1 /xmloff | |
parent | 6184eefa835f0495ed8136471d61837f5662b6d6 (diff) |
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 'xmloff')
-rw-r--r-- | xmloff/source/draw/animationimport.cxx | 8 |
1 files changed, 6 insertions, 2 deletions
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++; } |