]> 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>
Sun, 15 Sep 2019 21:23:48 +0000 (23:23 +0200)
This is a hackish special case, so I had to add a hack...

Fixes bug #8650.

(cherry picked from commit 7c1c50d737d61aeccaa3ce277179db19ba3a7467)

src/insets/InsetFlex.cpp
status.23x

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
index b32797a362147a1d9fd20ecd52980f8dee3398bf..6b2b027d81e0199d7da85442a50f385c8b73e744 100644 (file)
@@ -140,6 +140,8 @@ What's new
 
 - Hide "LaTeX (Clipboard)" entry from import menu (bug 11657).
 
+- Enable dissolve in undefined Flex inset context menu (bug 8650).
+
 
 * INTERNALS