Restore -qt-block-indent on <li> elements
Task-number: QTBUG-20877 Change-Id: If049065ed99eaf8ffc85c8ff54d3da892a095795 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
This commit is contained in:
parent
5d5de7a97f
commit
4453bfcb20
@ -1142,7 +1142,7 @@ QTextHtmlImporter::ProcessNodeResult QTextHtmlImporter::processBlockNode()
|
|||||||
}
|
}
|
||||||
if (hasBlock) {
|
if (hasBlock) {
|
||||||
QTextBlockFormat fmt;
|
QTextBlockFormat fmt;
|
||||||
fmt.setIndent(0);
|
fmt.setIndent(currentNode->blockFormat.indent());
|
||||||
cursor.mergeBlockFormat(fmt);
|
cursor.mergeBlockFormat(fmt);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -87,6 +87,7 @@ private slots:
|
|||||||
void html_listIndents4();
|
void html_listIndents4();
|
||||||
void html_listIndents5();
|
void html_listIndents5();
|
||||||
void html_listIndents6();
|
void html_listIndents6();
|
||||||
|
void html_listIndents7();
|
||||||
void blockCharFormat();
|
void blockCharFormat();
|
||||||
void blockCharFormatCopied();
|
void blockCharFormatCopied();
|
||||||
void initialBlock();
|
void initialBlock();
|
||||||
@ -756,6 +757,18 @@ void tst_QTextDocumentFragment::html_listIndents6()
|
|||||||
QCOMPARE(cursor.blockFormat().indent(), 0);
|
QCOMPARE(cursor.blockFormat().indent(), 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void tst_QTextDocumentFragment::html_listIndents7()
|
||||||
|
{
|
||||||
|
const char html[] = "<ul><li style=\"-qt-block-indent:1;\">Hey</ul>";
|
||||||
|
setHtml(QString::fromLatin1(html));
|
||||||
|
cursor.movePosition(QTextCursor::Start);
|
||||||
|
cursor.movePosition(QTextCursor::NextBlock);
|
||||||
|
QTextList *list = cursor.currentList();
|
||||||
|
QVERIFY(list);
|
||||||
|
QCOMPARE(list->format().indent(), 1);
|
||||||
|
QCOMPARE(cursor.block().blockFormat().indent(), 1);
|
||||||
|
}
|
||||||
|
|
||||||
void tst_QTextDocumentFragment::blockCharFormat()
|
void tst_QTextDocumentFragment::blockCharFormat()
|
||||||
{
|
{
|
||||||
const char html[] = "<p style=\"font-style:italic\"><span style=\"font-style:normal\">Test</span></p>";
|
const char html[] = "<p style=\"font-style:italic\"><span style=\"font-style:normal\">Test</span></p>";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user