summaryrefslogtreecommitdiff
path: root/svgio
AgeCommit message (Collapse)Author
2023-07-03crashtesting: crash on import of moz610347-2.svgCaolán McNamara
Change-Id: I0793d00216586bf68b4b74305bba2f352eb320bc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153888 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
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-30tdf#118087: set matrix as default value for typeXisco Fauli
From https://www.w3.org/TR/SVG11/filters.html#feColorMatrixElement "If attribute ‘type’ is not specified, then the effect is as if a value of matrix were specified." Change-Id: I8ddaa9129661d9a9f51c474461cf788d8d524a1e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153804 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-29svgio: simplify codeXisco Fauli
Change-Id: I18c4179c36c052cc0ed5b416125e72d542cb7407 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153749 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2023-06-29various XLink fields are deadNoel Grandin
after commit 195364a57a5e3090648cb327607bc52da2be583c Date: Thu Jun 8 13:49:11 2023 +0200 tdf#155733: no need to store these values Change-Id: I4a998add0079cbbcf9eaba38a43fc5411647dd64 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153745 Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org> Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
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-26Revert "tdf#132246, tdf#155735: Add support for SourceAlpha"Xisco Fauli
This reverts commit 75399b8aad6c0f0998b9d0a6eddb2e29f8bc114c. it was incomplete. While at it, do not parse 'in' attribute for now, so only in="SourceGraphic" is used. Implementing the 'in' attribute is not trivial Change-Id: I66c721c1144638f5e3759e0aa3a1c2c062499a90 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153627 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2023-06-26tdf#156038, tdf#78232: support css child combinatorXisco Fauli
Change-Id: I874c368f66db97017357030867f1255551996228 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153626 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-25tdf#156034: improve test a bitXisco Fauli
Change-Id: I164103c92cfb53c4f1ce48dd1ca39dbd9a1efb1d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153566 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2023-06-25tdf#155735: cid#1532475 Out-of-bounds accessXisco Fauli
Change-Id: Ifb3153cc492d042098398695642cd2530bc3b4b9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153564 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2023-06-24cid#1532478 silence Unchecked return valueCaolán McNamara
Change-Id: I62caefd23f542d5c00ea86d84d199ce8ac09833b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153553 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-06-24tdf#132246, tdf#155735: Add support for SourceAlphaXisco Fauli
Change-Id: I8feae2447b17e15113ca45fe46c0d68cb6b6ab71 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153550 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2023-06-23tdf#156034: check for css style further up in the hierarchyXisco Fauli
Change-Id: I92c6673f1249cc4a273c490cdc0496474ce1f0c5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153498 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2023-06-22tdf#156018: check if there is a css style with element inside elementXisco Fauli
Change-Id: I54fa5bea42560eec5ae51dd7ba07de11f418c75c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153466 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2023-06-22tdf#155735: Add support for matrix typeXisco Fauli
Change-Id: Icc172c5f47731ddcf0beca64c72c2022313e74a7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153177 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2023-06-22tdf#155735: Add support for hueRotate typeXisco Fauli
Change-Id: I9c7ada2908c0739708fbc9e28ac58430350da7a9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153112 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-20tdf#155814: only check parent style when it has a local css styleXisco Fauli
This also fixes the problem for filters and mask, since they are call from add_postProcess Adapt some tests to the new xml output. Visually nothing has changed Change-Id: I65d2491409019f4cd0b1113a9a7931fc602c57b5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153355 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2023-06-20tdf#155932: tdf#97717: only apply opacity when primitiveXisco Fauli
Partially revert d47b37eea9779e3c354e6c19a7211a306965b7ef "tdf#97717: do not call add_postProcess from g element" since we still need to call add_postProcess from g to apply the clip-path Change-Id: Ibdc5afadc0db239d0b0e14810943009a4c0a16a9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153353 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2023-06-20svgio: simplify test file a bitXisco Fauli
Change-Id: I2ecbe089b74b9c9f155a44f8706b6832f778c3f0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153320 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
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-19tdf#97717: do not call add_postProcess from g elementXisco Fauli
Otherwise, it will be called twice, from g and from its children Change-Id: I88535a7caab6a7711f917b3f383cd79b3b9fbd2d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153260 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2023-06-17svgio: use "frozen" for mapping between token strings and enumsTomaž Vajngerl
Change-Id: I2061606146cfcb34169dccf69b6f720727839d04 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153174 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2023-06-16tdf#155735: unify unittestXisco Fauli
Change-Id: I8de80f869715d4476e62f526e0bb161de8274977 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153181 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2023-06-15tdf#155833: apply transform to image even if target is equal to viewboxXisco Fauli
Change-Id: Ie820528384d096c6a332e2abd0095f68c7f64a0f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153103 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2023-06-14tdf#155735: Add support for saturate typeXisco Fauli
Add getModifierName to BColorModifier class so when can assert which modifier is being used Change-Id: I2bc2a36470a449df4dc84a8440f232149c1f8278 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153048 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2023-06-14tdf#155819: check marker property comes from a style sheetXisco Fauli
Since 242b7d0162d55be0945ca849c3de841fbf6cb475 "svgio: simplify code" where bIsInStyleSheet was replaced by getCssStyleParent() incorrectly Change-Id: I48632e9374f4615e32d18a141aeabec2936e6ec8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153031 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2023-06-13svgio: remove unneeded initializerXisco Fauli
Added in b1d1a424a4d291873101f5d2348e5bd9cb9091a4 "tdf#155735: Add basic support for feColorMatrix" Change-Id: I6217c15702f0c0338a6aef5d08c755441d2bfaf8 Change-Id: I5673e2243dec6f9ec195622178be34f4fc25b734 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152966 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2023-06-12cid#1532368 Unchecked dynamic_castCaolán McNamara
Change-Id: I132b734e74f0b92e7fcb6230163d876783140b7a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152862 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
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-08tdf#155733: no need to store these valuesXisco Fauli
Change-Id: I1c22f8f344731eb5fbc5f77fc80267ebcdc81ed6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152740 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>
2023-04-26expose parsing svgs for testingCaolán McNamara
Change-Id: I4d59aa9a684bd3e05fca473d6c7567cd8258b242 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151002 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2023-02-28no need to allocate SvgUnits separatelyNoel Grandin
it is only one pointer big Change-Id: Iad5444ed6783abc2916510fd83c5b5a11d17e8f7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147950 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-12-08CppunitTest_svgio: use CPPUNIT_TEST_FIXTURE()Miklos Vajna
This suite is large enough so that avoiding the declaration/registration/definition of each test manually saves a lot of space. Change-Id: I08359c52cfbbd2ff17ec61722479cda26f308590 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143800 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2022-11-29SVG import: add support for semi-transparent textMiklos Vajna
<tspan fill-opacity="..."> from SVG was ignored so far, only taking RGB colors from the 'fill' attribute, but ignoring transparency. The problem is that an SVG file is imported by mapping it to drawinglayer primitives, but TextSimplePortionPrimitive2D takes a basegfx::BColor as the font color, which doesn't handle transparency. Fix the problem by rendering SVG similar to how commit 81b0d5393ca4cf2ff0954e53b05928cde047c2e0 (svx: add rendering for semi-transparent shape text, 2019-11-20) did it for shape text: wrap the text primitive in a UnifiedTransparencePrimitive2D when opacity is not 1. Note that the drawinglayer primitive works with transparency and SVG works with opacity, which is the opposite of each other, but both are 0..1 ranges. Change-Id: If5c48613b70eac662b54b8c9da835cd0a966ba89 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143429 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2022-11-16Use BitmapEx in BitmapPrimitive2DNoel Grandin
we no longer need to wrap it in the framework XBitmap implemenation Change-Id: I0dc56ad63364e2c5a4cedd5e70d4ae7ea7eae563 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142746 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-09-28use more string_view in svgioNoel Grandin
Change-Id: I30d2f02941673ce33febc4e0f563e77b80a585fe Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140707 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-09-23svgio: Simplify by using replaceAllXisco Fauli
Change-Id: Id805787c5b5a812c6fd4fbfe3c3b2905578ce3bf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140482 Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2022-09-23tdf#151118: don't trim leading/trailing spaces in 'preserve' caseXisco Fauli
Thanks again to Mike Kaganski for spotting Change-Id: Ifd8dcf15d7714ebc4f19083fefe0d78d27d46b4c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140483 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2022-09-23tdf#151118: svg: don't replace newline with space when xml:space="default"Xisco Fauli
Partially revert ddf695db44bcb23dc2f1459fd439f93c0b6d5f2a "tdf#151118: svg: fix handling of xml:space="preserve"" See discussion in https://gerrit.libreoffice.org/c/core/+/140404 Thanks to Mike Kaganski for spotting it Change-Id: Ifdd26b8de2f5cc392127f215e148599ae63036dc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140444 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2022-09-22tdf#151118: svg: fix handling of xml:space="preserve"Xisco Fauli
This allows the code to be simplified a bit Change-Id: If42dd9d3ebd7860ece9ff78cb090ff1b07e1b432 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140404 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>
2022-08-30tdf#141908 Replace usage of sal_Int32 with Color in unit testscutamar
Change-Id: Ifb5ff2e6d5ed28bcb9e190d7f2deaaa970693cbc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138938 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-08-18Move tools/diagnose_ex.h to comphelper/diagnose_ex.hxxStephan Bergmann
...so that its TOOLS_WARN_EXCEPTION can be used in comphelper/source/misc/logging.cxx in a follow-up commit. (And while at it, rename from diangose_ex.h to the more appropriate diagnose_ex.hxx. The comphelper module is sufficiently low-level for this immediate use case, so use that at least for now; o3tl might be even more suitable but doesn't have a Library until now. Also, for the immediate use case it would have sufficed to only break DbgGetCaughtException, exceptionToString, TOOLS_WARN_EXCEPTION, TOOLS_WARN_EXCEPTION_IF, and TOOLS_INFO_EXCEPTION out of include/tools/diagnose_ex.h into an additional new include/comphelper/diagnose_ex.hxx, but its probably easier overall to just move the complete include file as is.) Change-Id: I9f3222d4ccf1a9ac29d7eb9ba1530d53e2affaee Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138451 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>