[LyX/master] Fixup cd8338636395d (#12569)

Juergen Spitzmueller spitz at lyx.org
Sat Aug 6 16:14:55 UTC 2022


commit 4ba989000c4fcd36c54171a73bbf37318ede6f6a
Author: Juergen Spitzmueller <spitz at lyx.org>
Date:   Sat Aug 6 19:00:36 2022 +0200

    Fixup cd8338636395d (#12569)
---
 src/Text3.cpp |   18 +++++++++---------
 1 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/src/Text3.cpp b/src/Text3.cpp
index 7422bea..f3d4d61 100644
--- a/src/Text3.cpp
+++ b/src/Text3.cpp
@@ -3182,19 +3182,19 @@ bool Text::getStatus(Cursor & cur, FuncRequest const & cmd,
 		break;
 	case LFUN_FLEX_INSERT: {
 		code = FLEX_CODE;
-		string s = cmd.getArg(0);
-		if (!cur.buffer()->params().documentClass().hasInsetLayout(from_utf8(s)))
+		docstring s = from_ascii("Flex:") + from_utf8(cmd.getArg(0));
+		if (!cur.buffer()->params().documentClass().hasInsetLayout(s))
 			enable = false;
 		else {
-			InsetLayout il =
-				cur.buffer()->params().documentClass().insetLayout(from_utf8(s));
-			if (il.lyxtype() != InsetLyXType::CHARSTYLE &&
-				il.lyxtype() != InsetLyXType::CUSTOM &&
-				il.lyxtype ()!= InsetLyXType::STANDARD)
+			InsetLyXType ilt =
+				cur.buffer()->params().documentClass().insetLayout(s).lyxtype();
+			if (ilt != InsetLyXType::CHARSTYLE
+			    && ilt != InsetLyXType::CUSTOM
+			    && ilt != InsetLyXType::STANDARD)
 				enable = false;
 		}
-			break;
-		}
+		break;
+	}
 	case LFUN_BOX_INSERT:
 		code = BOX_CODE;
 		break;


More information about the lyx-cvs mailing list