]> git.lyx.org Git - lyx.git/blobdiff - src/Layout.cpp
GuiBox.cpp: fix this issue: horizontal box alignment is only possible without inner...
[lyx.git] / src / Layout.cpp
index cd7b5d43233b961f1be4744fd1a8b9afc7ca9fc0..6dfc0f5dcf7c1838c3a81f1ae73f77dad23323bc 100644 (file)
@@ -149,6 +149,8 @@ Layout::Layout()
        htmlforcecss_ = false;
        htmltitle_ = false;
        spellcheck = true;
+       optargs = 0;
+       reqargs = 0;
 }
 
 
@@ -558,6 +560,12 @@ bool Layout::read(Lexer & lex, TextClass const & tclass)
                }
        }
        lex.popTable();
+       // make sure we only have inpreamble = true for commands
+       if (inpreamble && latextype != LATEX_COMMAND) {
+               LYXERR0("InPreamble not permitted except with Command-type layouts.");
+               LYXERR0("Layout name: " << name());
+               inpreamble = false;
+       }
 
        return !error;
 }