]> git.lyx.org Git - features.git/commitdiff
Enable dissolve in undefined Flex inset context menu
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Wed, 11 Sep 2019 13:49:50 +0000 (15:49 +0200)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Wed, 11 Sep 2019 13:49:50 +0000 (15:49 +0200)
This is a hackish special case, so I had to add a hack...

Fixes bug #8650.

src/insets/InsetFlex.cpp

index 31828b615ffbd808ea7e972e2c3ecbd252114b35..05c48f68eceb2275eb5a45b872f2e7163fc9a448 100644 (file)
@@ -99,7 +99,9 @@ bool InsetFlex::getStatus(Cursor & cur, FuncRequest const & cmd,
                        InsetLayout const & il = getLayout();
                        InsetLayout::InsetLyXType const type =
                                translateLyXType(to_utf8(cmd.argument()));
-                       if (il.lyxtype() == type) {
+                       if (il.lyxtype() == type
+                           || (il.name() == DocumentClass::plainInsetLayout().name()
+                                   && type == InsetLayout::CHARSTYLE)) {
                                FuncRequest temp_cmd(LFUN_INSET_DISSOLVE);
                                return InsetCollapsible::getStatus(cur, temp_cmd, flag);
                        } else
@@ -121,7 +123,9 @@ void InsetFlex::doDispatch(Cursor & cur, FuncRequest & cmd)
                        InsetLayout::InsetLyXType const type =
                                translateLyXType(to_utf8(cmd.argument()));
 
-                       if (il.lyxtype() == type) {
+                       if (il.lyxtype() == type
+                           || (il.name() == DocumentClass::plainInsetLayout().name()
+                                   && type == InsetLayout::CHARSTYLE)) {
                                FuncRequest temp_cmd(LFUN_INSET_DISSOLVE);
                                InsetCollapsible::doDispatch(cur, temp_cmd);
                        } else