]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/controllers/frontend_helpers.cpp
Fixed some lines that were too long. It compiled afterwards.
[lyx.git] / src / frontends / controllers / frontend_helpers.cpp
index a272eb23092f7091e54ad3977f63b1f2a4f2c651..25c1434641dfdca00f8c7db0d8e28c8a1a007a13 100644 (file)
@@ -40,7 +40,6 @@
 
 #include <algorithm>
 #include <fstream>
-#include <locale>
 
 using std::string;
 using std::vector;
@@ -1108,20 +1107,20 @@ class Sorter
                                      LanguagePair, bool>
 {
 public:
-#if !defined(USE_WCHAR_T) && defined(__GNUC__)
        bool operator()(LanguagePair const & lhs,
                        LanguagePair const & rhs) const {
                return lhs.first < rhs.first;
        }
-#else
-       Sorter() : loc_("") {};
-       bool operator()(LanguagePair const & lhs,
-                       LanguagePair const & rhs) const {
-               return loc_(lhs.first, rhs.first);
+};
+
+
+class ColorSorter
+{
+public:
+       bool operator()(Color::color const & lhs,
+                       Color::color const & rhs) const {
+               return lcolor.getGUIName(lhs) < lcolor.getGUIName(rhs);
        }
-private:
-       std::locale loc_;
-#endif
 };
 
 } // namespace anon
@@ -1158,6 +1157,14 @@ vector<LanguagePair> const getLanguageData(bool character_dlg)
        return langs;
 }
 
+
+vector<Color_color> const getSortedColors(vector<Color_color> colors)
+{
+       // sort the colors
+       std::sort(colors.begin(), colors.end(), ColorSorter());
+       return colors;
+}
+
 } // namespace frontend
 
 using support::addName;