Commit Graph
36 Commits
Author SHA1 Message Date
Hossein 4e2e57b530 tdf#97663 SVGIO: Fix line spacing for <tspan>
tdf#97663 is a regression caused by the commit
701324a1e1. The previous patch caused
LO to forget the size of the font which was needed to calculate line
height based on em units.

em, px, pt, cm, in...
https://www.w3.org/Style/Examples/007/units.en.html

Accompanied with this fix is a unit test provided to avoid this
issue in the future.

The fix can be tested with:

    make CPPUNIT_TEST_NAME="testTdf97663" -sr \
        CppunitTest_svgio

The em_units.svg is opened with Firefox, Chrome and Inkscape and the
rendering in LibreOffice is compatible with the rendering in these
applications.

Change-Id: Idaecd9fb18101f7925fe2a917f7fc3fe7257ebc5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127130
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
2021-12-24 02:00:18 +01:00
Xisco Fauli 3fbccd6820 SVGIO: add unittest for fill:none
Change-Id: I218a0d24222ae3d91c4e6dbd7a619f36823752ee
Reviewed-on: https://gerrit.libreoffice.org/79370
Tested-by: Jenkins
Reviewed-by: Xisco Faulí <xiscofauli@libreoffice.org>
2019-09-23 08:10:24 +02:00
Xisco Fauli 586de7ac43 tdf#123926: SVGIO: Check parent's fill when...
... the element is a clippath and fill=none

fill="none" is created as SvgPaint(aColor, true, false, false)
in svgtools.cxx meaning bSet = true, bCurrent = False and
bOn = False, so it never checks its parent if it's a clippath

Change-Id: Ia8c556674809b2b86280219e4084550e366bbff8
Reviewed-on: https://gerrit.libreoffice.org/79201
Tested-by: Jenkins
Reviewed-by: Xisco Faulí <xiscofauli@libreoffice.org>
2019-09-19 21:57:24 +02:00
Xisco Fauli 428b67cd0d tdf#104339: SVGIO: Add unittest
Change-Id: I6ecb366a889fe64bc90db0e041b4ddd4bc3dfc3f
Reviewed-on: https://gerrit.libreoffice.org/79129
Tested-by: Jenkins
Reviewed-by: Xisco Faulí <xiscofauli@libreoffice.org>
2019-09-19 18:08:05 +02:00
Xisco Fauli ab14799565 tdf#94765: SVGIO: Look for gradient/pattern ids once the file...
... is completely parsed

it might happen the element's id the url points to hasn't been parsed yet

Change-Id: Ia92c9188de5d23f2f992846aa91f3f936aeefacb
Reviewed-on: https://gerrit.libreoffice.org/79118
Tested-by: Jenkins
Reviewed-by: Xisco Faulí <xiscofauli@libreoffice.org>
2019-09-19 13:51:57 +02:00
Xisco Fauli 4007ced54d tdf#99115: add Css selector '*' style only if the element...
... is on top of the hierarchy

Otherwise, we add it for every element on the hierarchy

Adapt unittest from https://bugs.documentfoundation.org/show_bug.cgi?id=100198
Provided by Sam Yygier

Change-Id: I72c7ae08f3ce0194eff86697b202d5553810abeb
Reviewed-on: https://gerrit.libreoffice.org/78997
Tested-by: Jenkins
Reviewed-by: Xisco Faulí <xiscofauli@libreoffice.org>
2019-09-16 15:38:36 +02:00
Tomaž Vajngerl fcb00ac8eb support opacity for widget definition draw SVGs
This opacity influences the whole shape (stroke and fill).

Change-Id: I82e10e07dbf2f321805b55a5f4831a513e52dab8
Reviewed-on: https://gerrit.libreoffice.org/70292
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2019-04-05 14:56:53 +02:00
Tomaž Vajngerl 208a689695 Update SvgRead test - add new parameters and path parsing
Change-Id: Ic19bd2167cc359eef02648fa0ebd1d858fdeaec5
Reviewed-on: https://gerrit.libreoffice.org/68827
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Tested-by: Tomaž Vajngerl <quikee@gmail.com>
2019-03-07 08:34:22 +01:00
Tomaž Vajngerl 7e6dac4edc svgio: fix rendering when the width/height isn't present in SVG
The general size of the image should be the same when width/height
attributes are present. It is very wrong to assume the size of the
image is the area covered by all the primitives in the image.

Change-Id: I56f241e84dee37796f9804ce2569c4eb416e83a0
Reviewed-on: https://gerrit.libreoffice.org/54191
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2018-05-13 15:28:27 +02:00
Xisco Fauli 75003438e4 tdf#101237 SVGIO: Use black as default when parents' fill...
...attributes are empty or none and there's a reference
to a clip-path present.

