]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetTabular.cpp
and also correctly draw selected multicolumn cells while we're at it...
[lyx.git] / src / insets / InsetTabular.cpp
index d689b63dadc538a2a865b0ad9b000a5a6046c74d..137e8812dd9f2d68b6778ebb20b296ece9c414a7 100644 (file)
@@ -3259,7 +3259,11 @@ bool InsetTabular::isCellSelected(Cursor & cur, row_type row, col_type col)
                        col_type cs, ce;
                        getSelection(cur, rs, re, cs, ce);
                        
-                       if (col >= cs && col <= ce && row >= rs && row <= re)
+                       idx_type const cell = tabular.cellIndex(row, col);
+                       col_type const cspan = tabular.columnSpan(cell);
+                       row_type const rspan = tabular.rowSpan(cell);
+                       if (col + cspan - 1 >= cs && col <= ce 
+                               && row + rspan - 1 >= rs && row <= re)
                                return true;
                } else 
                        if (col == tabular.cellColumn(cur.idx())