Kaydet (Commit) 93dcfa7e authored tarafından Eike Rathke's avatar Eike Rathke

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/56173Reviewed-by: 's avatarEike Rathke <erack@redhat.com>
Tested-by: Jenkins
üst 678f8ab7
......@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment