summaryrefslogtreecommitdiff
path: root/svgio/inc
AgeCommit message (Collapse)Author
2024-02-05tdf#159566: match 'central' dominant-baseline to 'middle'Xisco Fauli
Inkscape also does it the same way Change-Id: I3e1cea091e7314886bbc9135c55698892239bec7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163006 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2024-01-26tdf#158445: support viewBox in symbol elementsXisco Fauli
Change-Id: Ie45b1e1dd4a4dcfc3cf3ce3d30f8dd9e040e37fb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162605 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
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-10-27Commit 04c78e1a46a423071d7ea68724525ec7ef92e0e8 follow-upMike Kaganski
Drops duplicating map, and uses std::find_if with case-insensitive comparison. Likely to have some performance impact, but avoids the maintenance penalty of two maps. Change-Id: I7144556488aa134d9b9214b00ba9d7c4e0fb68a3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154159 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2023-10-23Extended loplugin:ostr: Rewrite some O[U]StringLiteral -> O[U]StringStephan Bergmann
...in include files. This is a mix of automatic rewriting in include files and manual fixups (mostly addressing loplugin:redundantfcast) in source files that include those. Change-Id: I1f3cc1e67b9cabd2e9d61a4d9e9a01e587ea35cc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158337 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-08-22tdf#129356: handle css combinator when the element name is combined...Xisco Fauli
... with the ID or the class While at it, simplify the code a bit Change-Id: I9e36f334b884d31229568835a346d4427a47c760 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155945 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2023-08-21tdf#156834: Add basic support for dominant-baseline attributeXisco Fauli
Change-Id: I005d6ca6bc340d73cae639ccd09321a0a00bc4b7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155892 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2023-08-21tdf#156837: check baseline-shift from parent tooXisco Fauli
Change-Id: I6e62d794dd4410447db3bee26c1e18fe9dad6a9c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155895 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2023-08-16svgio: fix typo in codeXisco Fauli
Change-Id: Ice8e830cebf307b6a4deb9dbbd26e65b34420a31 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155734 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: move SvgTextPosition to its own fileXisco Fauli
In order to avoid a circular dependency in a follow-up commit Change-Id: Ib7b16e73282dfa6f3ca87aab1044cb92df72b6bf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155555 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-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-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-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-08-01tdf#156283: take remaing dx value into consideration tooXisco Fauli
Change-Id: I27c6f12edacd68c7f956b67dcf9ef0cc5045e3d1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155169 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-10tdf#149673: only check opacity from parent...Xisco Fauli
... if it has a local css style Because it's the first in the style stack Partially reverts 3e0e67a152e9631574e28dacb6e06a96f03ebca2 "tdf#155932: tdf#97717: only apply opacity when primitive" Change-Id: I6a6bf08a519c84ac58c6111fd7da308cbf8a3021 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154270 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2023-07-10tdf#99562: Do not ignore last column from matrixXisco Fauli
Change-Id: I1dff65963e2c414d1771a1592159930150c513e0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154241 Tested-by: Jenkins 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-05ofz#60384 Direct-leakCaolán McNamara
since: commit 13a41e7a12598c7896d6dc8d34aba6af5b80b83c Date: Mon Jul 3 14:11:43 2023 +0200 tdf#150124: do nothing when parent is of unkown type Change-Id: I58edf5f63d97e8afb1cd58c7e23452a9ea6a87eb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154023 Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org> Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
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-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-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-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-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>
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-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-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>