At the moment, it is possible to effect a layout change inside almost
all of our character styles. So far as I can see, this is almost always
a bug. One does not want, e.g., to be able to switch to an enumeration
inside the Code character style. So I propose the following simple patch:

diff --git a/src/insets/InsetLayout.cpp b/src/insets/InsetLayout.cpp
index a1677de..b41b630 100644
--- a/src/insets/InsetLayout.cpp
+++ b/src/insets/InsetLayout.cpp
@@ -226,8 +226,10 @@ bool InsetLayout::read(Lexer & lex, TextClass const
& tclass)
                        lyxtype_ = translateLyXType(lt);
                        if (lyxtype_  == NOLYXTYPE)
                                LYXERR0("Unknown LyXType `" << lt << "'.");
-                       if (lyxtype_ == CHARSTYLE)
+                       if (lyxtype_ == CHARSTYLE) {
                                multipar_ = false;
+                               forceplain_ = true;
+                       }
                        break;
                }
                case IL_LATEXTYPE:  {

which makes charstyles, by default, force the plain layout. If one
really did want to be able to switch layouts, then one could later put
"ForcePlain 0". So this does not prevent someone from doing that.

Maybe this should be master-only, just in case someone used this 'feature'.

Richard

Reply via email to