From 7f1d33efc1d0b4302875706ba85d42c2a8f35a67 Mon Sep 17 00:00:00 2001 From: Juergen Spitzmueller Date: Mon, 18 May 2015 11:11:45 +0200 Subject: [PATCH] Re-defactor ColorSorter. This hopefully cures Richard's compilation woes. --- src/frontends/qt4/GuiCharacter.cpp | 13 ++++++++++++- src/frontends/qt4/GuiPrefs.cpp | 13 +++++++++++++ src/frontends/qt4/qt_helpers.h | 8 -------- 3 files changed, 25 insertions(+), 9 deletions(-) diff --git a/src/frontends/qt4/GuiCharacter.cpp b/src/frontends/qt4/GuiCharacter.cpp index 24d22ffbf5..a824df7931 100644 --- a/src/frontends/qt4/GuiCharacter.cpp +++ b/src/frontends/qt4/GuiCharacter.cpp @@ -23,12 +23,14 @@ #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 #include @@ -190,7 +192,16 @@ void fillComboColor(QComboBox * combo, QList 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), diff --git a/src/frontends/qt4/GuiPrefs.cpp b/src/frontends/qt4/GuiPrefs.cpp index 9d1455d0c1..1836501f05 100644 --- a/src/frontends/qt4/GuiPrefs.cpp +++ b/src/frontends/qt4/GuiPrefs.cpp @@ -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) { diff --git a/src/frontends/qt4/qt_helpers.h b/src/frontends/qt4/qt_helpers.h index 4b4796777b..defd1a827f 100644 --- a/src/frontends/qt4/qt_helpers.h +++ b/src/frontends/qt4/qt_helpers.h @@ -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) -- 2.39.2