From: Richard Heck Date: Wed, 19 Oct 2016 21:28:51 +0000 (-0400) Subject: Since we're now caching this, we can sort it once, rather than X-Git-Tag: 2.3.0alpha1~835 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=7fd1a14c1b048b0b0f92239e84d0b3397a2fde24;p=features.git Since we're now caching this, we can sort it once, rather than lots of times. --- diff --git a/src/BufferParams.cpp b/src/BufferParams.cpp index 72239d8eac..dab711d047 100644 --- a/src/BufferParams.cpp +++ b/src/BufferParams.cpp @@ -2426,6 +2426,7 @@ vector 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; diff --git a/src/frontends/qt4/GuiDocument.cpp b/src/frontends/qt4/GuiDocument.cpp index 09d926029b..a3002f0bba 100644 --- a/src/frontends/qt4/GuiDocument.cpp +++ b/src/frontends/qt4/GuiDocument.cpp @@ -2561,8 +2561,8 @@ void GuiDocument::updateDefaultFormat() outputModule->defaultFormatCO->clear(); outputModule->defaultFormatCO->addItem(qt_("Default"), QVariant(QString("default"))); - vector formats = param_copy.exportableFormats(true); - sort(formats.begin(), formats.end(), Format::formatSorter); + vector const & formats = + param_copy.exportableFormats(true); for (Format const * f : formats) outputModule->defaultFormatCO->addItem (toqstr(translateIfPossible(f->prettyname())), diff --git a/src/frontends/qt4/Menus.cpp b/src/frontends/qt4/Menus.cpp index da1160a185..16182e6935 100644 --- a/src/frontends/qt4/Menus.cpp +++ b/src/frontends/qt4/Menus.cpp @@ -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);