Utils: remove now unused Utils::Text::Replacement

They have been completely replaced by Utils::ChangeSet.

Change-Id: I857816c1b2730699ba481da2e271dde358f394f3
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
David Schulz
2023-07-04 10:56:11 +02:00
parent 4743724d4c
commit 13ccc24a35
2 changed files with 0 additions and 39 deletions

View File

@@ -252,26 +252,6 @@ bool utf8AdvanceCodePoint(const char *&current)
return true;
}
void applyReplacements(QTextDocument *doc, const Replacements &replacements)
{
if (replacements.empty())
return;
int fullOffsetShift = 0;
QTextCursor editCursor(doc);
editCursor.beginEditBlock();
for (const Text::Replacement &replacement : replacements) {
editCursor.setPosition(replacement.offset + fullOffsetShift);
editCursor.movePosition(QTextCursor::NextCharacter,
QTextCursor::KeepAnchor,
replacement.length);
editCursor.removeSelectedText();
editCursor.insertText(replacement.text);
fullOffsetShift += replacement.text.length() - replacement.length;
}
editCursor.endEditBlock();
}
QDebug &operator<<(QDebug &stream, const Position &pos)
{
stream << "line: " << pos.line << ", column: " << pos.column;