diff options
author | Kim Motoyoshi Kalland <kim.kalland@nokia.com> | 2009-10-05 14:34:30 (GMT) |
---|---|---|
committer | Kim Motoyoshi Kalland <kim.kalland@nokia.com> | 2009-10-05 14:38:22 (GMT) |
commit | a1fa0d50f9bebc7148cd21fa3c420d2ff0fe7d12 (patch) | |
tree | 740e8a9230452657d9b722b85da21dde0f8f6e7d /src | |
parent | 1210fa5b2d65895ad2be1f9ca7cae586e3b29dc1 (diff) | |
download | Qt-a1fa0d50f9bebc7148cd21fa3c420d2ff0fe7d12.zip Qt-a1fa0d50f9bebc7148cd21fa3c420d2ff0fe7d12.tar.gz Qt-a1fa0d50f9bebc7148cd21fa3c420d2ff0fe7d12.tar.bz2 |
Fixed inheritence of whitespace mode in QtSvg.
Task-number: QTBUG-4587
Reviewed-by: Tor Arne
Diffstat (limited to 'src')
-rw-r--r-- | src/svg/qsvghandler.cpp | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/src/svg/qsvghandler.cpp b/src/svg/qsvghandler.cpp index 6d2a0f9..3ed918e 100644 --- a/src/svg/qsvghandler.cpp +++ b/src/svg/qsvghandler.cpp @@ -3569,20 +3569,16 @@ bool QSvgHandler::startElement(const QString &localName, * a lookup by the qualified name here, but this is namespace aware, since * the XML namespace can only be bound to prefix "xml." */ const QStringRef xmlSpace(attributes.value(QLatin1String("xml:space"))); - if(xmlSpace.isNull()) - { + if (xmlSpace.isNull()) { // This element has no xml:space attribute. - m_whitespaceMode.push(QSvgText::Default); - } - else if(xmlSpace == QLatin1String("preserve")) + m_whitespaceMode.push(m_whitespaceMode.isEmpty() ? QSvgText::Default : m_whitespaceMode.top()); + } else if (xmlSpace == QLatin1String("preserve")) { m_whitespaceMode.push(QSvgText::Preserve); - else if(xmlSpace == QLatin1String("default")) + } else if (xmlSpace == QLatin1String("default")) { m_whitespaceMode.push(QSvgText::Default); - else - { + } else { qWarning() << QString::fromLatin1("\"%1\" is an invalid value for attribute xml:space. " "Valid values are \"preserve\" and \"default\".").arg(xmlSpace.toString()); - m_whitespaceMode.push(QSvgText::Default); } |