summaryrefslogtreecommitdiff
path: root/svgio/source/svgreader/svgdocumenthandler.cxx
AgeCommit message (Collapse)Author
2023-10-27Drop rTokenName argument from SvgNode::parseAttributeMike Kaganski
It was never used. Change-Id: I8bc7d625977a6cdc8fe6863037e72577dbfc46c9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158493 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2023-08-18tdf#142424: Revert "related tdf#156579: just break for switch element"Xisco Fauli
This reverts commit e222f60ac2a71032dbdf62d7c7e28978b5a0b19c. To make the switch element behave like a group as least, so the transform attribute is parsed Change-Id: Id8c21ac6da217d8f7bc350ff41022335bf1e0f1f Change-Id: If1e53f9baad8995f26f9b885cfef6265040736bc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155758 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2023-08-15tdf#93583: use getTextWidth to calculate line's widthXisco Fauli
Since every character in the line might use different styles Change-Id: I2ce079d4308f4acde42a8366838749a7c20331b4 Change-Id: I01f51f157caa667cebc8860ae37d4458fac2d511 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155666 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2023-08-12tdf#156616: check if character's parent has x or yXisco Fauli
if so, only concatenate the characters that are in the same line so the alignment will be calculated based on the line's width Change-Id: I704370c0a470f8b4cff97c51ad9863158118ee8a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155636 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2023-08-10related: tdf#151103: simplify codeXisco Fauli
Keep the text line in the SvgTextNode and not in each SvgCharacterNode Change-Id: Ia33e46cc974a39a915e7b933337b4c529e6eeca5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155558 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2023-08-10svgio: handle addGap internally inside SvgCharacterNodeXisco Fauli
Also add the gap at the beginning of the current node, not at the end of the previous one Change-Id: I6583059b4a7418010ac2af459e00fb0d02d39605 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155552 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2023-08-10svgio: avoid dynamic_castXisco Fauli
Change-Id: I9a2e2c4341476a59ffb001c42e7812cb8249c856 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155548 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2023-08-09svgio: get rid of SvgTextPositionsXisco Fauli
and make SvgText inherit from SvgTspan Change-Id: Ief25e52ba2a493936f82f1674f73168ed5647278 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155521 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2023-08-08crashtesting: null-deref on kde114933-2.svgCaolán McNamara
Change-Id: If344bd676eb0eefd2d1bb4728bd0ca1e602c076e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155432 Tested-by: Jenkins Tested-by: Caolán McNamara <caolan.mcnamara@collabora.com> Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-08-03svgio: Simplify codeXisco Fauli
Change-Id: Ibd28973fee006f3853fde64c519dd0cd8c1573ba Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155322 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2023-08-03Revert "fdo#50114 ingore flowRoot element during svg import"Xisco Fauli
This commit reverts 5bd241b99b76ae7f4b3c1d4f2bcbaf7c487bb339 which is no longer needed after 13a41e7a12598c7896d6dc8d34aba6af5b80b83c "tdf#150124: do nothing when parent is of unkown type" and might cause unexpected results as seen with https://bugs.documentfoundation.org/attachment.cgi?id=124782 from https://bugs.documentfoundation.org/show_bug.cgi?id=99628 Change-Id: I8bb700f5c5553700f91b937330bc3730e8ea84c5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155320 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2023-08-03related tdf#156579: just break for switch elementXisco Fauli
Change-Id: I4a31431325c44440f773f6f345d2a0a057d1fa37 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155317 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2023-08-03tdf#151103: Use the whole text line to calculate the align positionXisco Fauli
Change-Id: I7ecd41c422afbf028101924972c47a510834ba5a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155314 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2023-08-02tdf#156579: treat switch element as a groupXisco Fauli
Regression from commit 13a41e7a12598c7896d6dc8d34aba6af5b80b83c Author: Xisco Fauli <xiscofauli@libreoffice.org> Date: Mon Jul 3 14:11:43 2023 +0200 tdf#150124: do nothing when parent is of unkown type because 'switch' is not a known token. For now it, treat it as a group No need to have a unittest for this Change-Id: I4cae92a010e45cd729db475a7abccab19a5d5403 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155250 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2023-07-12tdf#156251: Add gap between text elements when neededXisco Fauli
Partially revert a42f5faac7c6d4590e632cf40e3ba9eb618e6f56 "tdf#103888: Do not add a gap at the end of each text portion" and adapt code to keep tdf#103888 fixed Change-Id: I4b3f1ff7d87b1945233d9b05824d58af1e001d65 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154364 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2023-07-12svgio: re-implement to use virtual functionXisco Fauli
kudos to Mike Kaganski for the hint Change-Id: Iea58a31ffa481c4d9579a31f045f2a73d30ad883 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154344 Tested-by: Xisco Fauli <xiscofauli@libreoffice.org> Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2023-07-05svgio: simplify codeXisco Fauli
Change-Id: Ieaf0430cd0e84d861f108ec33bf98ff2870ba2df Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154067 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2023-07-03tdf#150124: do nothing when parent is of unkown typeXisco Fauli
Change-Id: I745b2a81200b0d8138b5f1b844849f20571d9546 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153878 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2023-06-29tdf#156066: Add support for feImage filterXisco Fauli
Change-Id: I76cf8932ae352c271283483c9c734408a35b6074 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153770 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2023-06-29tdf#156066: Add support for feDropShadow filterXisco Fauli
Change-Id: I0b2772a7211efb91821853e3369cfc3a5ef6a932 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153727 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2023-06-28tdf#156066: Add support for feFlood filterXisco Fauli
Change-Id: I4d01d40edd6fb91555fd734fc8378df1cbd5743a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153684 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2023-06-27tdf#156068: Add support for feOffset filterXisco Fauli
Change-Id: I1b3dea0ee4f9eb2ee7498962b04baaf5ba68855c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153629 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2023-06-26svgio: simplify codeXisco Fauli
Change-Id: Ie363236a4b2e2d74d583b9f842b48743eefa9d24 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153625 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2023-06-21Fix typoAndrea Gelmini
Change-Id: Id2a9f8eeb5032ef65c5457cd747915914bc32d64 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153317 Tested-by: Julien Nabet <serval2412@yahoo.fr> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2023-06-19tdf#145896: set style to 'text/css' by defaultXisco Fauli
This is a regression from 4c31a0be1d8048bf3340acbb59248185e4b93041 "Resolves: #i125326# accept CssStyles with missing type attribute" Calling setTextCss(true) when there are no attributes is wrong, since it might have attributes like 'id'. The unittest added also covers i125326 is still fixed Change-Id: Ic5e4899211ae98c866f64f17e69a3a8cd24e4959 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153290 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2023-06-08tdf#155735: Add basic support for feColorMatrixXisco Fauli
for now, it only supports type="luminanceToAlpha" Change-Id: Ia84df9af08ac2be2e496a5fadb490deaf48210cf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152741 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2023-06-07tdf#132246: add basic support for feGaussianBlurXisco Fauli
for now only apply it if in="SourceGraphic" is explicitly used Change-Id: I3daea354f61ba5f6b3d13da1e7a71e99d51f6729 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152684 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2023-06-07related: tdf#132246: Add basic filter nodeXisco Fauli
Change-Id: Iff451c441f0fe2c2fd2a14db8214f7a7d554dd15 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152680 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2022-09-21tdf#103888: Do not add a gap at the end of each text portionXisco Fauli
I can't think of any situation where it's needed Change-Id: I1c2c6ec3d22eb9263f3c3c20793d9fe3926b8d78 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140351 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2021-12-15Recheck include/[a-d]* with IWYUGabor Kelemen
See tdf#42949 for motivation Change-Id: I42475b8e75951d5dcae2fe6b0ad0bca64441e7f5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126837 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2021-09-02clang-tidy:readability-redundant-member-initNoel Grandin
Change-Id: I39b9ac81d65f4a269293824642c1b2ec593c0584 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121490 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-04-30svgio: change SVGToken enum to enum classTomaž Vajngerl
Change-Id: Ic2618c91b1793463b7ce0a42ec1db100d11acfa4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114898 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2020-04-29Resolves tdf#132513 - SVG warns on metadataHeiko Tietze
No warnings required for unknown tags, so better go with SAL_INFO Change-Id: Ie9269161d485c457d81b8c2b94a952b5025a46c2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93164 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2020-01-31clang-tidy modernize-concat-nested-namespaceNoel Grandin
Change-Id: Iab35a8b85b3ba1df791c774f40b037f9420a071a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86708 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-03-08new loplugin constvarsNoel Grandin
detect static variables that can be made const. Thanks to mike kaganski for suggesting this. Here I introduce a new plugin feature - using markers in nearby comments to disable the plugin for specific vars. Some of this stuff was old debugging code. I removed the stuff that was older than 5 years. Change-Id: I6ec7742a7fdadf28fd128b592fcdf6da8257585c Reviewed-on: https://gerrit.libreoffice.org/68807 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-01-29loplugin:flatten in svgioNoel Grandin
Change-Id: I3276c2c368c755e070fd8b19a15a954948a68df7 Reviewed-on: https://gerrit.libreoffice.org/67008 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-10-24clang-tidy performance-unnecessary-copy-init in sfx2..svtoolsNoel Grandin
Change-Id: I1e92472b4aaeca1eb1372bd18d10cc9e0766dc39 Reviewed-on: https://gerrit.libreoffice.org/62251 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-10-19clang-tidy readability-container-size-emptyNoel Grandin
Change-Id: I1df70b7dff5ebb6048f7fc618789faa15ca5d422 Reviewed-on: https://gerrit.libreoffice.org/61967 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-09-26loplugin:useuniqueptr in SvgDocumentNoel Grandin
Change-Id: I299e97c276b60be86491bfeee22d46774739ca44 Reviewed-on: https://gerrit.libreoffice.org/60969 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-08-02Add missing sal/log.hxx headersGabor Kelemen
rtl/string.hxx and rtl/ustring.hxx both unnecessarily #include <sal/log.hxx> (and don't make use of it themselves), but many other files happen to depend on it. This is a continuation of commit 6ff2d84ade299cb3d14d4110e4cf1a4b8070c030 to be able to remove those unneeded includes. This commit adds missing headers to every file found by: grep -FwL sal/log.hxx $(git grep -Elw 'SAL_INFO|SAL_INFO_IF|SAL_WARN|SAL_WARN_IF|SAL_DETAIL_LOG_STREAM|SAL_WHERE|SAL_STREAM|SAL_DEBUG') to directories from stoc to svx Change-Id: If562b1aa1d676d2c1cf513e953238abbb846c65c Reviewed-on: https://gerrit.libreoffice.org/58224 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2018-03-05loplugin:useuniqueptr in SvgNodeNoel Grandin
Change-Id: I7ab382bd90050302c24464eed645d20a435dbd63 Reviewed-on: https://gerrit.libreoffice.org/50657 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-01-22ofz#5565 Indirect-leakCaolán McNamara
Change-Id: I7e201494edcf128389951e09ccfb6c7fc1e53315 Reviewed-on: https://gerrit.libreoffice.org/48309 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-01-17ofz#5431 Direct-leakCaolán McNamara
Change-Id: I4ab6739bd2ae63170ade7019036827455f764666 Reviewed-on: https://gerrit.libreoffice.org/48014 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-09-12clang-tidy modernize-use-emplace in svgio..svtoolsNoel Grandin
Change-Id: I4f3b0762e197d5397e723aba1dc43e3c857be145 Reviewed-on: https://gerrit.libreoffice.org/42193 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-07-21loplugin:constparams in svgioNoel Grandin
Change-Id: I35dd8b1373ce3c46a10b1da1ddc6dc3722ffa760 Reviewed-on: https://gerrit.libreoffice.org/40245 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-05-28remove unnecessary use of OString::getStrNoel Grandin
Change-Id: I0490efedf459190521f4339854b3394d57765fdb Reviewed-on: https://gerrit.libreoffice.org/38058 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-01-26Remove dynamic exception specificationsStephan Bergmann
...(for now, from LIBO_INTERNAL_CODE only). See the mail thread starting at <https://lists.freedesktop.org/archives/libreoffice/2017-January/076665.html> "Dynamic Exception Specifications" for details. Most changes have been done automatically by the rewriting loplugin:dynexcspec (after enabling the rewriting mode, to be committed shortly). The way it only removes exception specs from declarations if it also sees a definition, it identified some dead declarations-w/o-definitions (that have been removed manually) and some cases where a definition appeared in multiple include files (which have also been cleaned up manually). There's also been cases of macro paramters (that were used to abstract over exception specs) that have become unused now (and been removed). Furthermore, some code needed to be cleaned up manually (avmedia/source/quicktime/ and connectivity/source/drivers/kab/), as I had no configurations available that would actually build that code. Missing @throws documentation has not been applied in such manual clean-up. Change-Id: I3408691256c9b0c12bc5332de976743626e13960 Reviewed-on: https://gerrit.libreoffice.org/33574 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2016-05-27Get rid of unnecessary directory levels $D/inc/$DTor Lillqvist
Change-Id: Ibf313b8948a493043006ebf3a8281487c1f67b48 Reviewed-on: https://gerrit.libreoffice.org/25532 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tor Lillqvist <tml@collabora.com> Tested-by: Tor Lillqvist <tml@collabora.com>
2016-03-03tdf#98113: SVGIO: Add SvgANode class to handle transport ...Xisco Fauli
... attribute in anchor elements. I used Svggnode class a a reference for this. Change-Id: Id2a58bd913f9984dc91163ca0f333c016aa981f1 Reviewed-on: https://gerrit.libreoffice.org/22822 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Xisco Faulí <anistenis@gmail.com>
2016-02-09Remove excess newlinesChris Sherlock
A ridiculously fast way of doing this is: for i in $(pcregrep -l -M -r --include='.*[hc]xx$' \ --exclude-dir=workdir --exclude-dir=instdir '^ {3,}' .) do perl -0777 -i -pe 's/^ {3,}/ /gm' $i done Change-Id: Iebb93eccbee9e4fc5c4380474ba595858a27ac2c Reviewed-on: https://gerrit.libreoffice.org/22224 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com>