]> git.lyx.org Git - lyx.git/commitdiff
Corrections, thanks to Bernhard.
authorRichard Heck <rgheck@comcast.net>
Wed, 30 Apr 2008 21:04:49 +0000 (21:04 +0000)
committerRichard Heck <rgheck@comcast.net>
Wed, 30 Apr 2008 21:04:49 +0000 (21:04 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@24570 a592a061-630c-0410-9148-cb99ea01b6c8

src/insets/InsetBibtex.cpp

index 3ebee05101eb656d91f50591ec79268e69ec2543..82c85a16ce0a674592d05047b94683011aba25ac 100644 (file)
@@ -694,13 +694,13 @@ void InsetBibtex::fillWithBibKeys(BiblioInfo & keylist,
 
                        docstring entryType;
 
-                       if (!ifs) {
-                               lyxerr << "InsetBibtex::fillWithBibKeys: Unexpected end of file." << std::endl;
+                       if (!readTypeOrKey(entryType, ifs, from_ascii("{("), docstring(), makeLowerCase)) {
+                               lyxerr << "InsetBibtex::fillWithBibKeys: Error reading entry type." << std::endl;
                                continue;
                        }
 
-                       if (!readTypeOrKey(entryType, ifs, from_ascii("{("), docstring(), makeLowerCase)) {
-                               lyxerr << "InsetBibtex::fillWithBibKeys: Error reading entry type." << std::endl;
+                       if (!ifs) {
+                               lyxerr << "InsetBibtex::fillWithBibKeys: Unexpected end of file." << std::endl;
                                continue;
                        }
 
@@ -729,13 +729,13 @@ void InsetBibtex::fillWithBibKeys(BiblioInfo & keylist,
                                docstring name;
                                docstring value;
 
-                               if (!ifs) {
-                                       lyxerr << "InsetBibtex::fillWithBibKeys: Unexpected end of file." << std::endl;
+                               if (!readTypeOrKey(name, ifs, from_ascii("="), from_ascii("#{}(),"), makeLowerCase)) {
+                                       lyxerr << "InsetBibtex::fillWithBibKeys: Error reading string name." << std::endl;
                                        continue;
                                }
 
-                               if (!readTypeOrKey(name, ifs, from_ascii("="), from_ascii("#{}(),"), makeLowerCase)) {
-                                       lyxerr << "InsetBibtex::fillWithBibKeys: Error reading string name." << std::endl;
+                               if (!ifs) {
+                                       lyxerr << "InsetBibtex::fillWithBibKeys: Unexpected end of file." << std::endl;
                                        continue;
                                }
 
@@ -771,17 +771,17 @@ void InsetBibtex::fillWithBibKeys(BiblioInfo & keylist,
                                // Citation entry. Try to read the key.
                                docstring key;
 
-                               if (!ifs) {
-                                       lyxerr << "InsetBibtex::fillWithBibKeys: Unexpected end of file." << std::endl;
-                                       continue;
-                               }
-
                                if (!readTypeOrKey(key, ifs, from_ascii(","), from_ascii("}"), keepCase)) {
                                        lyxerr << "InsetBibtex::fillWithBibKeys: Unable to read key for entry type:" << 
                                                        entryType << "." << std::endl;
                                        continue;
                                }
 
+                               if (!ifs) {
+                                       lyxerr << "InsetBibtex::fillWithBibKeys: Unexpected end of file." << std::endl;
+                                       continue;
+                               }
+
                                /////////////////////////////////////////////
                                // now we have a key, so we will add an entry 
                                // (even if it's empty, as bibtex does)