]> git.lyx.org Git - lyx.git/blobdiff - src/Layout.cpp
Embedding: saving inzip name to .lyx file so that embedded files can always be found...
[lyx.git] / src / Layout.cpp
index 148ebb6383b900c27c6da283f865efb3c775e092..80c8550923de08aac27bb58d7a3f793649c34f63 100644 (file)
 #include "Layout.h"
 #include "TextClass.h"
 #include "Lexer.h"
-#include "debug.h"
+#include "Font.h"
+#include "support/debug.h"
 
-#include "support/lstrings.h"
 
+#include "support/lstrings.h"
 
-namespace lyx {
+#include <ostream>
 
-using support::subst;
-using support::trim;
+using namespace std;
+using namespace lyx::support;
 
-using std::endl;
-using std::string;
+namespace lyx {
 
 /// Special value of toclevel for layouts that to not belong in a TOC
 const int Layout::NOT_IN_TOC = -1000;
@@ -82,6 +82,7 @@ enum LayoutTags {
        LT_PARSKIP,
        //LT_PLAIN,
        LT_PREAMBLE,
+       LT_REQUIRES,
        LT_RIGHTMARGIN,
        LT_SPACING,
        LT_TOPSEP,
@@ -102,10 +103,10 @@ Layout::Layout()
        optionalargs = 0;
        needprotect = false;
        keepempty = false;
-       font = Font(Font::ALL_INHERIT);
-       labelfont = Font(Font::ALL_INHERIT);
-       resfont = Font(Font::ALL_SANE);
-       reslabelfont = Font(Font::ALL_SANE);
+       font = inherit_font;
+       labelfont = inherit_font;
+       resfont = sane_font;
+       reslabelfont = sane_font;
        nextnoindent = false;
        parskip = 0.0;
        itemsep = 0;
@@ -179,6 +180,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 },
@@ -310,16 +312,16 @@ bool Layout::read(Lexer & lexrc, TextClass const & tclass)
                        break;
 
                case LT_FONT:
-                       font.lyxRead(lexrc);
-                       labelfont= font;
+                       font = lyxRead(lexrc, font);
+                       labelfont = font;
                        break;
 
                case LT_TEXTFONT:
-                       font.lyxRead(lexrc);
+                       font = lyxRead(lexrc, font);
                        break;
 
                case LT_LABELFONT:
-                       labelfont.lyxRead(lexrc);
+                       labelfont = lyxRead(lexrc, labelfont);
                        break;
 
                case LT_NEXTNOINDENT:   // Indent next paragraph?
@@ -484,6 +486,12 @@ bool Layout::read(Lexer & lexrc, TextClass const & tclass)
                case LT_SPACING: // setspace.sty
                        readSpacing(lexrc);
                        break;
+
+               case LT_REQUIRES:
+                       if (lexrc.eatLine())
+                               requires_ = getVectorFromString(lexrc.getString());
+                       break;
+
                }
        }
        lexrc.popTable();