]> git.lyx.org Git - lyx.git/blobdiff - src/Layout.cpp
This is the first of a series of commits that will make InsetLayout a real class.
[lyx.git] / src / Layout.cpp
index 08ae3f1973899016929500f231b5954380d0581e..c29f0bd1f8a0d0a0359e18410488b417a7e38952 100644 (file)
@@ -16,9 +16,8 @@
 #include "TextClass.h"
 #include "Lexer.h"
 #include "Font.h"
-#include "support/debug.h"
-
 
+#include "support/debug.h"
 #include "support/lstrings.h"
 
 #include <ostream>
@@ -82,6 +81,7 @@ enum LayoutTags {
        LT_PARSKIP,
        //LT_PLAIN,
        LT_PREAMBLE,
+       LT_REQUIRES,
        LT_RIGHTMARGIN,
        LT_SPACING,
        LT_TOPSEP,
@@ -179,6 +179,7 @@ bool Layout::read(Lexer & lexrc, TextClass const & tclass)
                { "parskip",        LT_PARSKIP },
                { "passthru",       LT_PASS_THRU },
                { "preamble",       LT_PREAMBLE },
+               { "requires",       LT_REQUIRES },
                { "rightmargin",    LT_RIGHTMARGIN },
                { "spacing",        LT_SPACING },
                { "textfont",       LT_TEXTFONT },
@@ -484,11 +485,19 @@ bool Layout::read(Lexer & lexrc, TextClass const & tclass)
                case LT_SPACING: // setspace.sty
                        readSpacing(lexrc);
                        break;
+
+               case LT_REQUIRES:
+                       lexrc.eatLine();
+                       vector<string> const req = 
+                               getVectorFromString(lexrc.getString());
+                       requires_.insert(req.begin(), req.end());
+                       break;
+
                }
        }
        lexrc.popTable();
 
-       return error;
+       return !error;
 }