Diff Editor: Fix compilation with Qt < 5.2.

Change-Id: I95401ed010e41341eb25bba032b924765b2c1be5
Reviewed-by: Christian Stenger <christian.stenger@digia.com>
This commit is contained in:
Friedemann Kleint
2014-03-11 20:36:01 +01:00
parent afd7e7608b
commit 35eb3b1560

View File

@@ -309,9 +309,11 @@ void addChangedPositions(int positionOffset, const QMap<int, int> &originalChang
const int endPos = it.value();
const int newStartPos = startPos < 0 ? -1 : startPos + positionOffset;
const int newEndPos = endPos < 0 ? -1 : endPos + positionOffset;
if (startPos < 0 && !changedPositions->isEmpty())
changedPositions->insert(changedPositions->lastKey(), newEndPos);
else
if (startPos < 0 && !changedPositions->isEmpty()) {
QMap<int, int>::iterator last = changedPositions->end();
--last;
last.value() = newEndPos;
} else
changedPositions->insert(newStartPos, newEndPos);
}
}