Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
PIM
KPimTextEdit
Commits
f3bcd7ea
Commit
f3bcd7ea
authored
Oct 12, 2021
by
Laurent Montel
😁
Browse files
Add autotest for 443534 (need to investigate it)
parent
70b320a5
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/grantleebuilder/autotests/texthtmlbuildertest.cpp
View file @
f3bcd7ea
...
...
@@ -995,3 +995,29 @@ void TextHTMLBuilderTest::testBugTextColor()
delete
hb
;
delete
doc
;
}
void
TextHTMLBuilderTest
::
testBugIndent443534
()
{
auto
doc
=
new
QTextDocument
();
doc
->
setHtml
(
QStringLiteral
(
"<ul style=
\"
margin-top: 0px; margin-bottom: 0px; margin-right: 0px; -qt-list-indent: 1;
\"
><li style=
\"
margin-top:0px; margin-bottom:0px; "
"margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;
\"
>Test1</li>
\n
<li style=
\"
margin-top:0px; "
"margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;
\"
>Test2</li>
\n
<ul style=
\"
margin-top: "
"0px; margin-bottom: 0px; margin-right: 0px; -qt-list-indent: 2;
\"
><li style=
\"
margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; "
"-qt-block-indent:0; text-indent:0px; -qt-user-state:0;
\"
>Indent1</li></ul>
\n
<li style=
\"
margin-top:0px; margin-bottom:0px; margin-left:0px; "
"margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;
\"
>deindent1</li></ul>"
));
auto
hb
=
new
KPIMTextEdit
::
TextHTMLBuilder
();
auto
md
=
new
KPIMTextEdit
::
MarkupDirector
(
hb
);
md
->
processDocument
(
doc
);
auto
result
=
hb
->
getResult
();
qDebug
()
<<
" result "
<<
result
;
auto
regex
=
QRegularExpression
(
QStringLiteral
(
"^<p style=
\"
margin-top:12;margin-bottom:12;margin-left:0;margin-right:0;
\"
><span style=
\"
color:#ffff00;
\"
>BBBB</span></p>
\n
<p "
"style=
\"
margin-top:12;margin-bottom:12;margin-left:0;margin-right:0;
\"
><span style=
\"
color:#ffff00;
\"
>AAA</span></p>
\n
"
));
QVERIFY
(
regex
.
match
(
result
).
hasMatch
());
delete
md
;
delete
hb
;
delete
doc
;
}
src/grantleebuilder/autotests/texthtmlbuildertest.h
View file @
f3bcd7ea
...
...
@@ -49,5 +49,6 @@ private Q_SLOTS:
void
testBug442416
();
void
testBug442416Bis
();
void
testBugTextColor
();
void
testBugIndent443534
();
};
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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