From 774d74df91869d1178cbcdc7648994576a47f850 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9rgio=20Martins?= Date: Wed, 25 Sep 2013 15:29:37 +0100 Subject: Fix WinCE/MSVC2008 build errors related to std::lower_bound patches. See QTBUG-33473 for more information about this compiler bug. Change-Id: I13b945350fdc38165c1515f0cdd75a53cf37cd6c Reviewed-by: Giuseppe D'Angelo --- src/corelib/io/qurlidna.cpp | 5 +++++ src/gui/image/qxpmhandler.cpp | 5 +++++ src/gui/painting/qcolor_p.cpp | 5 +++++ src/gui/text/qcssparser.cpp | 7 +++++++ src/gui/text/qfontsubset_agl.cpp | 5 +++++ src/gui/text/qtexthtmlparser.cpp | 13 +++++++++++++ 6 files changed, 40 insertions(+) diff --git a/src/corelib/io/qurlidna.cpp b/src/corelib/io/qurlidna.cpp index ee95e590f9..988d076025 100644 --- a/src/corelib/io/qurlidna.cpp +++ b/src/corelib/io/qurlidna.cpp @@ -61,6 +61,11 @@ struct NameprepCaseFoldingEntry { ushort mapping[4]; }; +#if defined(Q_CC_MSVC) && _MSC_VER < 1600 +inline bool operator<(const NameprepCaseFoldingEntry &one, const NameprepCaseFoldingEntry &other) +{ return one.uc < other.uc; } +#endif + inline bool operator<(uint one, const NameprepCaseFoldingEntry &other) { return one < other.uc; } diff --git a/src/gui/image/qxpmhandler.cpp b/src/gui/image/qxpmhandler.cpp index 528bd4ebb1..5edb866b62 100644 --- a/src/gui/image/qxpmhandler.cpp +++ b/src/gui/image/qxpmhandler.cpp @@ -742,6 +742,11 @@ static const struct XPMRGBData { { QRGB(139,139, 0), "yellow4" }, { QRGB(154,205, 50), "yellowgreen" } }; +#if defined(Q_CC_MSVC) && _MSC_VER < 1600 +inline bool operator<(const XPMRGBData &data1, const XPMRGBData &data2) +{ return qstrcmp(data1.name, data2.name) < 0; } +#endif + inline bool operator<(const char *name, const XPMRGBData &data) { return qstrcmp(name, data.name) < 0; } inline bool operator<(const XPMRGBData &data, const char *name) diff --git a/src/gui/painting/qcolor_p.cpp b/src/gui/painting/qcolor_p.cpp index 3f6326fcbe..72b6279b2f 100644 --- a/src/gui/painting/qcolor_p.cpp +++ b/src/gui/painting/qcolor_p.cpp @@ -289,6 +289,11 @@ static const int rgbTblSize = sizeof(rgbTbl) / sizeof(RGBData); #undef rgb +#if defined(Q_CC_MSVC) && _MSC_VER < 1600 +inline bool operator<(const RGBData &data1, const RGBData &data2) +{ return qstrcmp(data1.name, data2.name) < 0; } +#endif + inline bool operator<(const char *name, const RGBData &data) { return qstrcmp(name, data.name) < 0; } inline bool operator<(const RGBData &data, const char *name) diff --git a/src/gui/text/qcssparser.cpp b/src/gui/text/qcssparser.cpp index 7a96fbe88b..9c7a57df3d 100644 --- a/src/gui/text/qcssparser.cpp +++ b/src/gui/text/qcssparser.cpp @@ -347,6 +347,13 @@ static const QCssKnownValue styleFeatures[NumKnownStyleFeatures - 1] = { { "none", StyleFeature_None } }; +#if defined(Q_CC_MSVC) && _MSC_VER < 1600 +Q_STATIC_GLOBAL_OPERATOR bool operator<(const QCssKnownValue &prop1, const QCssKnownValue &prop2) +{ + return QString::compare(QString::fromLatin1(prop1.name), QLatin1String(prop2.name), Qt::CaseInsensitive) < 0; +} +#endif + Q_STATIC_GLOBAL_OPERATOR bool operator<(const QString &name, const QCssKnownValue &prop) { return QString::compare(name, QLatin1String(prop.name), Qt::CaseInsensitive) < 0; diff --git a/src/gui/text/qfontsubset_agl.cpp b/src/gui/text/qfontsubset_agl.cpp index 194ecb7ab5..a2c8f7b0a0 100644 --- a/src/gui/text/qfontsubset_agl.cpp +++ b/src/gui/text/qfontsubset_agl.cpp @@ -125,6 +125,11 @@ struct AGLEntry { unsigned short index; }; +#if defined(Q_CC_MSVC) && _MSC_VER < 1600 +inline bool operator<(AGLEntry entry1, AGLEntry entry2) +{ return entry1.uc < entry2.uc; } +#endif + inline bool operator<(unsigned short uc, AGLEntry entry) { return uc < entry.uc; } inline bool operator<(AGLEntry entry, unsigned short uc) diff --git a/src/gui/text/qtexthtmlparser.cpp b/src/gui/text/qtexthtmlparser.cpp index c177fa0810..952cebcc1b 100644 --- a/src/gui/text/qtexthtmlparser.cpp +++ b/src/gui/text/qtexthtmlparser.cpp @@ -324,6 +324,13 @@ static const struct QTextHtmlEntity { const char *name; quint16 code; } entities { "zwnj", 0x200c } }; +#if defined(Q_CC_MSVC) && _MSC_VER < 1600 +bool operator<(const QTextHtmlEntity &entity1, const QTextHtmlEntity &entity2) +{ + return QLatin1String(entity1.name) < QLatin1String(entity2.name); +} +#endif + Q_STATIC_GLOBAL_OPERATOR bool operator<(const QString &entityStr, const QTextHtmlEntity &entity) { return entityStr < QLatin1String(entity.name); @@ -443,6 +450,12 @@ static const QTextHtmlElement elements[Html_NumElements]= { { "var", Html_var, QTextHtmlElement::DisplayInline }, }; +#if defined(Q_CC_MSVC) && _MSC_VER < 1600 +Q_STATIC_GLOBAL_OPERATOR bool operator<(const QTextHtmlElement &e1, const QTextHtmlElement &e2) +{ + return QLatin1String(e1.name) < QLatin1String(e2.name); +} +#endif Q_STATIC_GLOBAL_OPERATOR bool operator<(const QString &str, const QTextHtmlElement &e) { -- cgit v1.2.3