]> git.lyx.org Git - features.git/commitdiff
Cosmetic
authorGuillaume MM <gm@lyx.org>
Mon, 1 May 2017 22:28:22 +0000 (00:28 +0200)
committerGuillaume MM <gm@lyx.org>
Sat, 6 May 2017 22:07:24 +0000 (00:07 +0200)
src/frontends/qt4/GuiViewSource.cpp

index 03b7d60b8f9baca8a569ab86444b8b677d72b6c7..d58e173837a37ade140fece22c7d81f379c665a5 100644 (file)
@@ -335,24 +335,19 @@ void ViewSourceWidget::updateDefaultFormat(BufferView const & bv)
        QSignalBlocker blocker(outputFormatCO);
        outputFormatCO->clear();
        outputFormatCO->addItem(qt_("Default"),
-                               QVariant(QString("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();
-       for (; it != en; ++it) {
-               string const format = *it;
-               Format const * fmt = theFormats().getFormat(format);
+       for (string const & fmt_name : bv.buffer().params().backends()) {
+               Format const * fmt = theFormats().getFormat(fmt_name);
                if (!fmt) {
-                       LYXERR0("Can't find format for backend " << format << "!");
+                       LYXERR0("Can't find format for backend " << fmt_name << "!");
                        continue;
-               } 
-
+               }
                QString const pretty = toqstr(translateIfPossible(fmt->prettyname()));
-               outputFormatCO->addItem(pretty, QVariant(toqstr(format)));
-               if (format == view_format_)
-                  index = outputFormatCO->count() -1;
+               outputFormatCO->addItem(pretty, QVariant(toqstr(fmt_name)));
+               if (fmt_name == view_format_)
+                       index = outputFormatCO->count() - 1;
        }
        setViewFormat(index);
 }
@@ -370,6 +365,7 @@ void ViewSourceWidget::resizeEvent (QResizeEvent * event)
        QWidget::resizeEvent(event);
 }
 
+
 void ViewSourceWidget::saveSession(QString const & session_key) const
 {
        QSettings settings;