From a13b78cf3c8c78cd368b89f28972c321e9fe6822 Mon Sep 17 00:00:00 2001 From: Pavel Sanda Date: Tue, 20 Jan 2009 13:50:04 +0000 Subject: [PATCH] Fix http://bugzilla.lyx.org/show_bug.cgi?id=5697 . Backport trunk fix http://www.lyx.org/trac/changeset/27780 for bug http://bugzilla.lyx.org/show_bug.cgi?id=5389 . git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/branches/BRANCH_1_6_X@28255 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/LyXFunc.cpp | 13 ++++++++----- status.16x | 3 +++ 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/LyXFunc.cpp b/src/LyXFunc.cpp index 78a346991a..45bc17a2ac 100644 --- a/src/LyXFunc.cpp +++ b/src/LyXFunc.cpp @@ -1784,14 +1784,17 @@ void LyXFunc::sendDispatchMessage(docstring const & msg, FuncRequest const & cmd void LyXFunc::reloadBuffer() { - Buffer * buf = lyx_view_->buffer(); - FileName filename = buf->fileName(); + FileName filename = lyx_view_->buffer()->fileName(); // The user has already confirmed that the changes, if any, should - // be discarded. So we just reread the file and don't call closeBuffer(); - bool const success = buf->readFile(filename); + // be discarded. So we just release the Buffer and don't call closeBuffer(); + 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); docstring const disp_fn = makeDisplayPath(filename.absFilename()); docstring str; - if (buf && success) { + if (buf) { updateLabels(*buf); lyx_view_->setBuffer(buf); buf->errors("Parse"); diff --git a/status.16x b/status.16x index cfacab68dc..c9010f6504 100644 --- a/status.16x +++ b/status.16x @@ -181,6 +181,9 @@ What's new - Fix a locale debug message. +- Fix reloading bug for RCS revision control introduced in 1.6.1, backport + trunk fix for bug 5389 (bug 5697) + * DOCUMENTATION AND LOCALIZATION