forked from qt-creator/qt-creator
Diff Editor: Fix compilation with Qt < 5.2.
Change-Id: I95401ed010e41341eb25bba032b924765b2c1be5 Reviewed-by: Christian Stenger <christian.stenger@digia.com>
This commit is contained in:
@@ -309,9 +309,11 @@ void addChangedPositions(int positionOffset, const QMap<int, int> &originalChang
|
|||||||
const int endPos = it.value();
|
const int endPos = it.value();
|
||||||
const int newStartPos = startPos < 0 ? -1 : startPos + positionOffset;
|
const int newStartPos = startPos < 0 ? -1 : startPos + positionOffset;
|
||||||
const int newEndPos = endPos < 0 ? -1 : endPos + positionOffset;
|
const int newEndPos = endPos < 0 ? -1 : endPos + positionOffset;
|
||||||
if (startPos < 0 && !changedPositions->isEmpty())
|
if (startPos < 0 && !changedPositions->isEmpty()) {
|
||||||
changedPositions->insert(changedPositions->lastKey(), newEndPos);
|
QMap<int, int>::iterator last = changedPositions->end();
|
||||||
else
|
--last;
|
||||||
|
last.value() = newEndPos;
|
||||||
|
} else
|
||||||
changedPositions->insert(newStartPos, newEndPos);
|
changedPositions->insert(newStartPos, newEndPos);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user