Change-Id: I4dc4e3bcaac43a007fbdb8a1d006cbd39c737396
Reviewed-on: https://gerrit.libreoffice.org/28500
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Xisco Faulí <anistenis@gmail.com>
2016-08-30 20:41:07 +00:00
Xisco Fauli 9bf1dac4be tdf#99994: Add unittest
Change-Id: I1a58dc21fdcdf8e7688508105fbd6438c7f4bda0
Reviewed-on: https://gerrit.libreoffice.org/25690
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Xisco Faulí <anistenis@gmail.com>
2016-06-01 12:05:38 +00:00
Xisco Fauli 292e25e66d SVGIO: Modify a unittest to check "inherit" in font-family
Change-Id: I4a339b419a5abd1ad02f7aef2abd016a1c2260b8
Reviewed-on: https://gerrit.libreoffice.org/25695
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Xisco Faulí <anistenis@gmail.com>
2016-05-31 09:44:41 +00:00
Xisco Fauli 53f9762889 SVGIO: Add support for font-family in unittests and unify...
.. textsimpleportion's assert

Change-Id: I97d4c76dcfaa6d3ebebfe3eebfabc8ee7799589d
Reviewed-on: https://gerrit.libreoffice.org/25691
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Xisco Faulí <anistenis@gmail.com>
2016-05-31 07:41:56 +00:00
Xisco Fauli 3daee9953d SVG: Add unittest for ecc7f698b5
Change-Id: Icbfd60bd15196649011919e8dea064276e1964b0
Reviewed-on: https://gerrit.libreoffice.org/24097
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Xisco Faulí <anistenis@gmail.com>
2016-04-15 08:05:10 +00:00
Xisco Fauli de32fe5029 SVG: Add unittest for tdf#47446 and tdf#98599
Change-Id: I86bec5694eb0c85596d2573111ddb355bd3ae09e
Reviewed-on: https://gerrit.libreoffice.org/24011
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Xisco Faulí <anistenis@gmail.com>
2016-04-12 22:00:53 +00:00
Xisco Fauli f18d1d7be8 SVG: Check that masking-path-07-b.svg doesn't hang
Change-Id: If8b9a0dd955611f8ebb2859fa9b10a61bfb2230b
Reviewed-on: https://gerrit.libreoffice.org/24010
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Xisco Faulí <anistenis@gmail.com>
2016-04-12 20:29:36 +00:00
Xisco Fauli 93cf43de1b SVG: Add unittest for #i125329#
Change-Id: I2d6fbd81c8d95283cf8937739e338ddac14d8df0
Reviewed-on: https://gerrit.libreoffice.org/24008
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Xisco Faulí <anistenis@gmail.com>
2016-04-12 17:23:00 +00:00
Xisco Fauli 3041df16f8 SVGIO: Don't inherit style attributes from parent if the...
... shapes define their own attributes.

Partially revert commit c2d130425c

Change-Id: Iee98003f4ff63575a28818b091ab77431337192f
Reviewed-on: https://gerrit.libreoffice.org/23571
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Xisco Faulí <anistenis@gmail.com>
2016-03-29 08:00:47 +00:00
Xisco Fauli c2d130425c SVGIO: Shapes within a clippath element might inherit...
... fill, stroke, stroke-width and others attributes from
parent element, like use element

Change-Id: I911bc50409428e81135b81e6dfc82acd1c21d113
Reviewed-on: https://gerrit.libreoffice.org/23527
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Xisco Faulí <anistenis@gmail.com>
2016-03-26 16:20:47 +00:00
Xisco Faulí af46264bcc Revert "tdf#97538: SVGIO: Add unittest"
It fails in Tinderbox Linux-rpm_deb-x86@71-TDF
This reverts commit 3c465c259c.

Change-Id: I20fc69dd785354cc6567b73251ee9161a811bdf0
Reviewed-on: https://gerrit.libreoffice.org/22987
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Xisco Faulí <anistenis@gmail.com>
2016-03-07 18:06:53 +00:00
Xisco Fauli 3c465c259c tdf#97538: SVGIO: Add unittest
Change-Id: I5bf523ac532ad19a005d99e19deb1e0ec9ce96e4
Reviewed-on: https://gerrit.libreoffice.org/22955
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Xisco Faulí <anistenis@gmail.com>
2016-03-07 08:47:40 +00:00
Xisco Fauli 6afec8e461 tdf#97936: SVGIO: Add unittest
Change-Id: I7adb55dc408811f03365578f815bf1b7fbe7f2fd
Reviewed-on: https://gerrit.libreoffice.org/22679
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Xisco Faulí <anistenis@gmail.com>
2016-02-25 08:43:01 +00:00
Xisco Fauli 324014c997 SVGIO: Fix problem when relative font-size depends on its...
... parent's font-size

