From: Jean-Marc Lasgouttes Date: Tue, 10 May 2016 09:17:43 +0000 (+0200) Subject: Disable LFUN_INSET_DISSOLVE in tabulars X-Git-Tag: 2.3.0alpha1~1643^2~32 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=26308c1d6bb8bfe5c891f3d8d8fc1ddf30248ba5;p=features.git Disable LFUN_INSET_DISSOLVE in tabulars 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. --- diff --git a/src/insets/InsetText.cpp b/src/insets/InsetText.cpp index 80b0bac013..660826309f 100644 --- a/src/insets/InsetText.cpp +++ b/src/insets/InsetText.cpp @@ -293,7 +293,8 @@ void InsetText::doDispatch(Cursor & cur, FuncRequest & cmd) 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 @@ -325,7 +326,8 @@ bool InsetText::getStatus(Cursor & cur, FuncRequest const & cmd, 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);