]> git.lyx.org Git - lyx.git/commitdiff
Accidentally removed this code at last commit.
authorRichard Heck <rgheck@comcast.net>
Sat, 10 Mar 2012 16:49:20 +0000 (16:49 +0000)
committerRichard Heck <rgheck@comcast.net>
Sat, 10 Mar 2012 16:49:20 +0000 (16:49 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@40908 a592a061-630c-0410-9148-cb99ea01b6c8

src/frontends/qt4/GuiViewSource.cpp

index 6a49febd7de3dd552c656263472a606ab13bdd8d..aeaf105b7665ae851e0010bf9cde797bac6336de 100644 (file)
@@ -143,6 +143,7 @@ void ViewSourceWidget::setViewFormat()
        updateView();
 }
 
+
 void ViewSourceWidget::updateView()
 {
        if (!bv_) {
@@ -197,6 +198,7 @@ void ViewSourceWidget::updateDefaultFormat()
        outputFormatCO->addItem(qt_("Default"),
                                QVariant(QString("default")));
 
+       int index = 0;
        vector<string> tmp = bv_->buffer().params().backends();
        vector<string>::const_iterator it = tmp.begin();
        vector<string>::const_iterator en = tmp.end();
@@ -209,10 +211,13 @@ void ViewSourceWidget::updateDefaultFormat()
                        // we can't presently display the LyX format itself
                        continue;
 
-               QString const pretty =
-                       fmt ? qt_(fmt->prettyname()) : toqstr(format);
-               outputFormatCO->addItem(pretty, QVariant(toqstr(format)));
+               QString const pretty = qt_(fmt->prettyname());
+               QString const qformat = toqstr(format);
+               outputFormatCO->addItem(pretty, QVariant(qformat));
+               if (qformat == view_format_)
+                  index = outputFormatCO->count() -1;
        }
+       outputFormatCO->setCurrentIndex(index);
 
        outputFormatCO->blockSignals(false);
 }