]> git.lyx.org Git - features.git/commitdiff
Since we're now caching this, we can sort it once, rather than
authorRichard Heck <rgheck@lyx.org>
Wed, 19 Oct 2016 21:28:51 +0000 (17:28 -0400)
committerRichard Heck <rgheck@lyx.org>
Fri, 21 Oct 2016 03:07:13 +0000 (23:07 -0400)
lots of times.

src/BufferParams.cpp
src/frontends/qt4/GuiDocument.cpp
src/frontends/qt4/Menus.cpp

index 72239d8eacb52028aca465cc973617789a84de64..dab711d047782467c0a9bfc773d02870198708c8 100644 (file)
@@ -2426,6 +2426,7 @@ vector<Format const *> const & BufferParams::exportableFormats(bool only_viewabl
                        theConverters().getReachable(*it, only_viewable, false, excludes);
                result.insert(result.end(), r.begin(), r.end());
        }
+       sort(result.begin(), result.end(), Format::formatSorter);
        cached = result;
        valid = true;
        return cached;
index 09d926029bf43944a598f52bf564cc2b633d4cad..a3002f0bbad7c654b67447da4c7cec1fc2cbcc7b 100644 (file)
@@ -2561,8 +2561,8 @@ void GuiDocument::updateDefaultFormat()
        outputModule->defaultFormatCO->clear();
        outputModule->defaultFormatCO->addItem(qt_("Default"),
                                QVariant(QString("default")));
-       vector<Format const *> formats = param_copy.exportableFormats(true);
-       sort(formats.begin(), formats.end(), Format::formatSorter);
+       vector<Format const *> const & formats =
+                               param_copy.exportableFormats(true);
        for (Format const * f : formats)
                outputModule->defaultFormatCO->addItem
                        (toqstr(translateIfPossible(f->prettyname())),
index da1160a18598210e7754db7c113f1e3e0a5ac13b..16182e6935302fa0107edbd169e73ff8e4e46e81 100644 (file)
@@ -1051,7 +1051,6 @@ void MenuDefinition::expandFormats(MenuItem::Kind const kind, Buffer const * buf
                LATTEST(false);
                return;
        }
-       sort(formats.begin(), formats.end(), Format::formatSorter);
 
        bool const view_update = (kind == MenuItem::ViewFormats
                        || kind == MenuItem::UpdateFormats);