* LyXFunc.cpp (reload):

- if the lyx_view_ has been detroyed, create a new one (fix bug 5389).


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@27781 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Jürgen Spitzmüller 2008-12-06 14:44:40 +00:00
parent 3103e4b7bb
commit 4d363d56dd

View File

@ -1735,6 +1735,9 @@ void LyXFunc::reloadBuffer()
// The user has already confirmed that the changes, if any, should // The user has already confirmed that the changes, if any, should
// be discarded. So we just release the Buffer and don't call closeBuffer(); // be discarded. So we just release the Buffer and don't call closeBuffer();
theBufferList().release(lyx_view_->buffer()); theBufferList().release(lyx_view_->buffer());
// if the lyx_view_ has been destroyed, create a new one
if (!lyx_view_)
theApp()->dispatch(FuncRequest(LFUN_WINDOW_NEW));
Buffer * buf = lyx_view_->loadDocument(filename); Buffer * buf = lyx_view_->loadDocument(filename);
docstring const disp_fn = makeDisplayPath(filename.absFilename()); docstring const disp_fn = makeDisplayPath(filename.absFilename());
docstring str; docstring str;