]> git.lyx.org Git - features.git/commitdiff
Re-defactor ColorSorter.
authorJuergen Spitzmueller <spitz@lyx.org>
Mon, 18 May 2015 09:11:45 +0000 (11:11 +0200)
committerJuergen Spitzmueller <spitz@lyx.org>
Mon, 18 May 2015 09:11:45 +0000 (11:11 +0200)
This hopefully cures Richard's compilation woes.

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

index 24d22ffbf569f9fe61e86985a3b372bfbff6b808..a824df7931386ccd1e3c299fdb7cf73c59f60a2b 100644 (file)
 #include "BufferView.h"
 #include "Color.h"
 #include "ColorCache.h"
+#include "ColorSet.h"
 #include "Cursor.h"
 #include "FuncRequest.h"
 #include "Language.h"
 #include "Paragraph.h"
 
 #include "support/gettext.h"
+#include "support/lstrings.h"
 
 #include <QAbstractItemModel>
 #include <QComboBox>
@@ -190,7 +192,16 @@ void fillComboColor(QComboBox * combo, QList<T> const & list)
        combo->addItem(qt_("Reset"), "inherit");
 }
 
-}
+
+struct ColorSorter
+{
+       bool operator()(ColorCode lhs, ColorCode rhs) const {
+               return
+                       support::compare_no_case(lcolor.getGUIName(lhs), lcolor.getGUIName(rhs)) < 0;
+       }
+};
+
+} // namespace anon
 
 GuiCharacter::GuiCharacter(GuiView & lv)
        : GuiDialog(lv, "character", qt_("Text Style")), font_(ignore_font, ignore_language),
index 9d1455d0c1961042c1d3906663c948e9fdff9ace..1836501f05d47969497feee5de40da4810deaf3e 100644 (file)
@@ -1096,6 +1096,19 @@ 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 4b4796777b51d01858f4f02b2d938e95813d6771..defd1a827fd47a46b4e61194baf22f3507e392b5 100644 (file)
@@ -13,9 +13,7 @@
 #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"
@@ -39,12 +37,6 @@ 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)