]> git.lyx.org Git - features.git/commitdiff
A little more cleanup.
authorRichard Heck <rgheck@comcast.net>
Sun, 18 Apr 2010 20:42:04 +0000 (20:42 +0000)
committerRichard Heck <rgheck@comcast.net>
Sun, 18 Apr 2010 20:42:04 +0000 (20:42 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@34205 a592a061-630c-0410-9148-cb99ea01b6c8

src/TextClass.cpp

index a6ba7c9298b6f6e5f8ee133265b5e3e7191ec664..6524ecb77c2f0ec28913c898fbf069ca0dd397cf 100644 (file)
@@ -406,8 +406,7 @@ TextClass::ReturnValues TextClass::read(Lexer & lexrc, ReadType rt)
                                        lexrc.printError("Could not find input file: " + inc);
                                        error = true;
                                } else if (!read(tmp, MERGE)) {
-                                       lexrc.printError("Error reading input"
-                                                        "file: " + tmp.absFilename());
+                                       lexrc.printError("Error reading input file: " + tmp.absFilename());
                                        error = true;
                                }
                        }
@@ -683,16 +682,18 @@ TextClass::ReturnValues TextClass::read(Lexer & lexrc, ReadType rt)
                        break;
                } // end of switch
 
-               //Note that this is triggered the first time through the loop unless
-               //we hit a format tag.
+               // Note that this is triggered the first time through the loop unless
+               // we hit a format tag.
                if (format != FORMAT)
-                       break;
+                       return FORMAT_MISMATCH;
        }
 
-       if (format != FORMAT)
-               return FORMAT_MISMATCH;
+       // at present, we abort if we encounter an error,
+       // so there is no point continuing.
+       if (error)
+               return ERROR;
 
-       if (rt != BASECLASS) 
+       if (rt != BASECLASS)
                return (error ? ERROR : OK);
 
        if (defaultlayout_.empty()) {