From a468a0541a41a4ef09156843ccea1130dd9014b8 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Thu, 4 Jan 2018 14:24:32 +0100 Subject: QtGui: Raise minimum supported MSVC version to 2015 Remove code for older versions and streamline #ifdefs. Task-number: QTBUG-51673 Change-Id: I841f1880371db79723747fb9686ba466fd66c26f Reviewed-by: Konstantin Ritt Reviewed-by: Oliver Wolff Reviewed-by: Eskil Abrahamsen Blomfeldt --- src/gui/image/qxbmhandler.cpp | 2 +- src/gui/image/qxpmhandler.cpp | 4 ---- src/gui/opengl/qopengl.h | 2 +- src/gui/painting/qcolor.cpp | 5 ----- src/gui/text/qcssparser.cpp | 7 ------- src/gui/text/qtextdocumentlayout.cpp | 20 -------------------- src/gui/text/qtexthtmlparser.cpp | 7 ------- 7 files changed, 2 insertions(+), 45 deletions(-) (limited to 'src/gui') diff --git a/src/gui/image/qxbmhandler.cpp b/src/gui/image/qxbmhandler.cpp index 155a4f88b4..24d86e116d 100644 --- a/src/gui/image/qxbmhandler.cpp +++ b/src/gui/image/qxbmhandler.cpp @@ -241,7 +241,7 @@ static bool write_xbm_image(const QImage &sourceImage, QIODevice *device, const } } } -#if defined(_MSC_VER) && _MSC_VER >= 1400 +#ifdef Q_CC_MSVC strcpy_s(p, sizeof(" };\n"), " };\n"); #else strcpy(p, " };\n"); diff --git a/src/gui/image/qxpmhandler.cpp b/src/gui/image/qxpmhandler.cpp index 9c54b9ada4..17272ffe69 100644 --- a/src/gui/image/qxpmhandler.cpp +++ b/src/gui/image/qxpmhandler.cpp @@ -741,10 +741,6 @@ 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; } diff --git a/src/gui/opengl/qopengl.h b/src/gui/opengl/qopengl.h index b4657fa118..3a2393ea58 100644 --- a/src/gui/opengl/qopengl.h +++ b/src/gui/opengl/qopengl.h @@ -239,7 +239,7 @@ typedef unsigned long long int uint64_t; typedef long int int32_t; typedef long long int int64_t; typedef unsigned long long int uint64_t; -#elif defined(_WIN32) && (defined(__GNUC__) || (defined(_MSC_VER) && _MSC_VER >= 1600)) +#elif defined(_WIN32) && (defined(__GNUC__) || defined(_MSC_VER)) #include #elif defined(_WIN32) typedef __int32 int32_t; diff --git a/src/gui/painting/qcolor.cpp b/src/gui/painting/qcolor.cpp index c55bcb12c9..1d7375d1df 100644 --- a/src/gui/painting/qcolor.cpp +++ b/src/gui/painting/qcolor.cpp @@ -304,11 +304,6 @@ 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 64adeaa260..70623939e1 100644 --- a/src/gui/text/qcssparser.cpp +++ b/src/gui/text/qcssparser.cpp @@ -345,13 +345,6 @@ static const QCssKnownValue styleFeatures[NumKnownStyleFeatures - 1] = { { "none", StyleFeature_None } }; -#if defined(Q_CC_MSVC) && _MSC_VER < 1600 -static bool operator<(const QCssKnownValue &prop1, const QCssKnownValue &prop2) -{ - return QString::compare(QString::fromLatin1(prop1.name), QLatin1String(prop2.name), Qt::CaseInsensitive) < 0; -} -#endif - static bool operator<(const QString &name, const QCssKnownValue &prop) { return QString::compare(name, QLatin1String(prop.name), Qt::CaseInsensitive) < 0; diff --git a/src/gui/text/qtextdocumentlayout.cpp b/src/gui/text/qtextdocumentlayout.cpp index 9877a23fa6..d04dd08058 100644 --- a/src/gui/text/qtextdocumentlayout.cpp +++ b/src/gui/text/qtextdocumentlayout.cpp @@ -399,26 +399,6 @@ static bool operator<(const QCheckPoint &checkPoint, int pos) return checkPoint.positionInFrame < pos; } -#if defined(Q_CC_MSVC) && _MSC_VER < 1600 -//The STL implementation of MSVC 2008 requires the definitions - -static bool operator<(const QCheckPoint &checkPoint1, const QCheckPoint &checkPoint2) -{ - return checkPoint1.y < checkPoint2.y; -} - -static bool operator<(QFixed y, const QCheckPoint &checkPoint) -{ - return y < checkPoint.y; -} - -static bool operator<(int pos, const QCheckPoint &checkPoint) -{ - return pos < checkPoint.positionInFrame; -} - -#endif - static void fillBackground(QPainter *p, const QRectF &rect, QBrush brush, const QPointF &origin, const QRectF &gradientRect = QRectF()) { p->save(); diff --git a/src/gui/text/qtexthtmlparser.cpp b/src/gui/text/qtexthtmlparser.cpp index 9154182df1..4be800b251 100644 --- a/src/gui/text/qtexthtmlparser.cpp +++ b/src/gui/text/qtexthtmlparser.cpp @@ -448,13 +448,6 @@ static const QTextHtmlElement elements[Html_NumElements]= { { "var", Html_var, QTextHtmlElement::DisplayInline }, }; -#if defined(Q_CC_MSVC) && _MSC_VER < 1600 -static bool operator<(const QTextHtmlElement &e1, const QTextHtmlElement &e2) -{ - return QLatin1String(e1.name) < QLatin1String(e2.name); -} -#endif - static bool operator<(const QString &str, const QTextHtmlElement &e) { return str < QLatin1String(e.name); -- cgit v1.2.3