diff options
author | Eike Rathke <erack@redhat.com> | 2023-10-16 20:35:13 +0200 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2023-10-16 23:35:02 +0200 |
commit | 3161a6c351a2f5f70c0420ee8cccf2eb23de1ecf (patch) | |
tree | 09cbbd63a582b09ffc903321d122629496645ed7 /sc/source | |
parent | 1f440348eb0892fd2c9597806d87b5fe9d60d49a (diff) |
Resolves: tdf#157797 Let GetCellValue() propagate previous error, if any
Change-Id: I27ee8d19e4f45bef81e133c82ac17b825790208f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158064
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: Jenkins
Diffstat (limited to 'sc/source')
-rw-r--r-- | sc/source/core/tool/interpr4.cxx | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/sc/source/core/tool/interpr4.cxx b/sc/source/core/tool/interpr4.cxx index 0ac2e151f5cc..95dff9f1cc18 100644 --- a/sc/source/core/tool/interpr4.cxx +++ b/sc/source/core/tool/interpr4.cxx @@ -181,7 +181,9 @@ double ScInterpreter::GetCellValue( const ScAddress& rPos, ScRefCellValue& rCell FormulaError nErr = nGlobalError; nGlobalError = FormulaError::NONE; double nVal = GetCellValueOrZero(rPos, rCell); - if ( nGlobalError == FormulaError::NONE || nGlobalError == FormulaError::CellNoValue ) + // Propagate previous error, if any; nGlobalError==CellNoValue is not an + // error here, preserve previous error or non-error. + if (nErr != FormulaError::NONE || nGlobalError == FormulaError::CellNoValue) nGlobalError = nErr; return nVal; } |