diff options
author | Eike Rathke <erack@redhat.com> | 2018-06-20 18:07:54 +0200 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2018-06-20 22:06:41 +0200 |
commit | 011a9d000e32ec55e9ef46237fc1f5a578f78f9b (patch) | |
tree | f34006db28e23e2e4a8ff733e3497a38f542f394 | |
parent | 8cbd64985af140b2afac6ea2fd3b9b93300f6f7c (diff) |
Related: tdf#117049 treat yet unknown result as initial 0.0
For the first =A1+B1 in B1 with iterations the result could had
been #VALUE! depending on string conversion calculation settings.
Change-Id: I8d7a745d67ba7a20f7a66e8aa143642d08ea5111
Reviewed-on: https://gerrit.libreoffice.org/56173
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: Jenkins
(cherry picked from commit 93dcfa7ee157dd865f5d266d1f877014462eac72)
Reviewed-on: https://gerrit.libreoffice.org/56179
-rw-r--r-- | sc/source/core/tool/formularesult.cxx | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/sc/source/core/tool/formularesult.cxx b/sc/source/core/tool/formularesult.cxx index c1ed01516113..ad10f51a36ba 100644 --- a/sc/source/core/tool/formularesult.cxx +++ b/sc/source/core/tool/formularesult.cxx @@ -274,7 +274,12 @@ namespace { inline bool isValue( formula::StackVar sv ) { return sv == formula::svDouble || sv == formula::svError - || sv == formula::svEmptyCell; + || sv == formula::svEmptyCell + // The initial unitialized result value is double 0.0, even if the type + // is unknown, so the interpreter asking for it gets that double + // instead of having to convert a string which may result in #VALUE! + // (otherwise the unknown would be neither error nor double nor string) + || sv == formula::svUnknown; } inline bool isString( formula::StackVar sv ) @@ -457,6 +462,8 @@ double ScFormulaResult::GetDouble() const ; // nothing } } + // Note that we reach here also for the default ctor and + // formula::svUnknown from GetType(). return 0.0; } if (mbEmpty) |