diff options
author | Winfried Donkers <winfrieddonkers@libreoffice.org> | 2016-05-19 15:52:48 +0200 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2016-05-25 11:36:13 +0000 |
commit | 1e3b7cbff66eb81a008eca03b56fcd128ddbe45f (patch) | |
tree | 92516cba30bb8f67209694bd80eb9b3d3da5e77f | |
parent | 77e7dc648ebb8b7d946111e2be4dfdbba72840b2 (diff) |
SWITCH returns error if compared value contains an error, tdf#97831 follow-up
Partial revert of commit a2aea8bac55cef23297573733ba28f563f5aa791
Change-Id: Ia059dd434a52e959495c0ea6ffc47e68df7a474a
Reviewed-on: https://gerrit.libreoffice.org/25165
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: Eike Rathke <erack@redhat.com>
-rw-r--r-- | sc/source/core/tool/interpr8.cxx | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/sc/source/core/tool/interpr8.cxx b/sc/source/core/tool/interpr8.cxx index 7d1349f879da..dcf43d297088 100644 --- a/sc/source/core/tool/interpr8.cxx +++ b/sc/source/core/tool/interpr8.cxx @@ -1957,7 +1957,6 @@ void ScInterpreter::ScSwitch_MS() return; } nParamCount--; - sal_uInt16 nFirstMatchError = 0; bool bFinished = false; while ( nParamCount > 1 && !bFinished && !nGlobalError ) { @@ -1967,10 +1966,8 @@ void ScInterpreter::ScSwitch_MS() fVal = GetDouble(); else aStr = GetString(); - if (!nFirstMatchError) - nFirstMatchError = nGlobalError; nParamCount--; - if ( !nGlobalError && (( isValue && rtl::math::approxEqual( fRefVal, fVal ) ) || + if ( nGlobalError || (( isValue && rtl::math::approxEqual( fRefVal, fVal ) ) || ( !isValue && aRefStr.getDataIgnoreCase() == aStr.getDataIgnoreCase() )) ) { // TRUE @@ -1999,11 +1996,10 @@ void ScInterpreter::ScSwitch_MS() if ( nGlobalError || !bFinished ) { - nGlobalError = nFirstMatchError; if ( !bFinished ) PushNA(); // no true expression found - if ( nGlobalError ) - PushNoValue(); // expression returned something other than true or false + else + PushError( nGlobalError ); return; } |