aboutsummaryrefslogtreecommitdiffstats
path: root/src/libs/utils/changeset.cpp
diff options
context:
space:
mode:
authorDavid Schulz <david.schulz@qt.io>2023-07-04 11:15:26 +0200
committerDavid Schulz <david.schulz@qt.io>2023-07-04 10:46:40 +0000
commit81e8c67686f634a56ef58ad736e9ea72cedfbbab (patch)
treeb8235fa7a5d76d3ca47c6b8ff2f633b3f741764e /src/libs/utils/changeset.cpp
parente1c97d4e4796e87bc1acc782f430f67000151e67 (diff)
Utils: add convenience function to ChangeSet
Creating a QTextCursor just for the ChangeSet gives no benefit for the calling code, but reduces the readability. Change-Id: I34acb6083b6f7ab54fce042e29cd6e80498338ef Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Diffstat (limited to 'src/libs/utils/changeset.cpp')
-rw-r--r--src/libs/utils/changeset.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/libs/utils/changeset.cpp b/src/libs/utils/changeset.cpp
index fa4e6696431..b5d3dc2f93a 100644
--- a/src/libs/utils/changeset.cpp
+++ b/src/libs/utils/changeset.cpp
@@ -318,6 +318,12 @@ void ChangeSet::apply(QTextCursor *textCursor)
m_cursor = nullptr;
}
+void ChangeSet::apply(QTextDocument *document)
+{
+ QTextCursor c(document);
+ apply(&c);
+}
+
QString ChangeSet::textAt(int pos, int length)
{
if (m_string) {