*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:
Abdelrazak Younes 2008-02-13 14:39:16 +00:00
parent cae858efc6
commit 5ed5e01fd7
2 changed files with 13 additions and 13 deletions

View File

@ -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))

View File

@ -184,7 +184,7 @@ public:
private:
///
bool deleteLayout(docstring const &);
///
/// \return true for success.
bool readStyle(Lexer &, Layout &);
/// Layout file name
std::string name_;