]> git.lyx.org Git - lyx.git/blobdiff - src/bufferlist.C
Added new FINISED states FINISHED_RIGHT, FINISHED_UP, FINISHED_DOWN.
[lyx.git] / src / bufferlist.C
index 57f704e1cdc41c01323727a5dc0ae547dd09c9c6..d602fc6e598cdaf58aa1c5b76ce89d944fa4eb71 100644 (file)
@@ -28,6 +28,7 @@
 #include "support/filetools.h"
 #include "support/lyxmanip.h"
 #include "support/lyxfunctional.h"
+#include "support/LAssert.h"
 #include "lyx_gui_misc.h"
 #include "lastfiles.h"
 #include "debug.h"
@@ -448,7 +449,7 @@ Buffer * BufferList::newFile(string const & name, string tname, bool isNamed)
                bool templateok = false;
                LyXLex lex(0, 0);
                lex.setFile(tname);
-               if (lex.IsOK()) {
+               if (lex.isOK()) {
                        if (b->readFile(lex)) {
                                templateok = true;
                        }
@@ -476,8 +477,12 @@ Buffer * BufferList::newFile(string const & name, string tname, bool isNamed)
 
 Buffer * BufferList::loadLyXFile(string const & filename, bool tolastfiles)
 {
-       // make sure our path is absolute
-       string const s = MakeAbsPath(filename);
+       // get absolute path of file and add ".lyx" to the filename if
+       // necessary
+       string s = FileSearch(string(), filename, "lyx");
+       if (s.empty()) {
+               s = filename;
+       }
 
        // file already open?
        if (exists(s)) {