]> git.lyx.org Git - lyx.git/blobdiff - src/bufferlist.C
Fix working of the spellchecker dialog with ispell when there are no
[lyx.git] / src / bufferlist.C
index 9e734cbcc3b06c7c5aedfdabc311c3a004ffa375..c5af8316686d4dea579960ac7a608988cf70db86 100644 (file)
@@ -350,6 +350,12 @@ Buffer * BufferList::readFile(string const & s, bool ronly)
        // File information about normal file
        FileInfo fileInfo2(s);
 
+       if (!fileInfo2.exist()) {
+               WriteAlert(_("Error!"), _("Cannot open file"), 
+                       MakeDisplayPath(s));
+               return 0;
+       }
        // Check if emergency save file exists and is newer.
        e += OnlyFilename(s) + ".emergency";
        FileInfo fileInfoE(e);
@@ -449,7 +455,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;
                        }