From d4136cb6520dc2b91832ca7da793b3ec1b1fdb30 Mon Sep 17 00:00:00 2001 From: Richard Heck Date: Tue, 14 Oct 2008 18:06:08 +0000 Subject: [PATCH] Correct the order of the tests here. Messed this up in previous commit. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@26906 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/frontends/qt4/GuiDocument.cpp | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/src/frontends/qt4/GuiDocument.cpp b/src/frontends/qt4/GuiDocument.cpp index 7c019ebdc2..ea7e1ae8da 100644 --- a/src/frontends/qt4/GuiDocument.cpp +++ b/src/frontends/qt4/GuiDocument.cpp @@ -1326,16 +1326,6 @@ void GuiDocument::classChanged() return; string const classname = classes_model_.getIDString(idx); - // We load the TextClass as soon as it is selected. This is - // necessary so that other options in the dialog can be updated - // according to the new class. Note, however, that, if you use - // the scroll wheel when sitting on the combo box, we'll load a - // lot of TextClass objects very quickly.... - if (!bp_.setBaseClass(classname)) { - Alert::error(_("Error"), _("Unable to set document class.")); - return; - } - // check whether the selected modules have changed. bool modulesChanged = false; unsigned int const srows = selectedModel()->rowCount(); @@ -1360,9 +1350,20 @@ void GuiDocument::classChanged() if (ret == 0) applyView(); } - if (lyxrc.auto_reset_options) - bp_.useClassDefaults(); } + + // We load the TextClass as soon as it is selected. This is + // necessary so that other options in the dialog can be updated + // according to the new class. Note, however, that, if you use + // the scroll wheel when sitting on the combo box, we'll load a + // lot of TextClass objects very quickly.... + if (!bp_.setBaseClass(classname)) { + Alert::error(_("Error"), _("Unable to set document class.")); + return; + } + if (lyxrc.auto_reset_options) + bp_.useClassDefaults(); + // With the introduction of modules came a distinction between the base // class and the document class. The former corresponds to the main layout // file; the latter is that plus the modules (or the document-specific layout, -- 2.39.2