#include "TextClass.h"
#include "Lexer.h"
#include "Font.h"
-#include "support/debug.h"
-
+#include "support/debug.h"
#include "support/lstrings.h"
#include <ostream>
-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;
LT_ALIGNPOSSIBLE,
LT_MARGIN,
LT_BOTTOMSEP,
+ LT_CATEGORY,
LT_COMMANDDEPTH,
LT_COPYSTYLE,
LT_DEPENDSON,
LT_PARSKIP,
//LT_PLAIN,
LT_PREAMBLE,
+ LT_REQUIRES,
LT_RIGHTMARGIN,
LT_SPACING,
LT_TOPSEP,
{ "align", LT_ALIGN },
{ "alignpossible", LT_ALIGNPOSSIBLE },
{ "bottomsep", LT_BOTTOMSEP },
+ { "category", LT_CATEGORY },
{ "commanddepth", LT_COMMANDDEPTH },
{ "copystyle", LT_COPYSTYLE },
{ "dependson", LT_DEPENDSON },
{ "parskip", LT_PARSKIP },
{ "passthru", LT_PASS_THRU },
{ "preamble", LT_PREAMBLE },
+ { "requires", LT_REQUIRES },
{ "rightmargin", LT_RIGHTMARGIN },
{ "spacing", LT_SPACING },
{ "textfont", LT_TEXTFONT },
finished = true;
break;
+ case LT_CATEGORY:
+ if (lexrc.next())
+ category_ = lexrc.getDocString();
+ break;
+
case LT_COPYSTYLE: // initialize with a known style
if (lexrc.next()) {
docstring const style = subst(lexrc.getDocString(),
<< 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())
- << endl;
- }
+ DocumentClass::const_iterator lit = tclass.begin();
+ DocumentClass::const_iterator len = tclass.end();
+ for (; lit != len; ++lit)
+ lyxerr << to_utf8((*lit)->name()) << endl;
//lexrc.printError("Cannot copy known "
// "style `$$Token'");
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;
}