X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FLayout.cpp;h=7fedb3209c11fc16da9b7edc43a6c3d4626958e2;hb=0362c6aae73c293d1c20277c12d362acfe0b2ef6;hp=598222237a9fbbe41d81aa84390b7240549ffeae;hpb=2944cdd82ae3646f265012cc939a3537226881a4;p=lyx.git diff --git a/src/Layout.cpp b/src/Layout.cpp index 598222237a..7fedb3209c 100644 --- a/src/Layout.cpp +++ b/src/Layout.cpp @@ -15,21 +15,18 @@ #include "Layout.h" #include "TextClass.h" #include "Lexer.h" -#include "support/debug.h" +#include "Font.h" +#include "support/debug.h" #include "support/lstrings.h" #include -using std::endl; -using std::string; +using namespace std; +using namespace lyx::support; namespace lyx { -using support::subst; -using support::trim; - - /// Special value of toclevel for layouts that to not belong in a TOC const int Layout::NOT_IN_TOC = -1000; @@ -84,6 +81,7 @@ enum LayoutTags { LT_PARSKIP, //LT_PLAIN, LT_PREAMBLE, + LT_REQUIRES, LT_RIGHTMARGIN, LT_SPACING, LT_TOPSEP, @@ -181,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 }, @@ -224,14 +223,9 @@ bool Layout::read(Lexer & lexrc, TextClass const & tclass) << to_utf8(style) << "'\n" << "All layouts so far:" << endl; - TextClass::const_iterator it = - tclass.begin(); - TextClass::const_iterator end = - tclass.end(); - for (; it != end; ++it) { - lyxerr << to_utf8((*it)->name()) + for (size_t i = 0; i != tclass.layoutCount(); ++i) + lyxerr << to_utf8(tclass.layout(i)->name()) << endl; - } //lexrc.printError("Cannot copy known " // "style `$$Token'"); @@ -486,11 +480,19 @@ bool Layout::read(Lexer & lexrc, TextClass const & tclass) case LT_SPACING: // setspace.sty readSpacing(lexrc); break; + + case LT_REQUIRES: + lexrc.eatLine(); + vector const req = + getVectorFromString(lexrc.getString()); + requires_.insert(req.begin(), req.end()); + break; + } } lexrc.popTable(); - return error; + return !error; }