summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2019-05-10 17:26:57 +0200
committerEike Rathke <erack@redhat.com>2019-05-10 20:57:52 +0200
commitd77495060016c5e97d6e367c2a44fec83cf441f2 (patch)
tree63a37f9ee7ae454e6476fa5fc06a14cbc0f56d2c /sc
parentdf3e1af532d937229b5b2e6621e582d459760f6a (diff)
Apply duration format for such newly entered formula cells
... and the cell didn't have a number format applied already, [HH]:MM:SS instead of wall clock time format HH:MM:SS which comes to a surprise anyway if the result is >=24h. Related to tdf#125099 Change-Id: I6c19a86177f8714ac588d6798acf86e247a79b26 Reviewed-on: https://gerrit.libreoffice.org/72131 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins
Diffstat (limited to 'sc')
-rw-r--r--sc/source/core/data/formulacell.cxx5
-rw-r--r--sc/source/core/tool/interpr4.cxx5
2 files changed, 5 insertions, 5 deletions
diff --git a/sc/source/core/data/formulacell.cxx b/sc/source/core/data/formulacell.cxx
index 4b2a06fe548d..48cb55fae27a 100644
--- a/sc/source/core/data/formulacell.cxx
+++ b/sc/source/core/data/formulacell.cxx
@@ -2115,6 +2115,11 @@ void ScFormulaCell::InterpretTail( ScInterpreterContext& rContext, ScInterpretTa
bChanged = true;
}
+ // Currently (2019-05-10) nothing else can cope with a duration
+ // format type, change to time as it was before.
+ if (nFormatType == SvNumFormatType::DURATION)
+ nFormatType = SvNumFormatType::TIME;
+
mbNeedsNumberFormat = false;
}
diff --git a/sc/source/core/tool/interpr4.cxx b/sc/source/core/tool/interpr4.cxx
index 286583e875c5..8cd191c6e00b 100644
--- a/sc/source/core/tool/interpr4.cxx
+++ b/sc/source/core/tool/interpr4.cxx
@@ -4667,11 +4667,6 @@ StackVar ScInterpreter::Interpret()
else
nRetFmtType = SvNumFormatType::NUMBER;
- // Currently (2019-05-06) nothing else can cope with a duration format
- // type, change to time as it was before.
- if (nRetFmtType == SvNumFormatType::DURATION)
- nRetFmtType = SvNumFormatType::TIME;
-
if (nGlobalError != FormulaError::NONE && GetStackType() != svError )
PushError( nGlobalError);