From 33dbbc15a96edf0844134462c5fa302dbfbd7910 Mon Sep 17 00:00:00 2001 From: Vincent van Ravesteijn Date: Mon, 2 Nov 2009 04:01:45 +0000 Subject: [PATCH] Fix some remains of handling INSET_DISSOLVE (see r31756): - change cur.inset().nargs() to nargs() as we might actually be in the inset called nextInset(), - set the enabling flag of the status struct, don't return this value, - return whether we handled this request. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@31822 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/insets/InsetText.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/insets/InsetText.cpp b/src/insets/InsetText.cpp index 6b2f81d842..b974c0b98b 100644 --- a/src/insets/InsetText.cpp +++ b/src/insets/InsetText.cpp @@ -295,7 +295,7 @@ 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 = cur.inset().nargs() == 1; + bool const one_cell = nargs() == 1; if (!main_inset && target_inset && one_cell) { // Text::dissolveInset assumes that the cursor @@ -338,9 +338,11 @@ 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 = cur.inset().nargs() == 1; + bool const one_cell = nargs() == 1; - return !main_inset && target_inset && one_cell; + if (target_inset) + status.setEnabled(!main_inset && one_cell); + return target_inset; } default: -- 2.39.2