When reloading a child document, reset the parent of the child to the parent of the child and not to the master.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@32738 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Vincent van Ravesteijn 2010-01-01 03:11:56 +00:00
parent 8a38b97d6b
commit c04850645e

View File

@ -697,7 +697,7 @@ void GuiView::dropEvent(QDropEvent * event)
cmd = FuncRequest(LFUN_FILE_OPEN, file); cmd = FuncRequest(LFUN_FILE_OPEN, file);
} }
// Asynchronously post the event. DropEvent usually come // Asynchronously post the event. DropEvent usually comes
// from the BufferView. But reloading a file might close // from the BufferView. But reloading a file might close
// the BufferView from within its own event handler. // the BufferView from within its own event handler.
guiApp->dispatchDelayed(cmd); guiApp->dispatchDelayed(cmd);
@ -2413,8 +2413,8 @@ void GuiView::reloadBuffer()
void GuiView::reloadBuffer(Buffer * buf) void GuiView::reloadBuffer(Buffer * buf)
{ {
FileName filename = buf->fileName(); FileName filename = buf->fileName();
Buffer const * master = buf->masterBuffer(); Buffer const * parent = buf->parent();
bool const is_child = master != buf; bool const is_child = parent != buf;
// 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(buf); theBufferList().release(buf);
@ -2423,9 +2423,9 @@ void GuiView::reloadBuffer(Buffer * buf)
docstring str; docstring str;
if (buf) { if (buf) {
// re-allocate master if necessary // re-allocate master if necessary
if (is_child && theBufferList().isLoaded(master) if (is_child && theBufferList().isLoaded(parent)
&& buf->masterBuffer() != master) && buf->parent() != parent)
buf->setParent(master); buf->setParent(parent);
buf->updateLabels(); buf->updateLabels();
setBuffer(buf); setBuffer(buf);
buf->errors("Parse"); buf->errors("Parse");