mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-25 10:58:52 +00:00
This commit fixes the crash caused by loading an empty corrupted document.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@14828 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
1451d739c4
commit
cd8b0e563c
@ -566,14 +566,15 @@ bool Buffer::readFile(string const & filename)
|
||||
paragraphs().clear();
|
||||
LyXLex lex(0, 0);
|
||||
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
|
||||
// language is set and used in the gui.
|
||||
// If you know of a better place to put this, please tell me. (Lgb)
|
||||
updateDocLang(params().language);
|
||||
|
||||
return ret;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
@ -162,7 +162,6 @@ bool LyXView::loadLyXFile(string const & filename, bool tolastfiles)
|
||||
disconnectBuffer();
|
||||
|
||||
bool loaded = work_area_->bufferView().loadLyXFile(filename, tolastfiles);
|
||||
showErrorList("Parse");
|
||||
|
||||
updateMenubar();
|
||||
updateToolbars();
|
||||
@ -171,6 +170,7 @@ bool LyXView::loadLyXFile(string const & filename, bool tolastfiles)
|
||||
if (loaded) {
|
||||
connectBuffer(*work_area_->bufferView().buffer());
|
||||
setLayout(work_area_->bufferView().firstLayout());
|
||||
showErrorList("Parse");
|
||||
}
|
||||
redrawWorkArea();
|
||||
return loaded;
|
||||
|
Loading…
Reference in New Issue
Block a user