summaryrefslogtreecommitdiffstats
path: root/src/svg
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@nokia.com>2009-08-24 20:20:56 (GMT)
committerThiago Macieira <thiago.macieira@nokia.com>2009-08-24 20:20:56 (GMT)
commite4002434bfde5c8206463ea3a0d4140835619944 (patch)
treef199a1e233867ab4e85d22aa138391585af75fca /src/svg
parent3f183debfd677b952b015f6950131dd25bd4768b (diff)
parent5a7c14af3c27089b0b8698da3c689637ffaa9cfa (diff)
downloadQt-e4002434bfde5c8206463ea3a0d4140835619944.zip
Qt-e4002434bfde5c8206463ea3a0d4140835619944.tar.gz
Qt-e4002434bfde5c8206463ea3a0d4140835619944.tar.bz2
Merge branch '4.6'
Diffstat (limited to 'src/svg')
-rw-r--r--src/svg/qsvghandler.cpp21
1 files changed, 9 insertions, 12 deletions
diff --git a/src/svg/qsvghandler.cpp b/src/svg/qsvghandler.cpp
index 5c0eda9..b2a2cb8 100644
--- a/src/svg/qsvghandler.cpp
+++ b/src/svg/qsvghandler.cpp
@@ -2788,19 +2788,16 @@ static QSvgNode *createSvgNode(QSvgNode *parent,
node->setHeight(int(height), type == QSvgHandler::LT_PERCENT);
}
+ QStringList viewBoxValues;
if (!viewBoxStr.isEmpty()) {
- QStringList lst = viewBoxStr.split(QLatin1Char(' '), QString::SkipEmptyParts);
- if (lst.count() != 4)
- lst = viewBoxStr.split(QLatin1Char(','), QString::SkipEmptyParts);
- int count = lst.count();
- while (count < 4) {
- lst.append(QLatin1String(""));
- count++;
- }
- QString xStr = lst.at(0).trimmed();
- QString yStr = lst.at(1).trimmed();
- QString widthStr = lst.at(2).trimmed();
- QString heightStr = lst.at(3).trimmed();
+ viewBoxStr = viewBoxStr.replace(QLatin1Char(' '), QLatin1Char(','));
+ viewBoxValues = viewBoxStr.split(QLatin1Char(','), QString::SkipEmptyParts);
+ }
+ if (viewBoxValues.count() == 4) {
+ QString xStr = viewBoxValues.at(0).trimmed();
+ QString yStr = viewBoxValues.at(1).trimmed();
+ QString widthStr = viewBoxValues.at(2).trimmed();
+ QString heightStr = viewBoxValues.at(3).trimmed();
QSvgHandler::LengthType lt;
qreal x = parseLength(xStr, lt, handler);