sc/source/core/tool/interpr8.cxx | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-)
New commits: commit 2844f3114c2a7b122fe299ed21ed06ca57866e47 Author: Eike Rathke <[email protected]> Date: Fri May 6 22:01:46 2016 +0200 actually propagate a match expression error, tdf#97831 follow-up Change-Id: Iaeecf371af8dd5f6c2cbdea2f114566e8bf7cf47 diff --git a/sc/source/core/tool/interpr8.cxx b/sc/source/core/tool/interpr8.cxx index 36304d8..7d1349f 100644 --- a/sc/source/core/tool/interpr8.cxx +++ b/sc/source/core/tool/interpr8.cxx @@ -1952,6 +1952,7 @@ void ScInterpreter::ScSwitch_MS() isValue = ScMatrix::IsValueType( GetDoubleOrStringFromMatrix( fRefVal, aRefStr ) ); break; default : + PopError(); PushIllegalArgument(); return; } commit c54f6161480fc3721bf8e208cd12a7446ab608b7 Author: Eike Rathke <[email protected]> Date: Fri May 6 21:52:28 2016 +0200 coverity#1359230 DEADCODE, detect missing parameter, tdf#97831 follow-up ... so SWITCH with less than 3 parameters returns the proper error code instead of #N/A. Change-Id: Ib5d696a640f7084ca46c3cf8f378ea6e659e3f11 diff --git a/sc/source/core/tool/interpr8.cxx b/sc/source/core/tool/interpr8.cxx index 1b7bf6d..36304d8 100644 --- a/sc/source/core/tool/interpr8.cxx +++ b/sc/source/core/tool/interpr8.cxx @@ -1913,6 +1913,9 @@ void ScInterpreter::ScSwitch_MS() { short nParamCount = GetByte(); + if (!MustHaveParamCountMin( nParamCount, 3)) + return; + ReverseStack( nParamCount ); nGlobalError = 0; // propagate only for match or active result path @@ -1970,13 +1973,6 @@ void ScInterpreter::ScSwitch_MS() ( !isValue && aRefStr.getDataIgnoreCase() == aStr.getDataIgnoreCase() )) ) { // TRUE - if ( nParamCount < 1 ) - { - // no parameter given for THEN - nGlobalError = nFirstMatchError; - PushParameterExpected(); - return; - } bFinished = true; } else commit 0ed8a6a5bbe31c9713d017594fbbcf38618e8c1d Author: Eike Rathke <[email protected]> Date: Fri May 6 21:29:57 2016 +0200 coverity#1359229 handle PopDoubleRefOrSingleRef() as usual Change-Id: Ib74f00725f2e8b78cbbb92ef9760da74401c1984 diff --git a/sc/source/core/tool/interpr8.cxx b/sc/source/core/tool/interpr8.cxx index 5cb33f0..1b7bf6d 100644 --- a/sc/source/core/tool/interpr8.cxx +++ b/sc/source/core/tool/interpr8.cxx @@ -1933,8 +1933,7 @@ void ScInterpreter::ScSwitch_MS() case svDoubleRef : { ScAddress aAdr; - PopDoubleRefOrSingleRef( aAdr ); - if ( nGlobalError ) + if (!PopDoubleRefOrSingleRef( aAdr )) break; ScRefCellValue aCell( *pDok, aAdr ); isValue = !( aCell.hasString() || aCell.hasEmptyValue() || aCell.isEmpty() ); _______________________________________________ Libreoffice-commits mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
