From: Juergen Spitzmueller Date: Sun, 17 May 2015 14:47:40 +0000 (+0200) Subject: Factor out ColorSorter to qt_helpers, to make it X-Git-Tag: 2.2.0alpha1~789 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=8fc637103fde2d864c2104a2f491aa1fd91006c9;p=lyx.git Factor out ColorSorter to qt_helpers, to make it available to other dialogs as well. --- diff --git a/src/frontends/qt4/GuiPrefs.cpp b/src/frontends/qt4/GuiPrefs.cpp index a9917e43a6..fd1b70e1e6 100644 --- a/src/frontends/qt4/GuiPrefs.cpp +++ b/src/frontends/qt4/GuiPrefs.cpp @@ -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) diff --git a/src/frontends/qt4/qt_helpers.h b/src/frontends/qt4/qt_helpers.h index defd1a827f..4b4796777b 100644 --- a/src/frontends/qt4/qt_helpers.h +++ b/src/frontends/qt4/qt_helpers.h @@ -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)