]> git.lyx.org Git - lyx.git/blobdiff - src/lyxlayout.C
more code in the menu backend == less code in the menu frontends; add support for...
[lyx.git] / src / lyxlayout.C
index 969e0ba53899c96bd36669ccbbb53cf559869886..6533fe3051d59c0ee66fa45e439c1ad018a42913 100644 (file)
 
 #include <config.h>
 
-#ifdef __GNUG__
-#pragma implementation
-#endif
-
 #include "lyxlayout.h"
 #include "lyxtextclass.h"
 #include "lyxlex.h"
@@ -59,6 +55,7 @@ enum LayoutTags {
        LT_ENDLABELTYPE,
        LT_LATEXNAME,
        LT_LATEXPARAM,
+       LT_OPTARGS,
        LT_LATEXTYPE,
        LT_LEFTMARGIN,
        LT_NEED_PROTECT,
@@ -83,6 +80,7 @@ LyXLayout::LyXLayout ()
        margintype = MARGIN_STATIC;
        latextype = LATEX_PARAGRAPH;
        intitle = false;
+       optionalargs = 0;
        needprotect = false;
        keepempty = false;
        font = LyXFont(LyXFont::ALL_INHERIT);
@@ -119,7 +117,7 @@ bool LyXLayout::Read (LyXLex & lexrc, LyXTextClass const & tclass)
                { "alignpossible",      LT_ALIGNPOSSIBLE },
                { "bottomsep",          LT_BOTTOMSEP },
                { "copystyle",          LT_COPYSTYLE },
-               { "dependson",          LT_DEPENDSON },
+               { "dependson",          LT_DEPENDSON },
                { "end",                LT_END },
                { "endlabelstring",     LT_ENDLABELSTRING },
                { "endlabeltype",       LT_ENDLABELTYPE },
@@ -146,6 +144,7 @@ bool LyXLayout::Read (LyXLex & lexrc, LyXTextClass const & tclass)
                { "newline",            LT_NEWLINE },
                { "nextnoindent",       LT_NEXTNOINDENT },
                { "obsoletedby",        LT_OBSOLETEDBY },
+               { "optionalargs",       LT_OPTARGS },
                { "parindent",          LT_PARINDENT },
                { "parsep",             LT_PARSEP },
                { "parskip",            LT_PARSKIP },
@@ -218,7 +217,7 @@ bool LyXLayout::Read (LyXLex & lexrc, LyXTextClass const & tclass)
                                        if (obsoleted_by().empty())
                                                obsoleted_by_ = style;
                                } else {
-                                       lyxerr << "Cannot replace with unknown style `" << style << "'" << endl;
+                                       lyxerr << "Cannot replace with unknown style `" << style << '\'' << endl;
 
                                        //lexrc.printError("Cannot replace with"
                                        //               " unknown style "
@@ -227,7 +226,7 @@ bool LyXLayout::Read (LyXLex & lexrc, LyXTextClass const & tclass)
                        }
                        break;
 
-               case LT_DEPENDSON: 
+               case LT_DEPENDSON:
                        if (lexrc.next()) {
                                depends_on_ = lexrc.getString();
                        }
@@ -245,6 +244,12 @@ bool LyXLayout::Read (LyXLex & lexrc, LyXTextClass const & tclass)
                        intitle = lexrc.next() && lexrc.getInteger();
                        break;
 
+               case LT_OPTARGS:
+                       if (lexrc.next()) {
+                               optionalargs = lexrc.getInteger();
+                       }
+                       break;
+
                case LT_NEED_PROTECT:
                        needprotect = lexrc.next() && lexrc.getInteger();
                        break;