From a6db8971bf37b696ae7b1d0f8fb4d11a1e541da1 Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Fri, 17 Sep 2021 07:42:32 +0200 Subject: 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 --- xmloff/source/draw/animationimport.cxx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'xmloff') 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 #include +#include #include #include #include @@ -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++; } -- cgit