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);