]> git.lyx.org Git - features.git/commitdiff
Fix some remains of handling INSET_DISSOLVE (see r31756):
authorVincent van Ravesteijn <vfr@lyx.org>
Mon, 2 Nov 2009 04:01:45 +0000 (04:01 +0000)
committerVincent van Ravesteijn <vfr@lyx.org>
Mon, 2 Nov 2009 04:01:45 +0000 (04:01 +0000)
- 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

index 6b2f81d842a5a86a1eaf00ae17c3fadabca40f06..b974c0b98b533499fedb496a253df52a65641d1f 100644 (file)
@@ -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: