]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/GuiExternal.cpp
Some improvements to the graphics dialog
[lyx.git] / src / frontends / qt4 / GuiExternal.cpp
index f940a7301006fe1041409aa6a38f790d6593b619..f994aafaefc9b359c2e4b449602833d974786abb 100644 (file)
@@ -80,7 +80,7 @@ char const * const origin_gui_strs[] = {
        N_("Top right"), N_("Bottom right"), N_("Baseline right")
 };
 
-} // namespace anon
+} // namespace
 
 
 GuiExternal::GuiExternal(GuiView & lv)
@@ -202,10 +202,16 @@ GuiExternal::GuiExternal(GuiView & lv)
        external::TemplateManager::Templates::const_iterator i1, i2;
        i1 = external::TemplateManager::get().getTemplates().begin();
        i2 = external::TemplateManager::get().getTemplates().end();
+       QMap<QString, QString> localizedTemplates;
        for (; i1 != i2; ++i1)
-               externalCO->addItem(qt_(i1->second.guiName), toqstr(i1->second.lyxName));
-       // Sort alphabetically by(localized) GUI name
-       externalCO->model()->sort(0);
+               localizedTemplates.insert(qt_(i1->second.guiName), toqstr(i1->second.lyxName));
+       // Sort alphabetically by (localized) GUI name
+       QStringList keys = localizedTemplates.keys();
+       qSort(keys.begin(), keys.end(), SortLocaleAware);
+       for (QString & key : keys) {
+               QString const value = localizedTemplates[key];
+               externalCO->addItem(key, value);
+       }
 
        // Fill the origins combo
        for (size_t i = 0; i != sizeof(origins) / sizeof(origins[0]); ++i)