commit 90717ff3778f0266ea8d0fb1de935f560ac29c3e
Author: Jean-Marc Lasgouttes <[email protected]>
Date:   Tue Apr 1 15:08:44 2025 +0200

    Make Coverity Scan aware that tabulars are never empty.
    
    This avoids some defects that would be relevant if nrows == 0.
    
    I do not know how this could be better declared and enforced at C++ level.
---
 src/insets/InsetTabular.cpp | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/insets/InsetTabular.cpp b/src/insets/InsetTabular.cpp
index 5264e68298..99060483fe 100644
--- a/src/insets/InsetTabular.cpp
+++ b/src/insets/InsetTabular.cpp
@@ -7138,6 +7138,9 @@ void InsetTabular::movePrevCell(Cursor & cur, 
EntryDirection entry_from)
 
 void InsetTabular::tabularFeatures(Cursor & cur, string const & argument)
 {
+       // Tell Coverity Scan that a tabular is never empty
+       LATTEST(tabular.nrows() > 0 && tabular.ncols() > 0);
+
        cur.recordUndoInset(this);
 
        istringstream is(argument);
-- 
lyx-cvs mailing list
[email protected]
https://lists.lyx.org/mailman/listinfo/lyx-cvs

Reply via email to