summaryrefslogtreecommitdiff
path: root/src/svg/qsvghandler.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Use Qt::SplitBehavior in preference to QString::SplitBehaviorEdward Welbourne2020-03-021-2/+2
| | | | | | | | The Qt version was added in 5.14 "for use as eventual replacement for QString::SplitBehavior." Move another step closer to that goal. Change-Id: Ieabf1eeb03b682f06344d0373de036f8f4534042 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Don't use deprecated QMatrix class anymoreJarek Kobus2020-01-171-11/+12
| | | | | | Task-number: QTBUG-46653 Change-Id: I9944b62141d7054e3935000a819bebc5fd54df6c Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Small performance improvements suggested by clang-tidyv5.14.0-beta2Albert Astals Cid2019-10-071-1/+1
| | | | | | | | | | * Add const & to function parameters * std::move an brush * Add const & to variables assigned from functions returning const & Change-Id: If412b78cc0198e24ce1c611fcd2026d0d723be80 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Fix leak in SVG font nodesAllan Sandfeld Jensen2019-04-241-7/+7
| | | | | | | | Their lifetime is controlled by the document, but the logic was confused and lost the node. Change-Id: Ib074dcf209d53ade894ee571a0bc08a1a7acfcab Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Fix assert on misplaced tspan elementAllan Sandfeld Jensen2019-04-121-0/+7
| | | | | Change-Id: I75b3a88aae3cbd7838474d7a78f29fcd58172fc2 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Fix IRI parsing, and use after freeAllan Sandfeld Jensen2019-03-041-2/+12
| | | | | | | | | | Make the parsing of IRI references tighter, and avoid freeing styles when inserting a duplicate id. Fixes: QTBUG-74104 Change-Id: I3a12fcf09ce1c55c135a4209817413ed8af75dec Reviewed-by: Robert Loehning <robert.loehning@qt.io> Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Fix heap overflow in path parsingAllan Sandfeld Jensen2019-03-011-1/+1
| | | | | | Fixes: QTBUG-74129 Change-Id: I871c144f1df288a310e82aef979af7cfd7a54095 Reviewed-by: Robert Loehning <robert.loehning@qt.io>
* Don't leak nodes on parsing failuresAllan Sandfeld Jensen2019-02-271-3/+9
| | | | | | | | | | | The QSvgHandler always expects the caller to handle ownership of the generated document, also when the parsing failed. QSvgHandler also failed to handle misplaced group elements. Fixes: QTBUG-74083 Change-Id: I8907117d4305ecd84e328b201791001cb877fc60 Reviewed-by: Robert Loehning <robert.loehning@qt.io>
* Fix QSvgRenderer incorrect render of svg:imageDavid Crémoux2019-02-061-4/+4
| | | | | | | | | | The bounds of QSvgImage are integer based (QRect) which cause rounding issues when decimals values are used to define image (image shifted and with incorrect size). Changing the bounds to QRectF solves the issue. Fixes: QTBUG-73445 Change-Id: I49828e2c0b1917ec878844d520aac182581c23fb Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Allow <style> without type attributeChih-Hsuan Yen2019-01-291-1/+1
| | | | | | | | | | | | | | According to https://www.w3.org/TR/SVG/styling.html#StyleElement, `type` can be omitted. > If the attribute is not specified, then the style sheet language is assumed to be CSS. Original-Author: Christoph Feck Fixes: QTBUG-58326 Fixes: QTBUG-69378 Change-Id: Ic3d0e8db99da8c81e5a01c0dda33fb38428e38d5 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> Reviewed-by: Andy Shaw <andy.shaw@qt.io>
* Consider relative path in image tagsLars Schmertmann2018-11-301-5/+19
| | | | | | Task-number: QTBUG-16198 Change-Id: I26bf48cbac39af0fae490ed21579e8de326cd1a3 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Fix parsing of forward referrals in use elementsEirik Aavitsland2018-08-201-15/+47
| | | | | | | | | | SVG <use> elements may refer to a node that is defined later in the file. The parser would then fail to resolve the link. Implement delayed link resolution in the parser to handle such cases. Task-number: QTBUG-69694 Change-Id: I94ffb3511dbd0fac822bb56991415b2d99ccf90e Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Migrate QSvgHandler to use QRegularExpressionSamuel Gaist2018-08-121-11/+11
| | | | | | | | This patch updates the QSvgHandler class to use QRegularExpression in place of QRegExp which is to be considered deprecated. Change-Id: Ie35ff1e697741711440b6a99da26d435bc782d15 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Merge remote-tracking branch 'origin/5.11' into devQt Forward Merge Bot2018-07-311-5/+6
|\ | | | | | | | | | | | | Conflicts: .qmake.conf Change-Id: Ic41094e6744df3d84d76bcfe701092e137660f80
| * Fix crash when parsing malformed url referenceEirik Aavitsland2018-07-301-5/+6
| | | | | | | | | | | | | | The parsing did not check for end of input. Change-Id: I56a478877d242146395977b767511425d2b8ced1 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | Fix transformation of gradients for svg objectBoundingBox coordinatesEirik Aavitsland2018-06-291-1/+1
|/ | | | | | | | | | | QBrush transformations were not applied in the object coordinate space, even when using Qt's ObjectBoundingMode. Use the new ObjectMode instead to fix this. Task-number: QTBUG-59978 Task-number: QTBUG-67995 Change-Id: I79f529853ed8bca86b1811f4edf66244a026a27c Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* QSvgHandler: Change some usages of QString to QStringRefFriedemann Kleint2018-02-271-57/+54
| | | | | | | | QString allocation can be avoided in some places after the introduction of QStringRef::toInt()/toDouble(). Change-Id: Ib400f49df04847f85aeea0190215f864f71223bd Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Fix warning when encountering font-size="none"Friedemann Kleint2018-02-271-27/+51
| | | | | | | | | | Extend existing enum by "none" and extract a function to return the specification so that "none" can be cleanly handled. Task-number: QTBUG-66646 Change-Id: If4ec1056c6f0fa407f76b747634bb898e75a5474 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Merge remote-tracking branch 'origin/5.9' into 5.10v5.10.0-rc3v5.10.0-rc2v5.10.0-rc1v5.10.05.10.0Liang Qi2017-11-151-0/+2
|\ | | | | | | Change-Id: I2c5f1f592e2141b93fa274124a96f2a63b83acdb
| * Fix crash on recursive self-referral in <use> elementEirik Aavitsland2017-11-151-0/+2
| | | | | | | | | | | | | | | | | | | | Referring to an ancestor in a <use> element would lead to endless recursion. Add checks to avoid recursion, and also emit a warning while parsing. Task-number: QTBUG-64425 Change-Id: I9ee1b9bfef13796cc3f387ff8579c6b13bc4ae9a Reviewed-by: Andy Shaw <andy.shaw@qt.io>
* | Merge remote-tracking branch 'origin/5.9' into 5.10Liang Qi2017-10-301-10/+0
|\ \ | |/ | | | | | | | | | | Conflicts: .qmake.conf Change-Id: I8b9a5a395dbd6659f7806eeebdd665c760a71ec1
| * Remove unused variablesAndré Klitzing2017-10-061-10/+0
| | | | | | | | | | | | Change-Id: I82fe38e2fbcc070d02d2acb34a43a8c971e84ae9 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* | Merge remote-tracking branch 'origin/5.9' into devv5.10.0-beta3v5.10.0-beta2v5.10.0-beta1v5.10.0-alpha1Liang Qi2017-08-151-3/+3
|\ \ | |/ | | | | | | | | | | Conflicts: .qmake.conf Change-Id: I1ebd40264cf1afaf5bcbf8b2f272e153f51a5625
| * Fix matrix multiplication in parseTransformationMatrix()Christoph Stein2017-07-031-3/+3
| | | | | | | | | | | | | | | | | | Sequencing of a matrix multiplication seems to be erroneous, this may lead to incorrect svg rendering under certain circumstances Task-number: QTBUG-61568 Change-Id: Id8b6c425d4affde8c71faad455a63a87ef5e13a4 Reviewed-by: Andy Shaw <andy.shaw@qt.io>
* | Fix table-row-group in displayStringToEnumRobert Loehning2017-06-071-1/+1
|/ | | | | | | Task-number: QTBUG-60583 Change-Id: I685d4d68663703e220150869dff671718a8190a1 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Correctly parse the stroke-dasharray attributesAndy Shaw2017-05-301-6/+5
| | | | | | | | | | | | When a stroke-dasharray had multiple values separated by spaces it would end up combining them into one instead of treating them separately. This ensures that it is correctly respected. [ChangeLog] Parses the stroke-dasharray attributes in a SVG file correctly. Change-Id: If6e9babe9f63637e56d3d1dba914557829f9d5f0 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Fix warnings for -no-feature-cssparserv5.9.0-beta2v5.9.0-beta1Nikita Krupenko2017-03-291-2/+4
| | | | | Change-Id: Ifdb27c6fed26f95acff30f64259d6905e88c3a6f Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* Improve the error messages of QSvgHandlerv5.9.0-alpha1Friedemann Kleint2017-02-021-14/+47
| | | | | | | | | | | | | | Add a function printing file name and location. Could not resolve property : linearGradient4538 becomes /usr/share/icons/breeze/actions/24/document-new.svg:123: Could not resolve property: linearGradient4538 Task-number: QTBUG-52079 Change-Id: I843f65eb4ca517d103031f9921a16090a6ff6720 Reviewed-by: David Faure <david.faure@kdab.com>
* Introduce logging category "qt.svg"Friedemann Kleint2017-02-021-15/+18
| | | | | | | | | | | It is then possible to suppress warnings by setting for example QT_LOGGING_RULES to qt.svg.warning=false. This will suppress the warnings floods which are currently produced by faulty theme svg icons on KDE 5 systems. Task-number: QTBUG-52079 Change-Id: I50e3c2e3eab610e182293c8938c6188694eabfb7 Reviewed-by: David Faure <david.faure@kdab.com>
* Add missing override and remove redundant virtualAlexander Volkov2016-12-061-10/+10
| | | | | | Change-Id: I9c6bc47803b5decb47787ad69f42259e85470f57 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Merge remote-tracking branch 'origin/5.6' into 5.7v5.7.0-alpha1Liang Qi2016-02-151-0/+1
|\ | | | | | | | | | | | | Conflicts: .qmake.conf Change-Id: Ia508d1e3f74dd35ac28b104c0cbdacdb6fe16d6b
| * Merge remote-tracking branch 'origin/5.5' into 5.6Liang Qi2015-10-281-0/+1
| |\ | | | | | | | | | Change-Id: I4e901d3337a82cf07a0ac9aa56ed02a400d6905d
| | * Add missing string for tspanAndy Shaw2015-10-201-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | The node name list needs to be kept in sync with the QSvgNode::Type enum otherwise it will match the wrong name for the wrong value after the missing entry. Change-Id: Ib13025bc3c5f31ff4f76638d05d1419ad091622b Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
* | | Updated license headersJani Heikkinen2016-01-251-14/+20
|/ / | | | | | | | | | | | | | | | | | | | | From Qt 5.7 -> LGPL v2.1 isn't an option anymore, see http://blog.qt.io/blog/2016/01/13/new-agreement-with-the-kde-free-qt-foundation/ Updated license headers to use new LGPL header instead of LGPL21 one (in those files which will be under LGPL v3) Change-Id: I4bbd8b2a35222b925c6e5cef6337e6237d3e1716 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* | Add a couple of QList::reserve() calls.Sergio Martins2015-06-081-0/+2
| | | | | | | | | | Change-Id: Ife2fa97ef8395753523aba96757fac8885a75980 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | Use QByteArray::toDouble() instead of qstrtod.Erik Verbruggen2015-02-271-4/+1
|/ | | | | | | No need to use a secretly exported symbol. Change-Id: Iaf262abcd2eefd3953e7ee72e2d4592dc9507d06 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Merge remote-tracking branch 'origin/5.4' into devFrederik Gladhorn2015-02-131-1/+9
|\ | | | | | | Change-Id: I960859c8b76749294939042658b5ded3dfa10993
| * Be more informative when a referenced image cannot be parsedAndy Shaw2015-02-041-1/+9
| | | | | | | | | | | | | | | | | | | | If the filename or the width/height is not valid then we bail out earlier instead of trying to create an image based on the information given. This saves a bit of processing time and also allows for giving more indication as to where the problem comes from. Change-Id: I3d11aa57c0cb965159aa9e42e905ef13ba55988f Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
* | Update copyright headersJani Heikkinen2015-02-111-7/+7
|/ | | | | | | | | | Qt copyrights are now in The Qt Company, so we could update the source code headers accordingly. In the same go we should also fix the links to point to qt.io. Change-Id: Ie7d37928ebd680c6f1b20045de11abcd5595c73f Reviewed-by: Jani Heikkinen <jani.heikkinen@theqtcompany.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
* Update license headers and add new license filesv5.4.0-alpha1Antti Kokko2014-08-251-19/+11
| | | | | | | | | - Renamed LICENSE.LGPL to LICENSE.LGPLv21 - Added LICENSE.LGPLv3 & LICENSE.GPLv2 - Removed LICENSE.GPL Change-Id: I847adeea20fd98e5c9a18b8c44a15de84283f216 Reviewed-by: Jani Heikkinen <jani.heikkinen@digia.com>
* remove pointless #ifndef QT_NO_SVGOswald Buddenhagen2013-10-291-4/+0
| | | | | | | the way to disable the feature is to not compile the module. Change-Id: I96f18d037243f7d6e3b3cb2c23922cc4c05c30a8 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* Fix module name format in file headersSze Howe Koh2013-01-291-1/+1
| | | | | | | | | Follow the conventions at http://qt-project.org/wiki/Spelling_Module_Names_in_Qt_Documentation Change-Id: I418bbd3817d433a1b82f0f0fea68f2235d2abc5a Reviewed-by: Jerome Pasion <jerome.pasion@digia.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
* Update copyright year in Digia's license headersSergio Ahumada2013-01-101-1/+1
| | | | | | Change-Id: Icf9d15a0f1f38ab60f0dd8fc2bc6ac936dd7dc62 Reviewed-by: Akseli Salovaara <akseli.salovaara@digia.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
* Change copyrights from Nokia to DigiaIikka Eklund2012-09-241-24/+24
| | | | | | | | Change copyrights and license headers from Nokia to Digia Change-Id: Ie28eae89f2ad032f174ff840cc6a44d8dd511eed Reviewed-by: Janne Anttila <janne.anttila@digia.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Remove obsolete use of Q_WS_QWS.Stephen Kelly2012-07-261-9/+2
| | | | | Change-Id: I9733a86f079ffde911840eb37136f2c02cb96c76 Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* Make qtsvg compile with QT_NO_CSSPARSERTasuku Suzuki2012-07-091-2/+48
| | | | | Change-Id: Iea4bb3433232e7350de8d68c504493cca3b34a3d Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
* Fix compilation for -no-widgets optionTasuku Suzuki2012-05-231-2/+0
| | | | | | | | | | Disable QSvgWidget and QGraphicsSvgItem when -no-widgets is set. The module doesn't depend on widgets when QT_CONFIG contains no-widgets. QT_NO_SVG* (which is removed in Qt5) is replaced to QT_NO_WIDGETS. Change-Id: I11457a40e96d193269dcc37ac7fdb86f3f7c1958 Reviewed-by: Donald Carr <donald.carr@nokia.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
* Change uses of {to,from}Ascii to {to,from}Latin1Thiago Macieira2012-05-051-1/+1
| | | | | | | | | | This operation should be a no-op anyway, since at this point in time, the fromAscii and toAscii functions simply call their fromLatin1 and toLatin1 counterparts. Task-number: QTBUG-21872 Change-Id: I6a7cd331d0fd76461a1e657675733420a75c46f1 Reviewed-by: Richard J. Moore <rich@kde.org>
* Remove "All rights reserved" line from license headers.Jason McDonald2012-01-301-1/+1
| | | | | | | | | | | As in the past, to avoid rewriting various autotests that contain line-number information, an extra blank line has been inserted at the end of the license text to ensure that this commit does not change the total number of lines in the license header. Change-Id: I5f2eda9477944e22ec5f6dd07dcb53feaa9fc03b Sanity-Review: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Update obsolete contact address.Jason McDonald2012-01-231-1/+1
| | | | | | | | Replace Nokia contact email address with Qt Project website. Change-Id: Ia89ccb618e630103d60a6e2703e3fbedae0616a6 Sanity-Review: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>