Change-Id: I13943923c401a5a06b3aa51181fd75292534e888
Reviewed-on: https://gerrit.libreoffice.org/22452
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-02-19 06:28:11 +00:00
Xisco Fauli 85c789be1f SVGIO: tdf#97941: Don't double tspan fontsize
Same as in 701324a1e1

Change-Id: I531bef4821008ef71951506c133f999b9ab4f4ff
Reviewed-on: https://gerrit.libreoffice.org/22450
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Xisco Faulí <anistenis@gmail.com>
2016-02-18 08:39:10 +00:00
Xisco Fauli 3c8b880c5e SVGIO: tdf#97659: Add support for RGBA
Change-Id: Icbf3796cdc95f91d298a5ca52d44931b3985eac6
Reviewed-on: https://gerrit.libreoffice.org/22303
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-02-13 13:38:39 +00:00
Xisco Fauli 0ab6332f97 SVGIO: tdf#97543: Add import test
Change-Id: Ia89f43ed1da9ead254f191bcbcc4ac338a9dda7a
Reviewed-on: https://gerrit.libreoffice.org/22302
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Xisco Faulí <anistenis@gmail.com>
2016-02-11 23:32:02 +00:00
Xisco Fauli b6a62f0755 tdf#97542: SVGIO: First check the current fill attribute
Differenciate when gradient is defined in the text element or in its parents

Add unit tests

Change-Id: I85b09f72fbb1a3c8d2fa7350b4396b5bf924277f
Reviewed-on: https://gerrit.libreoffice.org/22131
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Jochen Nitschke <j.nitschke+logerrit@ok.de>
Reviewed-by: Xisco Faulí <anistenis@gmail.com>
2016-02-11 17:17:06 +00:00
Xisco Fauli 05554bc478 SVGIO: tdf#79163: Add import test
Change-Id: I891425f331e9be21c160eb0b11f05dba280bef23
Reviewed-on: https://gerrit.libreoffice.org/22196
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: jan iversen <jani@documentfoundation.org>
Tested-by: jan iversen <jani@documentfoundation.org>
2016-02-09 17:23:00 +00:00
Xisco Fauli 8fbbb923ea SVGIO: tdf#85770: Add import test
Change-Id: Ifffe1d461ae6fa30a9cc61df2ece5716078031ab
Reviewed-on: https://gerrit.libreoffice.org/22190
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: jan iversen <jani@documentfoundation.org>
Tested-by: jan iversen <jani@documentfoundation.org>
2016-02-09 14:27:01 +00:00
Xisco Fauli 1dad3e2a12 SVGIO: tdf#45771: Add import test
Change-Id: Ib1b66a3d91374bcf458bb368483f33cd4b8e0f0d
Reviewed-on: https://gerrit.libreoffice.org/22189
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: jan iversen <jani@documentfoundation.org>
Tested-by: jan iversen <jani@documentfoundation.org>
2016-02-09 12:02:16 +00:00
Xisco Fauli 17f01039fc SVGIO: Add import test for 7c151f3914
Change-Id: I4ab4463dfa2422fd0d8fa1fd65d7765f716c9bc3
Reviewed-on: https://gerrit.libreoffice.org/22188
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: jan iversen <jani@documentfoundation.org>
2016-02-09 08:48:49 +00:00
Xisco Fauli 805b328858 SVGIO: Add import test for Fontsize keywords
Change-Id: I042a1deeec1c07f73f09ddd2fb71b9d2eba6b8c6
Reviewed-on: https://gerrit.libreoffice.org/22187
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Reviewed-by: jan iversen <jani@documentfoundation.org>
2016-02-09 07:10:41 +00:00
Xisco Fauli 5654e8f2cf SVG: add import test for tdf#87309
Change-Id: I0f899fbab73ae43e09ca2afc18d956f42ec8b0a7
Reviewed-on: https://gerrit.libreoffice.org/19537
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Katarina Behrens <Katarina.Behrens@cib.de>
2015-11-02 14:30:19 +00:00
Tomaž Vajngerl ba91106b95 Change RectWithStylesByGroup to be same as other style tests
Change-Id: Ib7b0d2e8160a938821940645ea6e6471188bcc16
2014-08-02 22:37:11 +02:00
Joren De Cuyper 2dbd2cb9a5 Avoid infinite loop when gathering "g" element styles
Same way of how fdo#74743 is fixed 3b7472b284

Change-Id: If6cc8eb6ff89b0081f27ff75a9b60a3e81cff1bd
Reviewed-on: https://gerrit.libreoffice.org/10326
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Tested-by: Tomaž Vajngerl <quikee@gmail.com>
2014-07-15 14:28:29 +00:00
Tomaž Vajngerl 8c571e5f82 svgio: introduce svg import tests
Change-Id: Id69f659a9e4b0332970e75b1d0a7d820c8b2c998
2014-04-16 09:52:27 +02:00