]> git.lyx.org Git - features.git/commitdiff
Restore fix for constant resetting of View>Source widget (bug #8411).
authorRichard Heck <rgheck@lyx.org>
Sat, 10 Nov 2012 02:04:10 +0000 (21:04 -0500)
committerRichard Heck <rgheck@lyx.org>
Sun, 11 Nov 2012 20:41:47 +0000 (15:41 -0500)
src/frontends/qt4/GuiViewSource.cpp
status.20x

index 83114eb7f237e39dc5576461d765a769e88dc40a..53a63ad4ae0fce018cc6768f7badf53469da2c39 100644 (file)
@@ -197,6 +197,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();
@@ -206,12 +207,15 @@ void ViewSourceWidget::updateDefaultFormat()
                if (!fmt) {
                        LYXERR0("Can't find format for backend " << format << "!");
                        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);
 }
index 01f9fcd70013227dd76fc5858b40d05887747c1e..9993101c84024eed9b8afa833f668f4516aa8f14 100644 (file)
@@ -58,6 +58,9 @@ What's new
 
 * USER INTERFACE
 
+- Fix regression in which clicking in the main work area always resets
+  the selected format in View>Source (bug #8411).
+  
 - When selecting text and Insert > Preview, immediately display the
   preview (bug #8075).