]> git.lyx.org Git - features.git/blobdiff - src/lyx_main.C
This commit creates a error_lists map member inside the Buffer class.
[features.git] / src / lyx_main.C
index 422ecc0308892b827cf742728befe9b77d1eb008..9f3dddbb92bd90f8dea0f497ac9fb3b41cc364a6 100644 (file)
@@ -280,21 +280,21 @@ int LyX::exec2(int & argc, char * argv[])
                                        last_loaded = b;
                        } else {
                                Buffer * buf = bufferlist.newBuffer(s, false);
-                               if (loadLyXFile(buf, s))
+                               if (loadLyXFile(buf, s)) {
                                        last_loaded = buf;
-                               else
-                                       bufferlist.release(buf);
-
-                               ErrorList const & el = buf->getErrorList();
-                               if (!el.empty()) {
-                                       // There should be a way to use the following but I (abdel) don't know
-                                       // how to make it compile on MSVC2005.
-                                       //for_each(el.begin(), el.end(), mem_fun_ref(&LyX::printError));
-                                       for (ErrorList::const_iterator it = el.begin();
-                                               it != el.end(); ++it) {
-                                                       printError(*it);
+                                       ErrorList const & el = buf->errorList("Parse");
+                                       if (!el.empty()) {
+                                               // There should be a way to use the following but I (abdel) don't know
+                                               // how to make it compile on MSVC2005.
+                                               //for_each(el.begin(), el.end(), mem_fun_ref(&LyX::printError));
+                                               for (ErrorList::const_iterator it = el.begin();
+                                                       it != el.end(); ++it) {
+                                                               printError(*it);
+                                               }
                                        }
                                }
+                               else
+                                       bufferlist.release(buf);
                        }
                }