diff options
-rw-r--r-- | sc/source/core/tool/interpr1.cxx | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx index ff8a990afff1..f6caa793f61a 100644 --- a/sc/source/core/tool/interpr1.cxx +++ b/sc/source/core/tool/interpr1.cxx @@ -354,11 +354,11 @@ void ScInterpreter::ScIfError( bool bNAonly ) SCSIZE nC = 0, nR = 0; for ( ; nC < nCols && (nC != nErrorCol || nR != nErrorRow); /*nop*/ ) { - for ( ; nR < nRows && (nC != nErrorCol || nR != nErrorRow); ++nR) + for (nR = 0 ; nR < nRows && (nC != nErrorCol || nR != nErrorRow); ++nR) { lcl_storeJumpMatResult(pMatPtr, pJumpMat, nC, nR); } - if (nC != nErrorCol || nR != nErrorRow) + if (nC != nErrorCol && nR != nErrorRow) ++nC; } // Now the mixed cases. @@ -376,6 +376,7 @@ void ScInterpreter::ScIfError( bool bNAonly ) lcl_storeJumpMatResult(pMatPtr, pJumpMat, nC, nR); } } + nR = 0; } xNew = new ScJumpMatrixToken( pJumpMat ); GetTokenMatrixMap().insert( ScTokenMatrixMap::value_type( pCur, xNew )); |