From 42b2fa2acf25803c340e58f14ac2911d02697c56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrgen=20Spitzm=C3=BCller?= Date: Sun, 4 Oct 2009 14:21:51 +0000 Subject: [PATCH] * GuiView.cpp (reloadBuffer): - make sure a child is re-allocated to its master after reloading (bug 6233). git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@31510 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/frontends/qt4/GuiView.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/frontends/qt4/GuiView.cpp b/src/frontends/qt4/GuiView.cpp index 01968506bc..f47d40459b 100644 --- a/src/frontends/qt4/GuiView.cpp +++ b/src/frontends/qt4/GuiView.cpp @@ -2245,12 +2245,18 @@ void GuiView::reloadBuffer() { Buffer * buf = &documentBufferView()->buffer(); FileName filename = buf->fileName(); + Buffer const * master = buf->masterBuffer(); + bool const is_child = master != buf; // The user has already confirmed that the changes, if any, should // be discarded. So we just release the Buffer and don't call closeBuffer(); theBufferList().release(buf); buf = loadDocument(filename); docstring const disp_fn = makeDisplayPath(filename.absFilename()); docstring str; + // re-allocate master if necessary + if (is_child && theBufferList().isLoaded(master) + && buf->masterBuffer() != master) + buf->setParent(master); if (buf) { buf->updateLabels(); setBuffer(buf);