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
This commit is contained in:
Pavel Sanda 2009-01-20 13:50:04 +00:00
parent 27b31deff5
commit a13b78cf3c
2 changed files with 11 additions and 5 deletions

View File

@ -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");

View File

@ -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