diff options
author | Thomas Hartmann <Thomas.Hartmann@digia.com> | 2012-10-02 16:50:01 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2012-10-04 11:58:48 +0200 |
commit | 1fb3d849e426fafcd5af30ce8ee6a00a10891746 (patch) | |
tree | 524abcda43eb0e536153958baf01d2a20ab01271 /src/gui | |
parent | 642867d2ddae37bdf756e1466ba723b6b7f4e844 (diff) |
compile fix for MSVC 2008 and std::upper_bound
qUpperBound was replaced by std::upper_bound.
Unfortunately the STL of MSVC 2008 enforces
the definition of the operator in both
directions.
Change-Id: I3e0f775c23e43332d106e0847d3611e488da6c06
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/text/qtextdocumentlayout.cpp | 20 | ||||
-rw-r--r-- | src/gui/text/qtextengine.cpp | 5 |
2 files changed, 24 insertions, 1 deletions
diff --git a/src/gui/text/qtextdocumentlayout.cpp b/src/gui/text/qtextdocumentlayout.cpp index 15177dd90e..9b77c9c382 100644 --- a/src/gui/text/qtextdocumentlayout.cpp +++ b/src/gui/text/qtextdocumentlayout.cpp @@ -401,6 +401,26 @@ Q_STATIC_GLOBAL_OPERATOR 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 + +Q_STATIC_GLOBAL_OPERATOR bool operator<(const QCheckPoint &checkPoint2, const QCheckPoint &checkPoint1) +{ + return checkPoint1.y < checkPoint2.y; +} + +Q_STATIC_GLOBAL_OPERATOR bool operator<(QFixed y, const QCheckPoint &checkPoint) +{ + return y < checkPoint.y; +} + +Q_STATIC_GLOBAL_OPERATOR 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, QRectF gradientRect = QRectF()) { p->save(); diff --git a/src/gui/text/qtextengine.cpp b/src/gui/text/qtextengine.cpp index 0c90589024..8527a85369 100644 --- a/src/gui/text/qtextengine.cpp +++ b/src/gui/text/qtextengine.cpp @@ -2540,7 +2540,10 @@ namespace { struct QScriptItemComparator { bool operator()(const QScriptItem &a, const QScriptItem &b) { return a.position < b.position; } bool operator()(int p, const QScriptItem &b) { return p < b.position; } - //bool operator()(const QScriptItem &a, int p) { return a.position < p; } +#if defined(Q_CC_MSVC) && _MSC_VER < 1600 +//The STL implementation of MSVC 2008 requires the definition + bool operator()(const QScriptItem &a, int p) { return a.position < p; } +#endif }; } |