commit 96c2141cfc3477374d930150046496b2e1e2d19f
Author: Jean-Marc Lasgouttes <[email protected]>
Date:   Tue Apr 1 15:54:04 2025 +0200

    Add assertions to help Coverity Scan
---
 src/mathed/InsetMathGrid.cpp | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/mathed/InsetMathGrid.cpp b/src/mathed/InsetMathGrid.cpp
index f17702a169..c6f4d419d6 100644
--- a/src/mathed/InsetMathGrid.cpp
+++ b/src/mathed/InsetMathGrid.cpp
@@ -316,12 +316,16 @@ char InsetMathGrid::verticalAlignment() const
 
 col_type InsetMathGrid::ncols() const
 {
+       // the array is never empty and there is an extra column for last 
vlines.
+       LATTEST(colinfo_.size() > 1);
        return colinfo_.size() - 1;
 }
 
 
 row_type InsetMathGrid::nrows() const
 {
+       // the array is never empty and there is an extra row for last hlines.
+       LATTEST(rowinfo_.size() > 1);
        return rowinfo_.size() - 1;
 }
 
-- 
lyx-cvs mailing list
[email protected]
https://lists.lyx.org/mailman/listinfo/lyx-cvs

Reply via email to