summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2011-11-01 21:56:10 +0100
committerKohei Yoshida <kohei.yoshida@suse.com>2011-11-01 21:53:46 -0400
commit65d15137bae588574107680846097fe5c4d7c533 (patch)
tree5d1fe700ffbcea06d9bc877b13a1ace68e7bf6ee
parent68b5341c063fde933a347db6104c0df774d9ab26 (diff)
prevent access to non existing mdds elements (fdo#41807)
Signed-off-by: Kohei Yoshida <kohei.yoshida@suse.com>
-rw-r--r--sc/source/core/tool/scmatrix.cxx6
1 files changed, 4 insertions, 2 deletions
diff --git a/sc/source/core/tool/scmatrix.cxx b/sc/source/core/tool/scmatrix.cxx
index ac1c7a41f..3074e3682 100644
--- a/sc/source/core/tool/scmatrix.cxx
+++ b/sc/source/core/tool/scmatrix.cxx
@@ -592,8 +592,10 @@ bool ScMatrixImpl::IsEmpty( SCSIZE nC, SCSIZE nR ) const
bool ScMatrixImpl::IsEmptyPath( SCSIZE nC, SCSIZE nR ) const
{
// 'Empty path' is empty plus non-zero flag.
- ValidColRowReplicated( nC, nR );
- return maMat.get_type(nR, nC) == ::mdds::element_empty && maMat.get_flag(nR, nC) != 0;
+ if (ValidColRowReplicated( nC, nR ))
+ return maMat.get_type(nR, nC) == ::mdds::element_empty && maMat.get_flag(nR, nC) != 0;
+ else
+ return true;
}
bool ScMatrixImpl::IsValue( SCSIZE nIndex ) const