Kaydet (Commit) 1e3b7cbf authored tarafından Winfried Donkers's avatar Winfried Donkers Kaydeden (comit) Eike Rathke

SWITCH returns error if compared value contains an error, tdf#97831 follow-up

Partial revert of commit a2aea8ba

Change-Id: Ia059dd434a52e959495c0ea6ffc47e68df7a474a
Reviewed-on: https://gerrit.libreoffice.org/25165Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarEike Rathke <erack@redhat.com>
Tested-by: 's avatarEike Rathke <erack@redhat.com>
üst 77e7dc64
...@@ -1957,7 +1957,6 @@ void ScInterpreter::ScSwitch_MS() ...@@ -1957,7 +1957,6 @@ void ScInterpreter::ScSwitch_MS()
return; return;
} }
nParamCount--; nParamCount--;
sal_uInt16 nFirstMatchError = 0;
bool bFinished = false; bool bFinished = false;
while ( nParamCount > 1 && !bFinished && !nGlobalError ) while ( nParamCount > 1 && !bFinished && !nGlobalError )
{ {
...@@ -1967,10 +1966,8 @@ void ScInterpreter::ScSwitch_MS() ...@@ -1967,10 +1966,8 @@ void ScInterpreter::ScSwitch_MS()
fVal = GetDouble(); fVal = GetDouble();
else else
aStr = GetString(); aStr = GetString();
if (!nFirstMatchError)
nFirstMatchError = nGlobalError;
nParamCount--; nParamCount--;
if ( !nGlobalError && (( isValue && rtl::math::approxEqual( fRefVal, fVal ) ) || if ( nGlobalError || (( isValue && rtl::math::approxEqual( fRefVal, fVal ) ) ||
( !isValue && aRefStr.getDataIgnoreCase() == aStr.getDataIgnoreCase() )) ) ( !isValue && aRefStr.getDataIgnoreCase() == aStr.getDataIgnoreCase() )) )
{ {
// TRUE // TRUE
...@@ -1999,11 +1996,10 @@ void ScInterpreter::ScSwitch_MS() ...@@ -1999,11 +1996,10 @@ void ScInterpreter::ScSwitch_MS()
if ( nGlobalError || !bFinished ) if ( nGlobalError || !bFinished )
{ {
nGlobalError = nFirstMatchError;
if ( !bFinished ) if ( !bFinished )
PushNA(); // no true expression found PushNA(); // no true expression found
if ( nGlobalError ) else
PushNoValue(); // expression returned something other than true or false PushError( nGlobalError );
return; return;
} }
......
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