// Reads a layout definition from file
bool LyXLayout::Read (LyXLex & lexrc, LyXTextClass const & tclass)
{
-#if 1
// This table is sorted alphabetically [asierra 30March96]
keyword_item layoutTags[] = {
{ "align", LT_ALIGN },
{ "textfont", LT_TEXTFONT },
{ "topsep", LT_TOPSEP }
};
-#endif
+
bool error = false;
bool finished = false;
lexrc.pushTable(layoutTags, LT_INTITLE);
void LyXLayout::readAlign(LyXLex & lexrc)
{
-#if 1
keyword_item alignTags[] = {
{ "block", AT_BLOCK },
{ "center", AT_CENTER },
{ "left", AT_LEFT },
{ "right", AT_RIGHT }
};
-#endif
+
pushpophelper pph(lexrc, alignTags, AT_LAYOUT);
int le = lexrc.lex();
switch (le) {
void LyXLayout::readAlignPossible(LyXLex & lexrc)
{
-#if 1
keyword_item alignTags[] = {
{ "block", AT_BLOCK },
{ "center", AT_CENTER },
{ "left", AT_LEFT },
{ "right", AT_RIGHT }
};
-#endif
+
lexrc.pushTable(alignTags, AT_LAYOUT);
alignpossible = LYX_ALIGN_NONE;
int lineno = lexrc.GetLineNo();
void LyXLayout::readLabelType(LyXLex & lexrc)
{
-#if 1
keyword_item labelTypeTags[] = {
{ "bibliography", LA_BIBLIO },
{ "centered_top_environment", LA_CENTERED_TOP_ENVIRONMENT },
{ "static", LA_STATIC },
{ "top_environment", LA_TOP_ENVIRONMENT }
};
-#endif
+
pushpophelper pph(lexrc, labelTypeTags, LA_BIBLIO);
int le = lexrc.lex();
switch (le) {
void LyXLayout::readMargin(LyXLex & lexrc)
{
-#if 1
keyword_item marginTags[] = {
{ "dynamic", MARGIN_DYNAMIC },
{ "first_dynamic", MARGIN_FIRST_DYNAMIC },
{ "right_address_box", MARGIN_RIGHT_ADDRESS_BOX },
{ "static", MARGIN_STATIC }
};
-#endif
+
pushpophelper pph(lexrc, marginTags, MARGIN_RIGHT_ADDRESS_BOX);
int le = lexrc.lex();
void LyXLayout::readLatexType(LyXLex & lexrc)
{
-#if 1
keyword_item latexTypeTags[] = {
{ "command", LATEX_COMMAND },
{ "environment", LATEX_ENVIRONMENT },
{ "item_environment", LATEX_ITEM_ENVIRONMENT },
{ "list_environment", LATEX_LIST_ENVIRONMENT },
{ "paragraph", LATEX_PARAGRAPH }
-};
-#endif
+ };
+
pushpophelper pph(lexrc, latexTypeTags, LATEX_LIST_ENVIRONMENT);
int le = lexrc.lex();
switch (le) {
void LyXLayout::readSpacing(LyXLex & lexrc)
{
-#if 1
keyword_item spacingTags[] = {
{"double", ST_SPACING_DOUBLE },
{"onehalf", ST_SPACING_ONEHALF },
{"other", ST_OTHER },
{"single", ST_SPACING_SINGLE }
};
-#endif
+
pushpophelper pph(lexrc, spacingTags, ST_OTHER);
int le = lexrc.lex();
switch(le) {
// Reads a textclass structure from file.
bool LyXTextClass::Read(string const & filename, bool merge)
{
-#if 1
keyword_item textClassTags[] = {
{ "classoptions", TC_CLASSOPTIONS },
{ "columns", TC_COLUMNS },
{ "sides", TC_SIDES },
{ "style", TC_STYLE },
{ "tocdepth", TC_TOCDEPTH }
-};
-#endif
+ };
+
if (!merge)
lyxerr[Debug::TCLASS] << "Reading textclass "
<< MakeDisplayPath(filename)
void LyXTextClass::readOutputType(LyXLex & lexrc)
{
-#if 1
keyword_item outputTypeTags[] = {
{ "docbook", DOCBOOK },
{ "latex", LATEX },
{ "linuxdoc", LINUXDOC },
{ "literate", LITERATE }
-};
-#endif
+ };
+
pushpophelper pph(lexrc, outputTypeTags, LITERATE);
int le = lexrc.lex();
void LyXTextClass::readMaxCounter(LyXLex & lexrc)
{
-#if 1
keyword_item maxCounterTags[] = {
{"counter_chapter", MC_COUNTER_CHAPTER },
{"counter_enumi", MC_COUNTER_ENUMI },
{"counter_subsection", MC_COUNTER_SUBSECTION },
{"counter_subsubsection", MC_COUNTER_SUBSUBSECTION }
};
-#endif
+
pushpophelper pph(lexrc, maxCounterTags, MC_COUNTER_ENUMIV);
int le = lexrc.lex();
switch(le) {
void LyXTextClass::readClassOptions(LyXLex & lexrc)
{
-#if 1
keyword_item classOptionsTags[] = {
{"end", CO_END },
{"fontsize", CO_FONTSIZE },
{"other", CO_OTHER },
{"pagestyle", CO_PAGESTYLE }
};
-#endif
+
lexrc.pushTable(classOptionsTags, CO_END);
bool getout = false;
while (!getout && lexrc.IsOK()) {