summaryrefslogtreecommitdiff
path: root/sc/source/core/tool/scmatrix.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2020-07-22 15:21:22 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2020-07-22 20:33:42 +0200
commit376cd186eee775c71912c5427278bf4943a88b08 (patch)
treed926b2d607cd807b59f43e35081600f0f963477c /sc/source/core/tool/scmatrix.cxx
parent8aa16f7ae0202a46bd7ef2d1896663b68441fa10 (diff)
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 <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sc/source/core/tool/scmatrix.cxx')
-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 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<double>& 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<double>& rResVal = aFunc.getValues();
+ assert (nSize == rResVal.size());
if (nSize != rResVal.size())
- ScMatrixRef();
+ return ScMatrixRef();
return ScMatrixRef(new ScMatrix(aSize.column, aSize.row, rResVal));
}