]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/GuiDocument.cpp
Rationalize the handling of makeTextClass().
[lyx.git] / src / frontends / qt4 / GuiDocument.cpp
index 7063e9e0e2d2c228a6e356280e8d2dc1db4b54e4..19212fa525d37e1d83add8eb38153da2d0e9e9a4 100644 (file)
@@ -913,7 +913,7 @@ void GuiDocument::updatePagestyle(string const & items, string const & sel)
 void GuiDocument::classChanged()
 {
        textclass_type const tc = latexModule->classCO->currentIndex();
-       bp_.setJustBaseClass(tc);
+       bp_.setBaseClass(tc);
        if (lyxrc.auto_reset_options)
                bp_.useClassDefaults();
        updateContents();
@@ -1097,13 +1097,15 @@ void GuiDocument::apply(BufferParams & params)
        params.graphicsDriver =
                tex_graphics[latexModule->psdriverCO->currentIndex()];
        
+       // text layout
+       params.setBaseClass(latexModule->classCO->currentIndex());
+
        // Modules
        params.clearLayoutModules();
        QStringList const selMods = selectedModel()->stringList();
        for (int i = 0; i != selMods.size(); ++i)
                params.addLayoutModule(lyx::fromqstr(selMods[i]));
 
-
        if (mathsModule->amsautoCB->isChecked()) {
                params.use_amsmath = BufferParams::package_auto;
        } else {
@@ -1122,9 +1124,6 @@ void GuiDocument::apply(BufferParams & params)
                        params.use_esint = BufferParams::package_off;
        }
 
-       // text layout
-       params.setJustBaseClass(latexModule->classCO->currentIndex());
-
        if (pageLayoutModule->pagestyleCO->currentIndex() == 0)
                params.pagestyle = "default";
        else {
@@ -1639,7 +1638,7 @@ void GuiDocument::updateContents()
 
 void GuiDocument::useClassDefaults()
 {
-       bp_.setJustBaseClass(latexModule->classCO->currentIndex());
+       bp_.setBaseClass(latexModule->classCO->currentIndex());
        bp_.useClassDefaults();
        updateContents();
 }
@@ -1742,8 +1741,6 @@ void GuiDocument::dispatchParams()
 
        // Apply the BufferParams. Note that this will set the base class
        // and then update the buffer's layout.
-       //FIXME Could this be done last? Then, I think, we'd get the automatic
-       //update mentioned in the next FIXME...
        dispatch_bufferparams(*this, params(), LFUN_BUFFER_PARAMS_APPLY);
 
        // Generate the colours requested by each new branch.