]> git.lyx.org Git - lyx.git/blobdiff - src/lyx_main.C
minimal effort implementation of:
[lyx.git] / src / lyx_main.C
index 422ecc0308892b827cf742728befe9b77d1eb008..72709815b8f0655347fe0274522df3f845be0273 100644 (file)
@@ -83,7 +83,6 @@ namespace fs = boost::filesystem;
 using std::endl;
 using std::string;
 using std::vector;
-using std::mem_fun_ref;
 
 #ifndef CXX_GLOBAL_CSTD
 using std::exit;
@@ -280,21 +279,15 @@ 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;
+                                       ErrorList const & el = buf->errorList("Parse");
+                                       if (!el.empty())
+                                               for_each(el.begin(), el.end(),
+                                                       boost::bind(&LyX::printError, this, _1));
+                               }
                                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);
-                                       }
-                               }
                        }
                }
 
@@ -950,7 +943,7 @@ int parse_help(string const &, string const &)
 int parse_version(string const &, string const &)
 {
        lyxerr << "LyX " << lyx_version
-              << " of " << lyx_release_date << endl;
+              << " (" << lyx_release_date << ")" << endl;
        lyxerr << "Built on " << __DATE__ << ", " << __TIME__ << endl;
 
        lyxerr << lyx_version_info << endl;