]> git.lyx.org Git - lyx.git/commitdiff
Factor out ColorSorter to qt_helpers, to make it
authorJuergen Spitzmueller <spitz@lyx.org>
Sun, 17 May 2015 14:47:40 +0000 (16:47 +0200)
committerJuergen Spitzmueller <spitz@lyx.org>
Sun, 17 May 2015 14:47:40 +0000 (16:47 +0200)
available to other dialogs as well.

src/frontends/qt4/GuiPrefs.cpp
src/frontends/qt4/qt_helpers.h

index a9917e43a680e50e3c30eea061291cba344f5edd..fd1b70e1e6cc0cb7281d78222605cb45498bfb09 100644 (file)
@@ -1095,17 +1095,6 @@ void PrefScreenFonts::selectTypewriter(const QString & name)
 //
 /////////////////////////////////////////////////////////////////////
 
-namespace {
-
-struct ColorSorter
-{
-       bool operator()(ColorCode lhs, ColorCode rhs) const {
-               return
-                       compare_no_case(lcolor.getGUIName(lhs), lcolor.getGUIName(rhs)) < 0;
-       }
-};
-
-} // namespace anon
 
 PrefColors::PrefColors(GuiPreferences * form)
        : PrefModule(catLookAndFeel, N_("Colors"), form)
index defd1a827fd47a46b4e61194baf22f3507e392b5..4b4796777b51d01858f4f02b2d938e95813d6771 100644 (file)
@@ -13,7 +13,9 @@
 #ifndef QTHELPERS_H
 #define QTHELPERS_H
 
+#include "ColorSet.h"
 #include "Length.h"
+#include "support/lstrings.h"
 #include "support/qstring_helpers.h"
 #include "support/filetools.h"
 #include "qt_i18n.h"
@@ -37,6 +39,12 @@ namespace frontend {
 
 class LengthCombo;
 
+struct ColorSorter {
+       bool operator()(ColorCode lhs, ColorCode rhs) const {
+               return  support::compare_no_case(lcolor.getGUIName(lhs), lcolor.getGUIName(rhs)) < 0;
+       }
+};
+
 /// method to get a Length from widgets (LengthCombo)
 std::string widgetsToLength(QLineEdit const * input, LengthCombo const * combo);
 /// method to get a Length from widgets (QComboBox)