forked from qt-creator/qt-creator
Qt6: Adapt to removed QMap functionality
QMap::iterator::operator+() was removed in 14090760a8, necessitating extra code using std::next/prev to workaround. QMap::unite is gone, the replacement QMap::insert was only introduced in 5.15. QMap key values need to have an operator==() available. Task-number: QTCREATORBUG-24098 Change-Id: Ic4cf429ab18cad58b1218180de40eb65586afd77 Reviewed-by: Marco Bubke <marco.bubke@qt.io>
This commit is contained in:
@@ -267,7 +267,7 @@ static void insertPosition(QMap<int, int> *map, int position)
|
||||
|
||||
bool gluedWithPrev = false;
|
||||
if (itNext != map->begin()) {
|
||||
auto itPrev = itNext - 1;
|
||||
auto itPrev = std::prev(itNext);
|
||||
const int keyStart = itPrev.key();
|
||||
const int keyEnd = itPrev.value();
|
||||
if (position >= keyStart && position <= keyEnd)
|
||||
@@ -285,7 +285,7 @@ static void insertPosition(QMap<int, int> *map, int position)
|
||||
itNext = map->erase(itNext);
|
||||
if (gluedWithPrev) {
|
||||
// glue with prev and next
|
||||
auto itPrev = itNext - 1;
|
||||
auto itPrev = std::prev(itNext);
|
||||
*itPrev = keyEnd;
|
||||
} else {
|
||||
// glue with next
|
||||
|
||||
Reference in New Issue
Block a user