mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-25 10:58:52 +00:00
*TextClass::readStyle(): return true on success!
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22980 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
cae858efc6
commit
5ed5e01fd7
@ -143,16 +143,16 @@ bool TextClass::isTeXClassAvailable() const
|
||||
bool TextClass::readStyle(Lexer & lexrc, Layout & lay)
|
||||
{
|
||||
LYXERR(Debug::TCLASS, "Reading style " << to_utf8(lay.name()));
|
||||
if (!lay.read(lexrc, *this)) {
|
||||
// Resolve fonts
|
||||
lay.resfont = lay.font;
|
||||
lay.resfont.realize(defaultfont());
|
||||
lay.reslabelfont = lay.labelfont;
|
||||
lay.reslabelfont.realize(defaultfont());
|
||||
return false; // no errors
|
||||
if (lay.read(lexrc, *this)) {
|
||||
lyxerr << "Error parsing style `" << to_utf8(lay.name()) << '\'' << endl;
|
||||
return false;
|
||||
}
|
||||
lyxerr << "Error parsing style `" << to_utf8(lay.name()) << '\'' << endl;
|
||||
return true;
|
||||
// Resolve fonts
|
||||
lay.resfont = lay.font;
|
||||
lay.resfont.realize(defaultfont());
|
||||
lay.reslabelfont = lay.labelfont;
|
||||
lay.reslabelfont.realize(defaultfont());
|
||||
return true; // no errors
|
||||
}
|
||||
|
||||
|
||||
@ -321,16 +321,16 @@ bool TextClass::read(FileName const & filename, ReadType rt)
|
||||
+ lexrc.getString() + " is probably not valid UTF-8!";
|
||||
lexrc.printError(s.c_str());
|
||||
Layout lay;
|
||||
error = readStyle(lexrc, lay);
|
||||
error = !readStyle(lexrc, lay);
|
||||
} else if (hasLayout(name)) {
|
||||
Layout * lay = operator[](name).get();
|
||||
error = readStyle(lexrc, *lay);
|
||||
error = !readStyle(lexrc, *lay);
|
||||
} else {
|
||||
Layout lay;
|
||||
lay.setName(name);
|
||||
if (le == TC_ENVIRONMENT)
|
||||
lay.is_environment = true;
|
||||
error = readStyle(lexrc, lay);
|
||||
error = !readStyle(lexrc, lay);
|
||||
if (!error)
|
||||
layoutlist_.push_back(
|
||||
boost::shared_ptr<Layout>(new Layout(lay))
|
||||
|
@ -184,7 +184,7 @@ public:
|
||||
private:
|
||||
///
|
||||
bool deleteLayout(docstring const &);
|
||||
///
|
||||
/// \return true for success.
|
||||
bool readStyle(Lexer &, Layout &);
|
||||
/// Layout file name
|
||||
std::string name_;
|
||||
|
Loading…
Reference in New Issue
Block a user