summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2023-11-13 17:08:13 +0100
committerMichael Stahl <michael.stahl@allotropia.de>2023-11-14 11:13:06 +0100
commit7bc797fc5715dfd291554d84ba5fd821e9f30426 (patch)
tree9f5d40f328c17d3d8f7d10965db19cb2010f60c8
parentFix USE_CONFIG_APPROVE_CONFIRMATION and USE_CONFIG_REJECT_CONFIRMATION (diff)
downloadcore-7bc797fc5715dfd291554d84ba5fd821e9f30426.tar.gz
core-7bc797fc5715dfd291554d84ba5fd821e9f30426.zip
Resolves: tdf#127498 Force corrected TIMEVALUE() result
Change-Id: I750a3251c3cf5e8cad4a37c7c4b646c0457f2dbe Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159389 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins (cherry picked from commit c5a49da6ddec01d0ef8f53dd92983cf6ebc7bad0) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159246 Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
-rw-r--r--sc/source/core/tool/interpr2.cxx2
1 files changed, 2 insertions, 0 deletions
diff --git a/sc/source/core/tool/interpr2.cxx b/sc/source/core/tool/interpr2.cxx
index 67ec57fef9ab..12a48078440b 100644
--- a/sc/source/core/tool/interpr2.cxx
+++ b/sc/source/core/tool/interpr2.cxx
@@ -28,6 +28,7 @@
#include <sfx2/objsh.hxx>
#include <svl/numformat.hxx>
#include <svl/zforlist.hxx>
+#include <tools/duration.hxx>
#include <sal/macros.h>
#include <osl/diagnose.h>
@@ -922,6 +923,7 @@ void ScInterpreter::ScGetTimeValue()
nFuncFmtType = SvNumFormatType::TIME;
double fDateVal = rtl::math::approxFloor(fVal);
double fTimeVal = fVal - fDateVal;
+ fTimeVal = ::tools::Duration(fTimeVal).GetInDays(); // force corrected
PushDouble(fTimeVal);
}
else