Fix a crash when lyx2lyx failed to convert LyX file.

* src/buffer.C
	(Buffer::readFile): Only call updateDocLang if reading the file
	succeeded


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/branches/BRANCH_1_4_X@15093 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Georg Baum 2006-09-21 07:57:45 +00:00
parent 997a774c9f
commit 94d391b183
2 changed files with 5 additions and 2 deletions

View File

@ -556,14 +556,15 @@ bool Buffer::readFile(string const & filename)
paragraphs().clear(); paragraphs().clear();
LyXLex lex(0, 0); LyXLex lex(0, 0);
lex.setFile(filename); lex.setFile(filename);
bool ret = readFile(lex, filename); if (!readFile(lex, filename))
return false;
// After we have read a file, we must ensure that the buffer // After we have read a file, we must ensure that the buffer
// language is set and used in the gui. // language is set and used in the gui.
// If you know of a better place to put this, please tell me. (Lgb) // If you know of a better place to put this, please tell me. (Lgb)
updateDocLang(params().language); updateDocLang(params().language);
return ret; return true;
} }

View File

@ -47,6 +47,8 @@ What's new
- Fix a crash when a used bibtex file is in a non-readable directory - Fix a crash when a used bibtex file is in a non-readable directory
(bug 2782). (bug 2782).
- Fix a crash when lyx2lyx failed to convert LyX file.
- Ignore the definition of LyXgreyout environment when re-importing a - Ignore the definition of LyXgreyout environment when re-importing a
LyX-generated LaTeX file (part of bug 2420). LyX-generated LaTeX file (part of bug 2420).