Token::move|replace: update progressValues correctly.
This commit is contained in:
parent
b8faee9d30
commit
3a2ba173ac
@ -194,6 +194,11 @@ void Token::replace(Token *replaceThis, Token *start, Token *end)
|
|||||||
*(end->tokensBack) = end;
|
*(end->tokensBack) = end;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Update _progressValue
|
||||||
|
for (Token *tok = start; tok != end->next(); tok = tok->next()) {
|
||||||
|
tok->_progressValue = replaceThis->_progressValue;
|
||||||
|
}
|
||||||
|
|
||||||
// Delete old token, which is replaced
|
// Delete old token, which is replaced
|
||||||
delete replaceThis;
|
delete replaceThis;
|
||||||
}
|
}
|
||||||
@ -778,7 +783,7 @@ void Token::move(Token *srcStart, Token *srcEnd, Token *newLocation)
|
|||||||
newLocation->next(srcStart);
|
newLocation->next(srcStart);
|
||||||
|
|
||||||
// Update _progressValue
|
// Update _progressValue
|
||||||
for (Token *tok = srcStart; tok && tok != srcEnd; tok = tok->next())
|
for (Token *tok = srcStart; tok != srcEnd->next(); tok = tok->next())
|
||||||
tok->_progressValue = newLocation->_progressValue;
|
tok->_progressValue = newLocation->_progressValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user