summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Vrátil <dvratil@redhat.com>2015-09-23 14:26:27 +0200
committerDaniel Vrátil <dvratil@redhat.com>2015-09-30 10:36:49 +0000
commit2a70677b64e61d7b136e4fa3725be53258327b42 (patch)
treea526e2ba59bcf8a0e4d4c6c1ebce110045a06191
parentb1dac5efce7464ecdf8b8d6d25bb7b970ac15e82 (diff)
Implement support for 'none' value for list-style CSS property
'none' is a valid value specified in CSS standard. In combination with '-qt-list-indent: 0' it allows for using lists in Qt for better structuring text Change-Id: I1dd324a3ea81b26e21a9d4d9f93ef9b5edcf3e93 Task-number: QTBUG-6501 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
-rw-r--r--src/gui/text/qtexthtmlparser.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/gui/text/qtexthtmlparser.cpp b/src/gui/text/qtexthtmlparser.cpp
index f8f41bb53d..a09ed2c040 100644
--- a/src/gui/text/qtexthtmlparser.cpp
+++ b/src/gui/text/qtexthtmlparser.cpp
@@ -1140,6 +1140,7 @@ void QTextHtmlParserNode::setListStyle(const QVector<QCss::Value> &cssValues)
for (int i = 0; i < cssValues.count(); ++i) {
if (cssValues.at(i).type == QCss::Value::KnownIdentifier) {
switch (static_cast<QCss::KnownValue>(cssValues.at(i).variant.toInt())) {
+ case QCss::Value_None: hasOwnListStyle = true; listStyle = QTextListFormat::ListStyleUndefined; break;
case QCss::Value_Disc: hasOwnListStyle = true; listStyle = QTextListFormat::ListDisc; break;
case QCss::Value_Square: hasOwnListStyle = true; listStyle = QTextListFormat::ListSquare; break;
case QCss::Value_Circle: hasOwnListStyle = true; listStyle = QTextListFormat::ListCircle; break;
@@ -1495,6 +1496,8 @@ void QTextHtmlParser::applyAttributes(const QStringList &attributes)
node->listStyle = QTextListFormat::ListDisc;
else if (value == QLatin1String("circle"))
node->listStyle = QTextListFormat::ListCircle;
+ else if (value == QLatin1String("none"))
+ node->listStyle = QTextListFormat::ListStyleUndefined;
}
}
break;