diff options
Diffstat (limited to 'src/gui/text/qtextdocument_p.cpp')
| -rw-r--r-- | src/gui/text/qtextdocument_p.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/gui/text/qtextdocument_p.cpp b/src/gui/text/qtextdocument_p.cpp index 3c1fc04d4b6..9ccd01edb0d 100644 --- a/src/gui/text/qtextdocument_p.cpp +++ b/src/gui/text/qtextdocument_p.cpp @@ -17,6 +17,8 @@ #include "qtexttable.h" #include "qtextengine_p.h" +#include <QtCore/q20utility.h> + #include <stdlib.h> QT_BEGIN_NAMESPACE @@ -461,13 +463,13 @@ int QTextDocumentPrivate::remove_string(int pos, uint length, QTextUndoCommand:: { Q_ASSERT(pos >= 0); Q_ASSERT(blocks.length() == fragments.length()); - Q_ASSERT(blocks.length() >= pos+(int)length); + Q_ASSERT(q20::cmp_greater_equal(blocks.length(), pos+length)); int b = blocks.findNode(pos); uint x = fragments.findNode(pos); Q_ASSERT(blocks.size(b) > length); - Q_ASSERT(x && fragments.position(x) == (uint)pos && fragments.size(x) == length); + Q_ASSERT(x && q20::cmp_equal(fragments.position(x), pos) && fragments.size(x) == length); Q_ASSERT(noBlockInString(QStringView{text}.mid(fragments.fragment(x)->stringPosition, length))); blocks.setSize(b, blocks.size(b)-length); @@ -725,7 +727,7 @@ void QTextDocumentPrivate::setCharFormat(int pos, int length, const QTextCharFor appendUndoItem(c); pos += length; - Q_ASSERT(pos == (int)(it.position() + fragment->size_array[0]) || pos >= endPos); + Q_ASSERT(q20::cmp_equal(pos, (it.position() + fragment->size_array[0])) || pos >= endPos); } int n = fragments.findNode(startPos - 1); @@ -1036,7 +1038,7 @@ void QTextDocumentPrivate::appendUndoItem(const QTextUndoCommand &c) clearUndoRedoStacks(QTextDocument::RedoStack); if (editBlock != 0 && editBlockCursorPosition >= 0) { // we had a beginEditBlock() with a cursor position - if (c.pos != (quint32) editBlockCursorPosition) { // and that cursor position is different from the command + if (q20::cmp_not_equal(c.pos, editBlockCursorPosition)) { // and that cursor position is different from the command // generate a CursorMoved undo item QT_INIT_TEXTUNDOCOMMAND(cc, QTextUndoCommand::CursorMoved, true, QTextUndoCommand::MoveCursor, 0, 0, editBlockCursorPosition, 0, 0); |
