274 Commits
Author SHA1 Message Date
Khaled Hosny 02c7caae9a svgio: font-variation-settings is an inherited property
It is inherited per CSS Fonts, so the children of a group must inherit
it when set on the group.

Change-Id: I3a7f1c58b249e0d647c3b8a15f9e2043b7d6c891
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/209212
Reviewed-by: Khaled Hosny <khaled@libreoffice.org>
Tested-by: Jenkins
2026-08-17 22:51:42 +02:00
Xisco Fauli 00aebb5e88 loplugin:unusedmethods
Change-Id: I5eec1b68efc285995db3b5825699c07fa006cb35
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/207375
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
2026-06-29 10:16:53 +02:00
Xisco Fauli 6f81bce807 loplugin:unusedmethods
Change-Id: I57a535f72e639a9b708c5c7dc1790e354d2d477e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/205943
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
2026-06-04 10:00:29 +02:00
Xisco Fauli cfd3309a5d loplugin:unusedmethods
Check existing ones that can be removed

Change-Id: I6ee6fc1772c620ac5d12fea915681b094b7c3bfd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/204583
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-04-30 08:54:45 +02:00
Khaled Hosny 1a571fde09 tdf#118792: Add support for font-variation-settings in SVG import
Change-Id: Iaae0426667a3d9357a3c714c6c63f52f79f06706
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/203286
Tested-by: Jenkins
Reviewed-by: Khaled Hosny <khaled@libreoffice.org>
2026-04-08 10:09:39 +02:00
Mike Kaganski e18a815190 Use rtl::isAscii(Hex)Digit and o3tl::convertToHex
Since some code needs flexibility in error handling, where hardcoded
error value of -1 wasn't handy, o3tl::convertToHex was changed to
accept the error value as its template parameter.

Change-Id: Ifc771cc8fa29a801d4556dea969fc3ea7e620df5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/199367
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Tested-by: Jenkins
2026-02-14 11:40:50 +01:00
Xisco Fauli f127f708f6 tdf#168452: support unicode-bidi in svg
Before this change, getBiDiStrong() was never used
to manipulate the text

Change-Id: I9d6a2e8b79d27126902f2be84174c641ec71c28c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/191123
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2025-09-18 16:34:18 +02:00
Xisco Fauli 4efae74abc tdf#168421: support RTL text direction in svg
Change-Id: Iba8853d131bf88be3cc94003a73ffe545cf62004
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/190978
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2025-09-15 22:39:35 +02:00
Gabor Kelemen 9cf87b3f30 Remove obsolete fw declarations from store/ svgio/ svl/ svtools/
found with bin/find-unneeded-includes --fwdecl

