When in a tabular cell, "this" is just a lone InsetText, while cur.inset() is the whole tabular. This makes a big difference, especially when one wants to count cells.
Fixes bug "9954.
bool const main_inset = &buffer().inset() == this;
bool const target_inset = cmd.argument().empty()
|| cmd.getArg(0) == insetName(lyxCode());
bool const main_inset = &buffer().inset() == this;
bool const target_inset = cmd.argument().empty()
|| cmd.getArg(0) == insetName(lyxCode());
- bool const one_cell = nargs() == 1;
+ // cur.inset() is the tabular when this is a single cell (bug #9954)
+ bool const one_cell = cur.inset().nargs() == 1;
if (!main_inset && target_inset && one_cell) {
// Text::dissolveInset assumes that the cursor
if (!main_inset && target_inset && one_cell) {
// Text::dissolveInset assumes that the cursor
bool const main_inset = &buffer().inset() == this;
bool const target_inset = cmd.argument().empty()
|| cmd.getArg(0) == insetName(lyxCode());
bool const main_inset = &buffer().inset() == this;
bool const target_inset = cmd.argument().empty()
|| cmd.getArg(0) == insetName(lyxCode());
- bool const one_cell = nargs() == 1;
+ // cur.inset() is the tabular when this is a single cell (bug #9954)
+ bool const one_cell = cur.inset().nargs() == 1;
if (target_inset)
status.setEnabled(!main_inset && one_cell);
if (target_inset)
status.setEnabled(!main_inset && one_cell);