diff options
-rw-r--r-- | sc/source/core/tool/interpr4.cxx | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/sc/source/core/tool/interpr4.cxx b/sc/source/core/tool/interpr4.cxx index 0642fcd29595..6bd15b7bbd13 100644 --- a/sc/source/core/tool/interpr4.cxx +++ b/sc/source/core/tool/interpr4.cxx @@ -4074,9 +4074,18 @@ StackVar ScInterpreter::Interpret() if ( nFuncFmtType != css::util::NumberFormat::UNDEFINED ) { nRetTypeExpr = nFuncFmtType; - // inherit the format index only for currency formats - nRetIndexExpr = ( nFuncFmtType == css::util::NumberFormat::CURRENCY ? - nFuncFmtIndex : 0 ); + // Inherit the format index for currency, date or time formats. + switch (nFuncFmtType) + { + case css::util::NumberFormat::CURRENCY: + case css::util::NumberFormat::DATE: + case css::util::NumberFormat::TIME: + case css::util::NumberFormat::DATETIME: + nRetIndexExpr = nFuncFmtIndex; + break; + default: + nRetIndexExpr = 0; + } } } |