From 376cd186eee775c71912c5427278bf4943a88b08 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Wed, 22 Jul 2020 15:21:22 +0200 Subject: fix unused ScMatrixRef from the surrounding code, these look like they should be returned since these look like bad code checks, add asserts. Change-Id: Idb1a2eb80b3357654e91bf2ad52b547421552003 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99226 Tested-by: Jenkins Reviewed-by: Noel Grandin --- sc/source/core/tool/scmatrix.cxx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'sc') diff --git a/sc/source/core/tool/scmatrix.cxx b/sc/source/core/tool/scmatrix.cxx index fdba2f1b7989..7f1d915ec6c7 100644 --- a/sc/source/core/tool/scmatrix.cxx +++ b/sc/source/core/tool/scmatrix.cxx @@ -2183,8 +2183,9 @@ ScMatrixRef ScMatrixImpl::CompareMatrix( // We assume the result matrix has the same dimension as this matrix. const std::vector& rResVal = aFunc.getValues(); + assert (nSize == rResVal.size()); if (nSize != rResVal.size()) - ScMatrixRef(); + return ScMatrixRef(); return ScMatrixRef(new ScMatrix(aSize.column, aSize.row, rResVal)); } @@ -2195,8 +2196,9 @@ ScMatrixRef ScMatrixImpl::CompareMatrix( // We assume the result matrix has the same dimension as this matrix. const std::vector& rResVal = aFunc.getValues(); + assert (nSize == rResVal.size()); if (nSize != rResVal.size()) - ScMatrixRef(); + return ScMatrixRef(); return ScMatrixRef(new ScMatrix(aSize.column, aSize.row, rResVal)); } -- cgit