From: Guillaume MM Date: Mon, 1 May 2017 22:28:22 +0000 (+0200) Subject: Cosmetic X-Git-Tag: 2.3.0beta1~470 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=6b64d462efc3b9c71204610f74ee9285da3d7210;p=features.git Cosmetic --- diff --git a/src/frontends/qt4/GuiViewSource.cpp b/src/frontends/qt4/GuiViewSource.cpp index 03b7d60b8f..d58e173837 100644 --- a/src/frontends/qt4/GuiViewSource.cpp +++ b/src/frontends/qt4/GuiViewSource.cpp @@ -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 tmp = bv.buffer().params().backends(); - vector::const_iterator it = tmp.begin(); - vector::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;