Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Marco Bubke
flatpak-qt-creator
Commits
7cffef17
Commit
7cffef17
authored
Nov 04, 2009
by
Roberto Raggi
Browse files
Paranoia check. Skip the change if we have another change with the same offset.
parent
6043c639
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/plugins/cpptools/cppfindreferences.cpp
View file @
7cffef17
...
...
@@ -249,7 +249,21 @@ static void applyChanges(QTextDocument *doc, const QString &text, const QList<Fi
foreach
(
const
Find
::
SearchResultItem
&
item
,
items
)
{
const
int
blockNumber
=
item
.
lineNumber
-
1
;
QTextCursor
tc
(
doc
->
findBlockByNumber
(
blockNumber
));
tc
.
setPosition
(
tc
.
position
()
+
item
.
searchTermStart
);
const
int
cursorPosition
=
tc
.
position
()
+
item
.
searchTermStart
;
int
cursorIndex
=
0
;
for
(;
cursorIndex
<
cursors
.
size
();
++
cursorIndex
)
{
const
QTextCursor
&
tc
=
cursors
.
at
(
cursorIndex
);
if
(
tc
.
position
()
==
cursorPosition
)
break
;
}
if
(
cursorIndex
!=
cursors
.
size
())
continue
;
// skip this change.
tc
.
setPosition
(
cursorPosition
);
tc
.
setPosition
(
tc
.
position
()
+
item
.
searchTermLength
,
QTextCursor
::
KeepAnchor
);
cursors
.
append
(
tc
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment