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
7ff7878c
Commit
7ff7878c
authored
Aug 03, 2010
by
Roberto Raggi
Browse files
Compare the char formats.
parent
7028b951
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/plugins/texteditor/syntaxhighlighter.cpp
View file @
7ff7878c
...
...
@@ -687,6 +687,21 @@ QTextBlock SyntaxHighlighter::currentBlock() const
return
d
->
currentBlock
;
}
static
bool
isSimilarCharFormat
(
const
QTextCharFormat
&
format
,
const
QTextCharFormat
&
other
)
{
if
(
format
.
foreground
()
!=
other
.
foreground
())
return
false
;
else
if
(
format
.
background
()
!=
other
.
background
())
return
false
;
else
if
(
format
.
underlineStyle
()
!=
other
.
underlineStyle
())
return
false
;
else
if
(
format
.
underlineColor
()
!=
other
.
underlineColor
())
return
false
;
else
if
(
format
.
font
()
!=
other
.
font
())
return
false
;
return
true
;
}
void
SyntaxHighlighter
::
setExtraAdditionalFormats
(
const
QTextBlock
&
block
,
const
QList
<
QTextLayout
::
FormatRange
>
&
formats
)
{
...
...
@@ -712,7 +727,8 @@ void SyntaxHighlighter::setExtraAdditionalFormats(const QTextBlock& block,
if
(
it
->
format
.
property
(
QTextFormat
::
UserProperty
).
toBool
())
{
if
(
skip
<
formats
.
size
()
&&
it
->
start
==
formats
.
at
(
skip
).
start
&&
it
->
length
==
formats
.
at
(
skip
).
length
)
{
&&
it
->
length
==
formats
.
at
(
skip
).
length
&&
isSimilarCharFormat
(
it
->
format
,
formats
.
at
(
skip
).
format
))
{
++
skip
;
++
it
;
}
else
{
...
...
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