summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2015-10-21 18:45:18 +0200
committerCaolán McNamara <caolanm@redhat.com>2015-10-22 15:49:38 +0000
commit748ff17f7780232729d60ef764b0f2995b887b22 (patch)
tree295f78d42945b47822a74341e2abfaf91eb94a9e
parenteb0d47c372366da812e8dd1a54f772f1d43e9310 (diff)
Resolves: tdf#95226 fix broken IFERROR/IFNA array logic
Change-Id: I059248659f51746cfc1d06faeaadaf3d645c03d3 (cherry picked from commit 968e2faff6d4283dacd9010d31cb4c0df45eb7c5) Reviewed-on: https://gerrit.libreoffice.org/19522 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r--sc/source/core/tool/interpr1.cxx5
1 files changed, 3 insertions, 2 deletions
diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx
index e86b955f7686..56b8ce192e27 100644
--- a/sc/source/core/tool/interpr1.cxx
+++ b/sc/source/core/tool/interpr1.cxx
@@ -349,11 +349,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.
@@ -371,6 +371,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 ));