]> git.lyx.org Git - features.git/commitdiff
The point of the previous commit: We just need the params here, not
authorRichard Heck <rgheck@comcast.net>
Fri, 13 May 2011 19:40:04 +0000 (19:40 +0000)
committerRichard Heck <rgheck@comcast.net>
Fri, 13 May 2011 19:40:04 +0000 (19:40 +0000)
the whole buffer.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@38743 a592a061-630c-0410-9148-cb99ea01b6c8

src/frontends/qt4/GuiDocument.cpp

index ba7e7a2e657fc0a1cfdb8f54ed0c89a4fdedb440..050c8d27a2c88b57cd379c964593177f6bacf4ee 100644 (file)
@@ -2141,29 +2141,26 @@ void GuiDocument::updateDefaultFormat()
        if (!bufferview())
                return;
        // make a copy in order to consider unapplied changes
-       Buffer * tmpbuf = buffer().clone();
-       tmpbuf->params().useNonTeXFonts =
-               fontModule->osFontsCB->isChecked();
+       BufferParams tmp = buffer().params();
+       tmp.useNonTeXFonts = fontModule->osFontsCB->isChecked();
        int idx = latexModule->classCO->currentIndex();
        if (idx >= 0) {
                string const classname = classes_model_.getIDString(idx);
-               tmpbuf->params().setBaseClass(classname);
-               tmpbuf->params().makeDocumentClass();
+               tmp.setBaseClass(classname);
+               tmp.makeDocumentClass();
        }
        outputModule->defaultFormatCO->blockSignals(true);
        outputModule->defaultFormatCO->clear();
        outputModule->defaultFormatCO->addItem(qt_("Default"),
                                QVariant(QString("default")));
        typedef vector<Format const *> Formats;
-       Formats formats = tmpbuf->params().exportableFormats(true);
+       Formats formats = tmp.exportableFormats(true);
        Formats::const_iterator cit = formats.begin();
        Formats::const_iterator end = formats.end();
        for (; cit != end; ++cit)
                outputModule->defaultFormatCO->addItem(qt_((*cit)->prettyname()),
                                QVariant(toqstr((*cit)->name())));
        outputModule->defaultFormatCO->blockSignals(false);
-       // delete the copy
-       delete tmpbuf;
 }