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();
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
};
}
return r;
}
-static inline bool firstFramePosLessThanCursorPos(QTextFrame *frame, int position)
-{
- return frame->firstPosition() < position;
-}
-
-static inline bool cursorPosLessThanLastFramePos(int position, QTextFrame *frame)
-{
- return position < frame->lastPosition();
+namespace {
+struct QTextFrameComparator {
+#if defined(Q_CC_MSVC) && _MSC_VER < 1600
+//The STL implementation of MSVC 2008 requires the definition
+ bool operator()(QTextFrame *frame1, QTextFrame *frame2) { return frame1->firstPosition() < frame2->firstPosition(); }
+#endif
+ bool operator()(QTextFrame *frame, int position) { return frame->firstPosition() < position; }
+ bool operator()(int position, QTextFrame *frame) { return position < frame->firstPosition(); }
+};
}
static QRectF boundingRectOfFloatsInSelection(const QTextCursor &cursor)
const QList<QTextFrame *> children = frame->childFrames();
const QList<QTextFrame *>::ConstIterator firstFrame = std::lower_bound(children.constBegin(), children.constEnd(),
- cursor.selectionStart(), firstFramePosLessThanCursorPos);
+ cursor.selectionStart(), QTextFrameComparator());
const QList<QTextFrame *>::ConstIterator lastFrame = std::upper_bound(children.constBegin(), children.constEnd(),
- cursor.selectionEnd(), cursorPosLessThanLastFramePos);
+ cursor.selectionEnd(), QTextFrameComparator());
for (QList<QTextFrame *>::ConstIterator it = firstFrame; it != lastFrame; ++it) {
if ((*it)->frameFormat().position() != QTextFrameFormat::InFlow)
r |= frame->document()->documentLayout()->frameBoundingRect(*it);