summaryrefslogtreecommitdiff
path: root/svgio
AgeCommit message (Collapse)Author
2023-11-19Extended loplugin:ostr: svgioStephan Bergmann
Change-Id: I5a93e5f0a3cfc0fd85ac53ba2f58131561508386 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159675 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-11-02Related: tdf#157939 put CppunitTest_svgio under non_application_font_use:abortCaolán McNamara
Change-Id: Ib48e8045ad739b6f6fe98ab00cd609b54d4c3113 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158843 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
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-09-26tdf#97710: do not create nonzero conform for polylineXisco Fauli
Change-Id: Ib9d4e957b83ad84b79ae4ade5c6be3ab3d9d8028 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157286 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2023-09-09XSvgParser does not need to implement XAggreggationNoel Grandin
Checked on jenkins using 'make check' and +void SAL_CALL setDelegator(css::uno::Reference<css::uno::XInterface> const &) final { assert(false); } Change-Id: Id392a4fc3ddf34ce1fa2b66eb1e509e05184e50c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156721 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-09-07svgio: update commentXisco Fauli
After 4f656a057e2a92e2107f7820fc563498c801d7d3 "svgio: handle addGap internally inside SvgCharacterNode" Change-Id: Ib3ddbaed7a07c1b3b9f21eafd0715622751829ce Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156648 Tested-by: Xisco Fauli <xiscofauli@libreoffice.org> Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2023-09-06tdf#157113: Add gap even if baseline is differentXisco Fauli
This was a workaround for https://bz.apache.org/ooo/show_bug.cgi?id=122524 but it's no longer needed since 5079e7937ef471a44dcf119dc6ae0a334d9c6adc "tdf#156251: Add gap between text elements when needed" Change-Id: I83af59a515d56af6b0e3cf3e351d3df52510a17d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156613 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2023-09-05tdf#156569: '%' can be in the middle of the stringXisco Fauli
Change-Id: I5d6ab57c17ab2cbce4d3df629a91a006fad2198d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156564 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
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-18tdf#142424: Revert "related tdf#156579: just break for switch element"Xisco Fauli
This reverts commit e222f60ac2a71032dbdf62d7c7e28978b5a0b19c. To make the switch element behave like a group as least, so the transform attribute is parsed Change-Id: Id8c21ac6da217d8f7bc350ff41022335bf1e0f1f Change-Id: If1e53f9baad8995f26f9b885cfef6265040736bc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155758 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#156777: check for css style in textpathXisco Fauli
Change-Id: I63a274dd9fba37852412a194a490cb2b7634f1cb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155726 Tested-by: Xisco Fauli <xiscofauli@libreoffice.org> Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2023-08-15tdf#86938: fix calculation of baseline-shiftXisco Fauli
Change-Id: I8c30c29052f2ea1fe6e49360b972af868851131b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155671 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-11cid#1539807 Uninitialized pointer fieldCaolán McNamara
Change-Id: I500c5d9f15c6a57622a28ea7cbf3b5f90761b5c0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155582 Tested-by: Caolán McNamara <caolan.mcnamara@collabora.com> Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
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-10svgio: avoid dynamic_castXisco Fauli
Change-Id: I9a2e2c4341476a59ffb001c42e7812cb8249c856 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155548 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-09svgio: remove recurrent checksXisco Fauli
Change-Id: I26c37e6b58e7c54e2bdc2c77543896daceb638d3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155520 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2023-08-08crashtesting: null-deref on kde114933-2.svgCaolán McNamara
Change-Id: If344bd676eb0eefd2d1bb4728bd0ca1e602c076e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155432 Tested-by: Jenkins Tested-by: Caolán McNamara <caolan.mcnamara@collabora.com> Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-08-03svgio: Simplify codeXisco Fauli
Change-Id: Ibd28973fee006f3853fde64c519dd0cd8c1573ba Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155322 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-03related tdf#156579: just break for switch elementXisco Fauli
Change-Id: I4a31431325c44440f773f6f345d2a0a057d1fa37 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155317 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#95400: svgio: Add unittestXisco Fauli
Change-Id: I88d56bafce22231ca05864ee9dbeb8c31b4dcb50 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155265 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2023-08-02tdf#156577: do no use parent position if x array is emptyXisco Fauli
Change-Id: Id29e5a440dbc3719c53bcc9226336a3c99d469e3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155216 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-23Make CppunitTest_svgio CPPUNIT_TEST_NAME=testCssClassRedefinition more robustKhaled Hosny
The commit: commit 9e83d35c4a22bcb465f0736dda9b752b29f83959 Date: Thu Jun 23 21:52:52 2022 +0200 Make CppunitTest_svgio CPPUNIT_TEST_NAME=Test::testCssClassRedefinition robust Changed the font from generic Sans to Open Symbol to avoid failure when a different font is used, but it didn’t change the text string to a one supported by Open Symbol, so font fallback would still make the test fail. Change the text string to “012” which is supported by Open Symbol. Change-Id: I6e6ba22614ef1bafe5aece05c42d57d71923380c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154492 Tested-by: Jenkins Reviewed-by: خالد حسني <khaled@libreoffice.org>
2023-07-14tdf#156271: add dx shift on top of x positionXisco Fauli
Change-Id: I61263a7fec2ec8236221a10f8cb730899c878f5f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154403 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2023-07-14svgio: remove redundant checkXisco Fauli
Change-Id: Ie507fb1bf06f75e2fd673864a9ee9046aeb19377 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154401 Tested-by: Xisco Fauli <xiscofauli@libreoffice.org> Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2023-07-13tdf#156269: dx and dy do not depend on x and yXisco Fauli
Change-Id: I99be5aa45b333ec3825373c3a10be0e24d23cb29 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154380 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-12tdf#156236: For the rx or ry properties, "0" is validXisco Fauli
Change-Id: I32c865e409a339c444440e00ee0f624c45380773 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154307 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2023-07-11svgio: use frozen::make_unordered_map so no need to specify the countXisco Fauli
Change-Id: Id8400cba4c00439b4f4b888782d68531f7a64617 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154293 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2023-07-10svgio: remove recurrent checkXisco Fauli
Change-Id: I1b346007f5ae5e95b559cae1a9e8fdd3f4d93502 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154271 Tested-by: Jenkins 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#156201: just check one level up in the style stackXisco Fauli
Otherwise, the parent might also have a local css style Change-Id: Ib6d1340045f22861aee3e526d22d014eeb2f5d38 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154248 Tested-by: Xisco Fauli <xiscofauli@libreoffice.org> 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-06tdf#156167: create separate map for case insensitive stringsXisco Fauli
Add static_assert to make sure both maps have the same size Regression from: svgio: use "frozen" for mapping between token strings and enums Change-Id: I2061606146cfcb34169dccf69b6f720727839d04 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153174 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com> Change-Id: Ic54dfe45eaff5ef75bcd4ebab715f278540da913 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154055 Tested-by: Xisco Fauli <xiscofauli@libreoffice.org> Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2023-07-06svgio: use frozen moreXisco Fauli
Change-Id: I64c5d12321a10cc1f63d7892c83ff7bd3a232a26 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154072 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>