Check the return status of Lexer::setFile().

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@38778 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Richard Heck 2011-05-16 18:17:39 +00:00
parent ee419218be
commit 08cfe6c46b

View 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);