]> git.lyx.org Git - lyx.git/blobdiff - src/Importer.cpp
Fulfill promise to Andre: TextClass_ptr --> TextClassPtr.
[lyx.git] / src / Importer.cpp
index 8bd7bccb641f8191ebd2281a05191930e00583a6..6f38b202987af9269a36e0e1e09592ee81100de8 100644 (file)
 #include "BufferView.h"
 #include "buffer_funcs.h"
 
+using std::find;
+using std::string;
+using std::vector;
+
 
 namespace lyx {
 
@@ -34,10 +38,7 @@ using support::bformat;
 using support::changeExtension;
 using support::FileName;
 using support::makeDisplayPath;
-
-using std::find;
-using std::string;
-using std::vector;
+using frontend::LyXView;
 
 
 bool Importer::Import(LyXView * lv, FileName const & filename,
@@ -76,7 +77,15 @@ bool Importer::Import(LyXView * lv, FileName const & filename,
 
 
        if (loader_format == "lyx") {
-               lv->loadLyXFile(lyxfile);
+               Buffer * buf = lv->loadLyXFile(lyxfile);
+               if (!buf) {
+                       // we are done
+                       lv->message(_("file not imported!"));
+                       return false;
+               }
+               updateLabels(*buf);
+               lv->setBuffer(buf);
+               lv->showErrorList("Parse");
        } else {
                Buffer * const b = newFile(lyxfile.absFilename(), string(), true);
                if (b)