Change-Id: I2c2c082d761b87bfe731ab21caa2f04e385c2e3a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183906
Tested-by: Jenkins
Reviewed-by: Gabor Kelemen <gabor.kelemen.extern@allotropia.de>
2025-05-12 17:05:03 +02:00
Xisco Fauli 16684eb4ba tdf#163212: context-fill/context-stroke can also use gradients
Change-Id: Ic6f7f5e0817d8f5fccee64938004aa899bde47dc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174382
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
2024-10-02 14:31:47 +02:00
Xisco Fauli a0e6135270 svgio: simplify and rename to make it easier to understand
Change-Id: Ia1cc5451d4075237f369ecda45300bccdc02c974
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170378
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2024-07-11 17:34:00 +02:00
Xisco Fauli 3b0f96a077 tdf#155651: Add support for "context-fill"
Change-Id: I6f96cc7c059ece5f9401fc0ae552cf279e53109c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167230
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
2024-05-06 22:02:01 +02:00
Xisco Fauli d75a37a582 tdf#155651: Add support for "context-stroke"
Change-Id: Ib4f4a7b644d0d6c6b36e31b80fd7adc18999110d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167024
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2024-05-03 11:50:42 +02:00
Xisco Fauli 41368edc6e tdf#159660: Add support for lighten mode in feBlend
Change-Id: I17471a9c70a38d05de5ad476f817285fb2438e5a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166429
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2024-04-22 15:20:16 +02:00
Xisco Fauli a9f1b70527 tdf#159660: Add support for darken mode in feBlend
Change-Id: I56862163b7bf1177120081c95ab7851a5fc4019b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166428
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2024-04-22 14:55:44 +02:00
Xisco Fauli fdf3027a0e tdf#159660: Add support for multiply mode in feBlend
Change-Id: I03230e122a10dd6ada6af357c674c278b6b99d9e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166427
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2024-04-22 14:55:37 +02:00
Xisco Fauli 4b6e0f2c88 tdf#160726, tdf#48062: Simplify how BitmapExs are created
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-22 11:53:41 +02:00
Xisco Fauli ae5e743f90 svgio: feImage and feFlood don't support the in attribute
Added by mistake in b22039cff8
"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-21 22:34:44 +02:00
Mike Kaganski 6e6081b340 tdf#157103: fix SVG whitespace handling
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-20 12:16:08 +02:00
Mike Kaganski edef46e82e tdf#160717: fix ex handling
Same as in commit e275726861
(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-19 05:18:50 +02:00
Mike Kaganski e275726861 tdf#160593: make sure to use current element's font size for em unit
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-18 18:21:09 +02:00
Xisco Fauli 176406a07e svgio: factor out common code
Change-Id: Ib86f04364593546f53419b37d35469c561561aa1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166188
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2024-04-18 17:24:10 +02:00
Xisco Fauli cb4698626f tdf#48062: Add support for arithmetic in feComposite
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-16 09:36:37 +02:00
Xisco Fauli 732ca4879b tdf#159660: Add support for screen mode in feBlend
Change-Id: Iefe655a370cca930319290baa2a25d791371f55c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165958
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2024-04-12 10:47:56 +02:00
Xisco Fauli 128274d598 svgio: simplify code
Change-Id: Ieead2322e74829f187abf84dacbe8b107ea5130e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165450
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2024-03-28 19:42:54 +01:00
Xisco Fauli 0a2535ceb0 tdf#160386: Add support for switch element
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 13a41e7a12
"tdf#150124: do nothing when parent is of unkown type"
making 0dfd8288a8
"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-27 23:44:40 +01:00
Xisco Fauli feb4e0890b tdf#160373: Iterate over all parents to check whether it's a clipPath content
Change-Id: I383ec264e4c88ebcee2ae6a839b762bba8abfc12
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165347
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2024-03-26 18:38:59 +01:00
Xisco Fauli 4e9b39aefb tdf#48062: Add support for atop operator in feComposite
Change-Id: Ifb83b4361d37566d189a7c5b11835f2a5e0eecc2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164862
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2024-03-15 13:30:40 +01:00
Xisco Fauli b240f6198f tdf#48062: Add support for xor, in and out operators in feComposite
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-15 01:06:22 +01:00
Xisco Fauli 626047baba tdf#48062: Add support for feComposite filter
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-13 19:02:38 +01:00
Xisco Fauli af8a899840 tdf#159660: Add support for feBlend filter
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-13 19:02:31 +01:00
Andrea Gelmini 77447b24f3 Fix typo pointer name
Change-Id: Ieb18b3f4ea7734abfe9e814f39a7c15de7794900
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164779
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Tested-by: Jenkins
2024-03-13 19:02:10 +01:00
Xisco Fauli 73e5b6667c tdf#159660: Add support for feMerge and feMergeNode
Change-Id: I52e35f6eb5efc7b064145486aa4e6fb2366b143c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164722
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2024-03-12 23:03:33 +01:00
Xisco Fauli b22039cff8 related: tdf#159947: only parse in/result if the element supports them
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-12 22:39:20 +01:00
Noel Grandin 7979508e43 Simplify some basegfx::fTools::*orEqual calls
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-07 12:53:27 +01:00
Xisco Fauli a661f9a2e0 tdf#159968: Support overflow:visible in marker element
Change-Id: I4ea648cf94a4bb321a78843a9898769a69c5630d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164224
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2024-03-01 21:46:01 +01:00
Xisco Fauli c73f3491be tdf#159947: Add support for in and result filter attributes
Change-Id: I8bc7e319a64c528893de8454c64545146ad4e9d8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164108
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2024-02-29 17:52:05 +01:00
Xisco Fauli f0d6b3e727 tdf#159566: match 'central' dominant-baseline to 'middle'
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-02-05 16:44:05 +01:00
Xisco Fauli e7186b49a9 tdf#158445: support viewBox in symbol elements
Change-Id: Ie45b1e1dd4a4dcfc3cf3ce3d30f8dd9e040e37fb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162605
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2024-01-26 19:31:03 +01:00
Mike Kaganski 48ff87e100 Drop rTokenName argument from SvgNode::parseAttribute
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-27 06:35:41 +02:00
Mike Kaganski 009ea6f786 Commit 04c78e1a46 follow-up
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-27 06:35:26 +02:00
Stephan Bergmann bd6fb0cd3e Extended loplugin:ostr: Rewrite some O[U]StringLiteral -> O[U]String
...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-10-23 11:04:42 +02:00
Xisco Fauli b224733640 tdf#129356: handle css combinator when the element name is combined...
... 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-22 20:06:24 +02:00
Xisco Fauli 8fa209ce2e tdf#156834: Add basic support for dominant-baseline attribute
Change-Id: I005d6ca6bc340d73cae639ccd09321a0a00bc4b7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155892
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2023-08-21 19:59:27 +02:00
Xisco Fauli 56a3603287 tdf#156837: check baseline-shift from parent too
Change-Id: I6e62d794dd4410447db3bee26c1e18fe9dad6a9c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155895
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2023-08-21 15:49:15 +02:00
Xisco Fauli 8da4e51726 svgio: fix typo in code
Change-Id: Ice8e830cebf307b6a4deb9dbbd26e65b34420a31
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155734
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2023-08-16 12:22:13 +02:00
Xisco Fauli 5cfd31e505 tdf#93583: use getTextWidth to calculate line's width
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-15 03:53:06 +02:00
Xisco Fauli dcb3cb0bd4 tdf#156616: check if character's parent has x or y
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-12 10:00:29 +02:00
Xisco Fauli ad3d6732dc related: tdf#151103: simplify code
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-10 16:52:32 +02:00
Xisco Fauli fff601edf7 svgio: move SvgTextPosition to its own file
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-10 16:34:54 +02:00