From: Richard Heck Date: Sun, 18 Apr 2010 20:37:07 +0000 (+0000) Subject: Minor fixes to TextClass::read(). X-Git-Tag: 2.0.0~3419 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=d0b52ce0aa999760fb1ac9d728cccbcad7813fd2;p=features.git Minor fixes to TextClass::read(). git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@34204 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/TextClass.cpp b/src/TextClass.cpp index 540ac0622d..a6ba7c9298 100644 --- a/src/TextClass.cpp +++ b/src/TextClass.cpp @@ -341,10 +341,12 @@ bool TextClass::read(std::string const & str, ReadType rt) // Reads a textclass structure from file. TextClass::ReturnValues TextClass::read(Lexer & lexrc, ReadType rt) { - bool error = !lexrc.isOK(); + if (!lexrc.isOK()) + return ERROR; // Format of files before the 'Format' tag was introduced int format = 1; + bool error = false; // parsing while (lexrc.isOK() && !error) { @@ -696,7 +698,7 @@ TextClass::ReturnValues TextClass::read(Lexer & lexrc, ReadType rt) if (defaultlayout_.empty()) { LYXERR0("Error: Textclass '" << name_ << "' is missing a defaultstyle."); - error = true; + return ERROR; } // Try to erase "stdinsets" from the provides_ set.