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:
Allan Sandfeld Jensen 2014-09-16 15:54:06 +02:00
parent 5d5de7a97f
commit 4453bfcb20
2 changed files with 14 additions and 1 deletions

View File

@ -1142,7 +1142,7 @@ QTextHtmlImporter::ProcessNodeResult QTextHtmlImporter::processBlockNode()
}
if (hasBlock) {
QTextBlockFormat fmt;
fmt.setIndent(0);
fmt.setIndent(currentNode->blockFormat.indent());
cursor.mergeBlockFormat(fmt);
}
}

View File

@ -87,6 +87,7 @@ private slots:
void html_listIndents4();
void html_listIndents5();
void html_listIndents6();
void html_listIndents7();
void blockCharFormat();
void blockCharFormatCopied();
void initialBlock();
@ -756,6 +757,18 @@ void tst_QTextDocumentFragment::html_listIndents6()
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()
{
const char html[] = "<p style=\"font-style:italic\"><span style=\"font-style:normal\">Test</span></p>";