};
-int const FORMAT = 2;
+int const FORMAT = 4;
bool layout2layout(FileName const & filename, FileName const & tempfile)
<< ' ' << quoteName(tempfile.toFilesystemEncoding());
string const command_str = command.str();
- lyxerr[Debug::TCLASS] << "Running `" << command_str << '\'' << endl;
+ LYXERR(Debug::TCLASS) << "Running `" << command_str << '\'' << endl;
support::cmd_ret const ret =
support::runCommand(command_str);
defaultfont_ = LyXFont(LyXFont::ALL_SANE);
opt_fontsize_ = "10|11|12";
opt_pagestyle_ = "empty|plain|headings|fancy";
- provides_ = nothing;
titletype_ = TITLE_COMMAND_AFTER;
titlename_ = "maketitle";
loaded_ = false;
bool LyXTextClass::do_readStyle(LyXLex & lexrc, LyXLayout & lay)
{
- lyxerr[Debug::TCLASS] << "Reading style " << lay.name() << endl;
+ LYXERR(Debug::TCLASS) << "Reading style " << lay.name() << endl;
if (!lay.read(lexrc, *this)) {
// Resolve fonts
lay.resfont = lay.font;
TC_TOCDEPTH,
TC_CLASSOPTIONS,
TC_PREAMBLE,
- TC_PROVIDESAMSMATH,
- TC_PROVIDESNATBIB,
- TC_PROVIDESMAKEIDX,
- TC_PROVIDESURL,
+ TC_PROVIDES,
TC_LEFTMARGIN,
TC_RIGHTMARGIN,
TC_FLOAT,
{ "outputtype", TC_OUTPUTTYPE },
{ "pagestyle", TC_PAGESTYLE },
{ "preamble", TC_PREAMBLE },
- { "providesamsmath", TC_PROVIDESAMSMATH },
- { "providesmakeidx", TC_PROVIDESMAKEIDX },
- { "providesnatbib", TC_PROVIDESNATBIB },
- { "providesurl", TC_PROVIDESURL },
+ { "provides", TC_PROVIDES },
{ "rightmargin", TC_RIGHTMARGIN },
{ "secnumdepth", TC_SECNUMDEPTH },
{ "sides", TC_SIDES },
};
if (!merge)
- lyxerr[Debug::TCLASS] << "Reading textclass "
+ LYXERR(Debug::TCLASS) << "Reading textclass "
<< to_utf8(makeDisplayPath(filename.absFilename()))
<< endl;
else
- lyxerr[Debug::TCLASS] << "Reading input file "
+ LYXERR(Debug::TCLASS) << "Reading input file "
<< to_utf8(makeDisplayPath(filename.absFilename()))
<< endl;
preamble_ = from_utf8(lexrc.getLongString("EndPreamble"));
break;
- case TC_PROVIDESAMSMATH:
- if (lexrc.next() && lexrc.getInteger())
- provides_ |= amsmath;
- break;
-
- case TC_PROVIDESNATBIB:
- if (lexrc.next() && lexrc.getInteger())
- provides_ |= natbib;
- break;
-
- case TC_PROVIDESMAKEIDX:
- if (lexrc.next() && lexrc.getInteger())
- provides_ |= makeidx;
- break;
-
- case TC_PROVIDESURL:
- if (lexrc.next() && lexrc.getInteger())
- provides_ |= url;
+ case TC_PROVIDES: {
+ lexrc.next();
+ string const feature = lexrc.getString();
+ lexrc.next();
+ if (lexrc.getInteger())
+ provides_.insert(feature);
+ else
+ provides_.erase(feature);
break;
+ }
case TC_LEFTMARGIN: // left margin type
if (lexrc.next())
}
if (format != FORMAT) {
- lyxerr[Debug::TCLASS] << "Converting layout file from format "
+ LYXERR(Debug::TCLASS) << "Converting layout file from format "
<< format << " to " << FORMAT << endl;
FileName const tempfile(support::tempName());
error = !layout2layout(filename, tempfile);
}
if (!merge) { // we are at top level here.
- lyxerr[Debug::TCLASS] << "Finished reading textclass "
+ LYXERR(Debug::TCLASS) << "Finished reading textclass "
<< to_utf8(makeDisplayPath(filename.absFilename()))
<< endl;
if (defaultlayout_.empty()) {
toclevel);
}
}
- lyxerr[Debug::TCLASS]
+ LYXERR(Debug::TCLASS)
<< "Minimum TocLevel is " << min_toclevel_
<< ", maximum is " << max_toclevel_ <<endl;
} else
- lyxerr[Debug::TCLASS] << "Finished reading input file "
+ LYXERR(Debug::TCLASS) << "Finished reading input file "
<< to_utf8(makeDisplayPath(filename.absFilename()))
<< endl;
}
-bool LyXTextClass::provides(LyXTextClass::Provides p) const
+bool LyXTextClass::provides(string const & p) const
{
- return provides_ & p;
+ return provides_.find(p) != provides_.end();
}