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 /oox | |
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 'oox')
-rw-r--r-- | oox/source/ppt/comments.cxx | 5 |
1 files changed, 4 insertions, 1 deletions
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); |