summaryrefslogtreecommitdiff
path: root/svgio/inc
AgeCommit message (Collapse)Author
2024-10-02tdf#163212: context-fill/context-stroke can also use gradientsXisco Fauli
Change-Id: Ic6f7f5e0817d8f5fccee64938004aa899bde47dc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174382 Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org> Tested-by: Jenkins
2024-07-11svgio: simplify and rename to make it easier to understandXisco Fauli
Change-Id: Ia1cc5451d4075237f369ecda45300bccdc02c974 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170378 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2024-05-06tdf#155651: Add support for "context-fill"Xisco Fauli
Change-Id: I6f96cc7c059ece5f9401fc0ae552cf279e53109c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167230 Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org> Tested-by: Jenkins
2024-05-03tdf#155651: Add support for "context-stroke"Xisco Fauli
Change-Id: Ib4f4a7b644d0d6c6b36e31b80fd7adc18999110d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167024 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2024-04-22tdf#159660: Add support for lighten mode in feBlendXisco Fauli
Change-Id: I17471a9c70a38d05de5ad476f817285fb2438e5a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166429 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2024-04-22tdf#159660: Add support for darken mode in feBlendXisco Fauli
Change-Id: I56862163b7bf1177120081c95ab7851a5fc4019b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166428 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2024-04-22tdf#159660: Add support for multiply mode in feBlendXisco Fauli
Change-Id: I03230e122a10dd6ada6af357c674c278b6b99d9e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166427 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2024-04-22tdf#160726, tdf#48062: Simplify how BitmapExs are createdXisco Fauli
In my initial approach, I tranformed the primitive2DContainers before converting them to BitmapEx. This caused circles like https://bugs.documentfoundation.org/attachment.cgi?id=193790 not to be displayed. Simplify how BitmapExs are created by just using the range both primitive2DContainers have in common. This way, DrawBitmapInRect can be dropped now Change-Id: I2401dc87b98e04b9cf9f5ebade2b5622d884fc3a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166391 Tested-by: Xisco Fauli <xiscofauli@libreoffice.org> Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2024-04-21svgio: feImage and feFlood don't support the in attributeXisco Fauli
Added by mistake in b22039cff8380b158307e75762bd3e4ca045d77b "related: tdf#159947: only parse in/result if the element supports them" See https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/in Change-Id: Ie8b5591349eff710d1edc7f413790ac9d31df99d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166389 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2024-04-20tdf#157103: fix SVG whitespace handlingMike Kaganski
Previous code tried to hack some tricks to restore whitespaces after trimming them according to the xml:space attribute value. But it was wrong in multiple ways. 1. The collapsed space must stay in the block where its start was. When a block ended with a space, then trimming the space from it, and adding to a next block, can change the size of the space. 2. The shift of a line (e.g., specifying x and y values) doesn't end the logical line. A space before such a shift must be kept by the same rules, as if there weren't a shift. 3. A block with xml:space="preserve" is treated as if it consists of all non-whitespace characters, even if its leading or trailing characters are spaces. I.e., a trailing space in a block before, or a leading space in a block after, should be collapsed into a single space, not removed - even when the space-preserving block itself is made invisible. Change-Id: Ic778d1e9d6b9d0c342ea74ad78d44bb47bc8d708 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166239 Tested-by: Mike Kaganski <mike.kaganski@collabora.com> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-04-19tdf#160717: fix ex handlingMike Kaganski
Same as in commit e27572686130df43d1d65c574b0c34f39fc0d1a9 (tdf#160593: make sure to use current element's font size for em unit, 2024-04-18) for em. Change-Id: Id9003c0426a6b373456da1aa1550f7ff07f766a3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166235 Tested-by: Mike Kaganski <mike.kaganski@collabora.com> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-04-18tdf#160593: make sure to use current element's font size for em unitMike Kaganski
According to https://drafts.csswg.org/css-values-4/#font-relative-length em is "equal to the computed value of the font-size property of the element on which it is used". This means, that for an element that defines its own font-size, attributes like 'dy' using em refer to the new font-size, not to inherited font-size. Change-Id: Ie5a013df99a68edddf466e4c0ee5311f6219fcb2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166233 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-04-18svgio: factor out common codeXisco Fauli
Change-Id: Ib86f04364593546f53419b37d35469c561561aa1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166188 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2024-04-16tdf#48062: Add support for arithmetic in feCompositeXisco Fauli
Took https://github.com/w3c/csswg-drafts/issues/3831 as a reference Change-Id: I42039c481ec114c3faeae51526a5f29b86960146 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165828 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2024-04-12tdf#159660: Add support for screen mode in feBlendXisco Fauli
Change-Id: Iefe655a370cca930319290baa2a25d791371f55c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165958 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2024-03-28svgio: simplify codeXisco Fauli
Change-Id: Ieead2322e74829f187abf84dacbe8b107ea5130e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165450 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2024-03-27tdf#160386: Add support for switch elementXisco Fauli
For now, only use language tag, meaning if there is a file like in the unittest with <text systemLanguage="en-us">Howdy!</text> <text systemLanguage="en-gb">Wotcha!</text> <text systemLanguage="en-au">G'day!</text> <text systemLanguage="en">Hello!</text> "Hello!" with be displayed in a en_AU system locale This patch partially reverts 13a41e7a12598c7896d6dc8d34aba6af5b80b83c "tdf#150124: do nothing when parent is of unkown type" making 0dfd8288a87b58e503bb3a41be6137485fbf3f68 "ofz#60384 Direct-leak" no longer necessary Change-Id: Ifc73bc69aa997088dc0a2b11d7d30446303fa3b3 Change-Id: I885ef0f2c44b86196881fe55a963db2e5c7eb1be Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165394 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2024-03-26tdf#160373: Iterate over all parents to check whether it's a clipPath contentXisco Fauli
Change-Id: I383ec264e4c88ebcee2ae6a839b762bba8abfc12 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165347 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2024-03-15tdf#48062: Add support for atop operator in feCompositeXisco Fauli
Change-Id: Ifb83b4361d37566d189a7c5b11835f2a5e0eecc2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164862 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2024-03-15tdf#48062: Add support for xor, in and out operators in feCompositeXisco Fauli
atop and arithmetic are still missing Change-Id: I9b5bfeaa87b48071708ca4cb082916ea5f260adb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164852 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2024-03-13tdf#48062: Add support for feComposite filterXisco Fauli
At the moment, only 'over' operator is supported Change-Id: If21c9ba39b3cd0b772ea27165cda7ae40fb42d60 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164765 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2024-03-13tdf#159660: Add support for feBlend filterXisco Fauli
At the moment, only the 'normal' mode is supported Change-Id: I31d1536e03e938ce0f7304a37eb6c1071ecfcf4d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164763 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2024-03-13Fix typo pointer nameAndrea Gelmini
Change-Id: Ieb18b3f4ea7734abfe9e814f39a7c15de7794900 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164779 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Jenkins
2024-03-12tdf#159660: Add support for feMerge and feMergeNodeXisco Fauli
Change-Id: I52e35f6eb5efc7b064145486aa4e6fb2366b143c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164722 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2024-03-12related: tdf#159947: only parse in/result if the element supports themXisco Fauli
There are some filters ( e.g. feMerge ) that do not support in or result attributes Change-Id: I4072dc481557557733e55cc5fcbd80cb11a7ddb5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164718 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2024-03-07Simplify some basegfx::fTools::*orEqual callsNoel Grandin
Comparing with zero is simple - the implementation of basegfx::fTools::moreOrEqual calls rtl_math_approxEqual eventually, which special-zases zero. Change-Id: I62f10f63f103d91a201dfeb20e5b3f9010f377c1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164526 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-03-01tdf#159968: Support overflow:visible in marker elementXisco Fauli
Change-Id: I4ea648cf94a4bb321a78843a9898769a69c5630d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164224 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2024-02-29tdf#159947: Add support for in and result filter attributesXisco Fauli
Change-Id: I8bc7e319a64c528893de8454c64545146ad4e9d8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164108 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
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>