commit 280985f9d71ba7f571f5f21ac37110a83a112539
Author: Juergen Spitzmueller <sp...@lyx.org>
Date:   Sun Mar 2 10:44:04 2025 +0100

    With deleted tabular rows/columns, do not attempt to change just the content
---
 src/insets/InsetTabular.cpp | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)

diff --git a/src/insets/InsetTabular.cpp b/src/insets/InsetTabular.cpp
index 6d1556caa9..b629bcb256 100644
--- a/src/insets/InsetTabular.cpp
+++ b/src/insets/InsetTabular.cpp
@@ -6100,6 +6100,34 @@ void InsetTabular::doDispatch(Cursor & cur, FuncRequest 
& cmd)
                                cur.forceBufferUpdate();
                        }
                        break;
+               } else if (ct && 
tabular.row_info[tabular.cellRow(cur.idx())].change.deleted()) {
+                       // whole row marked deleted
+                       row_type r = tabular.cellRow(cur.idx());
+                       if (act == LFUN_CHANGE_ACCEPT)
+                               tabular.deleteRow(r, true);
+                       else
+                               tabular.row_info[r].change.setUnchanged();
+                       tabular.updateIndexes();
+                       // cursor might be invalid
+                       cur.fixIfBroken();
+                       // change bar might need to be redrawn
+                       cur.screenUpdateFlags(Update::Force);
+                       cur.forceBufferUpdate();
+                       break;
+               } else if (ct && 
tabular.column_info[tabular.cellColumn(cur.idx())].change.deleted()) {
+                       // whole column marked deleted
+                       col_type c = tabular.cellColumn(cur.idx());
+                       if (act == LFUN_CHANGE_ACCEPT)
+                               tabular.deleteColumn(c, true);
+                       else
+                               tabular.column_info[c].change.setUnchanged();
+                       tabular.updateIndexes();
+                       // cursor might be invalid
+                       cur.fixIfBroken();
+                       // change bar might need to be redrawn
+                       cur.screenUpdateFlags(Update::Force);
+                       cur.forceBufferUpdate();
+                       break;
                } else {
                        cell(cur.idx())->dispatch(cur, cmd);
                        break;
-- 
lyx-cvs mailing list
lyx-cvs@lists.lyx.org
https://lists.lyx.org/mailman/listinfo/lyx-cvs

Reply via email to