diff options
Diffstat (limited to 'src/gui/text/qtexthtmlparser.cpp')
-rw-r--r-- | src/gui/text/qtexthtmlparser.cpp | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/src/gui/text/qtexthtmlparser.cpp b/src/gui/text/qtexthtmlparser.cpp index 31d055e..c471405 100644 --- a/src/gui/text/qtexthtmlparser.cpp +++ b/src/gui/text/qtexthtmlparser.cpp @@ -343,7 +343,7 @@ static QChar resolveEntity(const QString &entity) return e->code; } -static const uint windowsLatin1ExtendedCharacters[0xA0 - 0x80] = { +static const ushort windowsLatin1ExtendedCharacters[0xA0 - 0x80] = { 0x20ac, // 0x80 0x0081, // 0x81 direct mapping 0x201a, // 0x82 @@ -499,7 +499,7 @@ void QTextHtmlParser::dumpHtml() { for (int i = 0; i < count(); ++i) { qDebug().nospace() << qPrintable(QString(depth(i)*4, QLatin1Char(' '))) - << qPrintable(at(i).tag) << ":" + << qPrintable(at(i).tag) << ':' << quoteNewline(at(i).text); ; } @@ -1206,6 +1206,8 @@ void QTextHtmlParserNode::setListStyle(const QVector<QCss::Value> &cssValues) case QCss::Value_Decimal: hasOwnListStyle = true; listStyle = QTextListFormat::ListDecimal; break; case QCss::Value_LowerAlpha: hasOwnListStyle = true; listStyle = QTextListFormat::ListLowerAlpha; break; case QCss::Value_UpperAlpha: hasOwnListStyle = true; listStyle = QTextListFormat::ListUpperAlpha; break; + case QCss::Value_LowerRoman: hasOwnListStyle = true; listStyle = QTextListFormat::ListLowerRoman; break; + case QCss::Value_UpperRoman: hasOwnListStyle = true; listStyle = QTextListFormat::ListUpperRoman; break; default: break; } } @@ -1441,14 +1443,13 @@ static bool setFloatAttribute(qreal *destination, const QString &value) static void setWidthAttribute(QTextLength *width, QString value) { - qreal realVal; bool ok = false; - realVal = value.toDouble(&ok); + qreal realVal = value.toDouble(&ok); if (ok) { *width = QTextLength(QTextLength::FixedLength, realVal); } else { value = value.trimmed(); - if (!value.isEmpty() && value.at(value.length() - 1) == QLatin1Char('%')) { + if (!value.isEmpty() && value.endsWith(QLatin1Char('%'))) { value.chop(1); realVal = value.toDouble(&ok); if (ok) @@ -1540,6 +1541,10 @@ void QTextHtmlParser::applyAttributes(const QStringList &attributes) node->listStyle = QTextListFormat::ListLowerAlpha; } else if (value == QLatin1String("A")) { node->listStyle = QTextListFormat::ListUpperAlpha; + } else if (value == QLatin1String("i")) { + node->listStyle = QTextListFormat::ListLowerRoman; + } else if (value == QLatin1String("I")) { + node->listStyle = QTextListFormat::ListUpperRoman; } else { value = value.toLower(); if (value == QLatin1String("square")) |