Changeset 846 for trunk/src/svg/qsvghandler.cpp
- Timestamp:
- May 5, 2011, 5:36:53 AM (14 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
/branches/vendor/nokia/qt/4.7.2 (added) merged: 845 /branches/vendor/nokia/qt/current merged: 844 /branches/vendor/nokia/qt/4.6.3 removed
- Property svn:mergeinfo changed
-
trunk/src/svg/qsvghandler.cpp
r769 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 75 75 #define QT_INHERIT QLatin1String(qt_inherit_text) 76 76 77 Q_ DECL_IMPORT double qstrtod(const char *s00, char const **se, bool *ok);77 Q_CORE_EXPORT double qstrtod(const char *s00, char const **se, bool *ok); 78 78 79 79 // ======== duplicated from qcolor_p … … 1283 1283 1284 1284 if (!attributes.fontSize.isEmpty() && attributes.fontSize != QT_INHERIT) { 1285 // TODO: Support relative sizes 'larger' and 'smaller'. 1285 1286 QSvgHandler::LengthType dummy; // should always be pixel size 1286 fontStyle->setSize(parseLength(attributes.fontSize.toString(), dummy, handler)); 1287 qreal size = 0; 1288 static const qreal sizeTable[] = { qreal(6.9), qreal(8.3), qreal(10.0), qreal(12.0), qreal(14.4), qreal(17.3), qreal(20.7) }; 1289 enum AbsFontSize { XXSmall, XSmall, Small, Medium, Large, XLarge, XXLarge }; 1290 switch (attributes.fontSize.at(0).unicode()) { 1291 case 'x': 1292 if (attributes.fontSize == QLatin1String("xx-small")) 1293 size = sizeTable[XXSmall]; 1294 else if (attributes.fontSize == QLatin1String("x-small")) 1295 size = sizeTable[XSmall]; 1296 else if (attributes.fontSize == QLatin1String("x-large")) 1297 size = sizeTable[XLarge]; 1298 else if (attributes.fontSize == QLatin1String("xx-large")) 1299 size = sizeTable[XXLarge]; 1300 break; 1301 case 's': 1302 if (attributes.fontSize == QLatin1String("small")) 1303 size = sizeTable[Small]; 1304 break; 1305 case 'm': 1306 if (attributes.fontSize == QLatin1String("medium")) 1307 size = sizeTable[Medium]; 1308 break; 1309 case 'l': 1310 if (attributes.fontSize == QLatin1String("large")) 1311 size = sizeTable[Large]; 1312 break; 1313 default: 1314 size = parseLength(attributes.fontSize.toString(), dummy, handler); 1315 break; 1316 } 1317 fontStyle->setSize(size); 1287 1318 } 1288 1319 … … 2963 2994 nry = bounds.height()/2; 2964 2995 2965 if ( nrx && !nry)2996 if (!rx.isEmpty() && ry.isEmpty()) 2966 2997 nry = nrx; 2967 else if ( nry && !nrx)2998 else if (!ry.isEmpty() && rx.isEmpty()) 2968 2999 nrx = nry; 2969 3000 … … 3526 3557 // this point is to do what everyone else seems to do and 3527 3558 // ignore the reported namespaceUri completely. 3528 startElement(xml->name().toString(), xml->attributes()); 3559 if (!startElement(xml->name().toString(), xml->attributes())) { 3560 delete m_doc; 3561 m_doc = 0; 3562 return; 3563 } 3529 3564 break; 3530 3565 case QXmlStreamReader::EndElement: … … 3570 3605 m_whitespaceMode.push(QSvgText::Default); 3571 3606 } 3607 3608 if (!m_doc && localName != QLatin1String("svg")) 3609 return false; 3572 3610 3573 3611 if (FactoryMethod method = findGroupFactory(localName)) { … … 3745 3783 m_selector->styleSheets.append(sheet); 3746 3784 return true; 3747 } else if (m_skipNodes.isEmpty() || m_skipNodes.top() == Unknown )3785 } else if (m_skipNodes.isEmpty() || m_skipNodes.top() == Unknown || m_nodes.isEmpty()) 3748 3786 return true; 3749 3787
Note:
See TracChangeset
for help on using the changeset viewer.