diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-07-22 15:21:22 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-07-22 20:33:42 +0200 |
commit | 376cd186eee775c71912c5427278bf4943a88b08 (patch) | |
tree | d926b2d607cd807b59f43e35081600f0f963477c /sc/source | |
parent | 8aa16f7ae0202a46bd7ef2d1896663b68441fa10 (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')
-rw-r--r-- | sc/source/core/tool/scmatrix.cxx | 6 |
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)); } |