]> git.lyx.org Git - features.git/commitdiff
Minor fixes to TextClass::read().
authorRichard Heck <rgheck@comcast.net>
Sun, 18 Apr 2010 20:37:07 +0000 (20:37 +0000)
committerRichard Heck <rgheck@comcast.net>
Sun, 18 Apr 2010 20:37:07 +0000 (20:37 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@34204 a592a061-630c-0410-9148-cb99ea01b6c8

src/TextClass.cpp

index 540ac0622d0680ddee3a525b147e8b2cb9040a82..a6ba7c9298b6f6e5f8ee133265b5e3e7191ec664 100644 (file)
@@ -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.