commit ac3693c04ffaa8e5bcb69884465c5508981e347e
Author: Richard Kimberly Heck <rikih...@lyx.org>
Date:   Sat Dec 29 00:23:26 2018 -0500

    Fix bug #11422.
    
    We need to load the master document before applying the params, since
    otherwise the TOC reset (and other things) happen before the master
    has been loaded (and set as parent).
---
 src/frontends/qt4/GuiDocument.cpp |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/src/frontends/qt4/GuiDocument.cpp 
b/src/frontends/qt4/GuiDocument.cpp
index 7cdf4ba..91a8241 100644
--- a/src/frontends/qt4/GuiDocument.cpp
+++ b/src/frontends/qt4/GuiDocument.cpp
@@ -4490,10 +4490,9 @@ void GuiDocument::dispatchParams()
        // This must come first so that a language change is correctly noticed
        setLanguage();
 
-       // Apply the BufferParams. Note that this will set the base class
-       // and then update the buffer's layout.
-       dispatch_bufferparams(*this, params(), LFUN_BUFFER_PARAMS_APPLY, 
&buffer());
-
+       // We need to load the master before we formally update the params,
+       // since otherwise we run updateBuffer, etc, before the child's master
+       // has been set.
        if (!params().master.empty()) {
                FileName const master_file = 
support::makeAbsPath(params().master,
                           support::onlyPath(buffer().absFileName()));
@@ -4515,6 +4514,10 @@ void GuiDocument::dispatchParams()
                }
        }
 
+       // Apply the BufferParams. Note that this will set the base class
+       // and then update the buffer's layout.
+       dispatch_bufferparams(*this, params(), LFUN_BUFFER_PARAMS_APPLY, 
&buffer());
+
        // Generate the colours requested by each new branch.
        BranchList & branchlist = params().branchlist();
        if (!branchlist.empty()) {

Reply via email to