mirror of
https://git.lyx.org/repos/lyx.git
synced 2025-01-11 03:03:06 +00:00
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
This commit is contained in:
parent
8245ec900b
commit
33dbbc15a9
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user