]> git.lyx.org Git - lyx.git/commitdiff
Check the return status of Lexer::setFile().
authorRichard Heck <rgheck@comcast.net>
Mon, 16 May 2011 18:17:39 +0000 (18:17 +0000)
committerRichard Heck <rgheck@comcast.net>
Mon, 16 May 2011 18:17:39 +0000 (18:17 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@38778 a592a061-630c-0410-9148-cb99ea01b6c8

src/Buffer.cpp

index 9d102acd9a3897d07be3f2d967f5576f2ec6987e..ea1168b6846bc75757703f6cdd94ef772741ef7f 100644 (file)
@@ -873,7 +873,12 @@ Buffer::ReadStatus Buffer::readFile(FileName const & fn)
 {
        FileName fname(fn);
        Lexer lex;
-       lex.setFile(fname);
+       if (!lex.setFile(fname)) {
+               Alert::error(_("File Not Found"),
+                       bformat(_("Unable to open file `%1$s'."), 
+                               from_utf8(fn.absFileName())));
+               return ReadFileNotFound;
+       }
 
        int file_format;
        ReadStatus const ret_plf = parseLyXFormat(lex, fn, file_format);