]> git.lyx.org Git - features.git/blobdiff - src/Layout.cpp
Convenience LFUN to split an environment
[features.git] / src / Layout.cpp
index e53e99171bb848fc11dd09a0759d955d725c6e23..7e0308db9bf1d8fbe1a646e2b262e3bb5607b173 100644 (file)
@@ -53,6 +53,7 @@ enum LayoutTags {
        LT_FREE_SPACING,
        LT_PASS_THRU,
        LT_PARBREAK_IS_NEWLINE,
+       LT_ITEMCOMMAND,
        LT_ITEMSEP,
        LT_KEEPEMPTY,
        LT_LABEL_BOTTOMSEP,
@@ -145,6 +146,7 @@ Layout::Layout()
        htmlforcecss_ = false;
        htmltitle_ = false;
        spellcheck = true;
+       itemcommand_ = "item";
 }
 
 
@@ -180,6 +182,7 @@ bool Layout::read(Lexer & lex, TextClass const & tclass)
                { "innertag",       LT_INNERTAG },
                { "inpreamble",     LT_INPREAMBLE },
                { "intitle",        LT_INTITLE },
+               { "itemcommand",    LT_ITEMCOMMAND },
                { "itemsep",        LT_ITEMSEP },
                { "itemtag",        LT_ITEMTAG },
                { "keepempty",      LT_KEEPEMPTY },
@@ -394,6 +397,10 @@ bool Layout::read(Lexer & lex, TextClass const & tclass)
                        lex >> itemtag_;
                        break;
 
+               case LT_ITEMCOMMAND:
+                       lex >> itemcommand_;
+                       break;
+
                case LT_PREAMBLE:
                        preamble_ = from_utf8(lex.getLongString("EndPreamble"));
                        break;
@@ -881,6 +888,7 @@ void Layout::readArgument(Lexer & lex)
 {
        latexarg arg;
        arg.mandatory = false;
+       arg.autoinsert = false;
        bool error = false;
        bool finished = false;
        arg.font = inherit_font;
@@ -906,6 +914,9 @@ void Layout::readArgument(Lexer & lex)
                } else if (tok == "mandatory") {
                        lex.next();
                        arg.mandatory = lex.getBool();
+               } else if (tok == "autoinsert") {
+                       lex.next();
+                       arg.autoinsert = lex.getBool();
                } else if (tok == "leftdelim") {
                        lex.next();
                        arg.ldelim = lex.getDocString();
@@ -946,6 +957,15 @@ void Layout::readArgument(Lexer & lex)
 }
 
 
+Layout::LaTeXArgMap Layout::args() const
+{
+       LaTeXArgMap args = latexargs_;
+       if (!itemargs_.empty())
+               args.insert(itemargs_.begin(), itemargs_.end());
+       return args;
+}
+
+
 int Layout::optArgs() const
 {
        int nr = 0;