summaryrefslogtreecommitdiff
path: root/svgio
AgeCommit message (Collapse)Author
2021-12-24Fix Test::testTdf97663Jan-Marek Glogowski
Unfortuately the build and merge of commit 4e2e57b530544736804ab663f832173ba1d78559 ("tdf#97663 SVGIO: Fix line spacing for <tspan>") overlapped with the merge of commit e3bd776e020723ad8caf0a02d8db0d19e0f0e650 ("Split BasePrimitive2D UNO interface into separate object") Change-Id: Iaa7c4ffda7d863a2571c7f8320889b668f82a844 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127394 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
2021-12-24tdf#97663 SVGIO: Fix line spacing for <tspan>Hossein
tdf#97663 is a regression caused by the commit 701324a1e1f7e0c181ff1a50956ced686785ea53. 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-23Split BasePrimitive2D UNO interface into separate objectNoel Grandin
Rather than make all the BasePrimitive2D classes bear the cost of being an UNO object, we just wrap the top level BasePrimitive2D in this class when we need to pass them over UNO. This reduces the locking overhead when doing normal drawinglayer operations, and reduces the size of drawinglayer objects and the cost of initialising them, which shaves 5% off the load/display time of a large barchart. Add new drawinglayer::convertPrimitive2DContainerToBitmapEx utility method to avoid needing to convert to Sequence<XPrimitive2D> Change-Id: I553eaa4c16ba016b098cb21f6c55f5008f0d9b53 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126487 Tested-by: Noel Grandin <noel.grandin@collabora.co.uk> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-12-22Separate core drawinglayer func. into drawinglayercore libraryTomaž Vajngerl
This separates the drawinglayer core functionallity into a separate library, to keep a strict separation what is backend dependent and what is not. More strict separation can be done at a later date. This will make it possible to push part of drawinglayer (part of processor2d) directly into VCL. Change-Id: Ibc26580067e50bf20d7cdd37fa0e44eb10200878 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127286 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-12-16Remove transitional header drawinglayer/primitive2d/polygonprimitive2d.hxxGabor Kelemen
follow up to commit 1103727fb24b368419ea0cfd2382560ef6b82f43 Change-Id: I227042f4703f3f4c18a8dc0355f044d2ad7dfb2b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126838 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2021-12-15Recheck include/[a-d]* with IWYUGabor Kelemen
See tdf#42949 for motivation Change-Id: I42475b8e75951d5dcae2fe6b0ad0bca64441e7f5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126837 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2021-12-10Generally determine Rdb content from gb_*_set_componentfile callsStephan Bergmann
...instead of by listing the content somewhat redundantly in the Rdb_*.mk files, to avoid duplication of logic for components that are only built conditionally (and thus should only be included conditionally in the corresponding Rdb). To achieve that, add an "rdb" parameter to gb_ComponentTarget_ComponentTarget (and to the gb_*_set_componentfile macros that internally call gb_ComponentTarget_ComponentTarget), which is used to make the appropriate gb_Rdb_add_component call internally from within gb_ComponentTarget_ComponentTarget. (As a special case, gb_CppunitTest_set_componentfile shall not call gb_Rdb_add_component, as that has already been done by the corresponding gb_Library_set_componentfile call, so allow the gb_ComponentTarget_ComponentTarget "rdb" parameter to be empty to support that special case.) Most Rdb_*.mk files are thus mostly empty now. One exception is i18npool/Rdb_saxparser.mk, which duplicates some of the Rdb_services content as needed during the build in CustomTarget_i18npool/localedata. 1c9a40299d328c78c035ca63ccdf22c5c669a03b "gbuild: create services.rdb from built components" had already tried to do something similar (in addition to other things) under a new --enable-services-rdb-from-build option. However, that approach had four drawbacks that this approach here addresses (and which thus partly reverts 1c9a40299d328c78c035ca63ccdf22c5c669a03b): 1 Rdb_services shall not contain the component files of all libraries that are built. While that commit filtered out the component files that go into Rdb_ure/services (ure/Rdb_ure.mk), it failed to filter out the component files that go into others like Rdb_postgresql-sdbc (connectivity/Rdb_postgresql-sdbc.mk). 2 The code added by that commit to Makefile.gbuild codified the knowledge that there is an Rdb_services, which is brittle. 3 The code added by that commit to solenv/gbuild/Rdb.mk codified the knowledge (for gb_Rdb__URECOMPONENTS) that there is an Rdb_ure/services, which is brittle. 4 Introducing an --enable-services-rdb-from-build option needlessly provided two different ways how the content of Rdb_services is assembled. The changes done here would leave --enable-services-rdb-from-build as a misnomer, as it no longer controls how Rdb_services is assembled. I thus renamed it to --enable-customtarget-components, as that is apparently what it still does now. Change-Id: Ia5e8df4b640146c77421fcec6daa11a9cd260265 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126577 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-11-22Cleaning up math in SvgNumberHossein
* Simplifying math expression Change-Id: Ie67874eb79879186a1b971fbdc2c02945bae9191 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123092 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2021-11-19Use M_PI* instead of F_PI*Mike Kaganski
Change-Id: Ie2b7a1c74fc516781a17a20157b8217bc41e383d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125504 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-11-12improve mergeToSinglePolyPolygonNoel Grandin
spotted by llunak. No need to take param by &&, since mergeToSinglePol does not actually need to modify it. Also flatten it a little. Change-Id: I2f5ade347db756e21ecb0a88c3935805268f5072 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125086 Reviewed-by: Luboš Luňák <l.lunak@collabora.com> Tested-by: Jenkins
2021-11-11Use o3tl::convertMike Kaganski
Change-Id: I62239252efed514de7db88b4bea6f4d4d719fb17 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125021 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-11-03loplugin:finalclassesNoel Grandin
Change-Id: I10ff73f89c965beb3cfb5fc3a40dd959d8f77aaa Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124600 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-10-31Prepare for removal of non-const operator[] from Sequence in svgioMike Kaganski
Change-Id: I2ae44fc1016b062b574b3aa1e25f5b59b18e2fe4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124394 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-10-26Add documentation for the 'svgio' moduleHossein
The module 'svgio' is used to read SVG. This is the list of topics discussed in the documentation: * Introduction * How does it work? * Known Bugs * Dependencies * Related Software * References Change-Id: If42e9c2e10145c12cd5d74019b36bc5d78dd5bb9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124178 Tested-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org> Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
2021-10-17Use range based for loopsHossein
* Use range based for loops where it was possible in svgio + Goal: Better readability of the code Change-Id: I6259e2391006287d5d330277dd8d700012c32932 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123712 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-10-11loplugin:moveparam in svgioNoel Grandin
Change-Id: I4badd081340c9f8e8fcce97bd730f9c7da046382 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123426 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-10-10loplugin:moveparam in basegfxNoel Grandin
Change-Id: I73414e94358114ff0d475f13855db8c4c493b6f5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123334 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-10-06Cleanup svgcharacternode.cxxHossein
* Replacing Ternary conditional operator "?:" with "if" statements * Adding using "namespace drawinglayer::primitive2d;" to avoid long statements Converting this: drawinglayer::primitive2d::TextStrikeout eTextStrikeout = drawinglayer::primitive2d::TEXT_STRIKEOUT_NONE; to this, which is much more readable: TextStrikeout eTextStrikeout = TEXT_STRIKEOUT_NONE; * This is avoided in the header file with only one usage of this namespace Change-Id: I0bbc80a894056806dc03f46df5b62d92c2cd4a0e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123102 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2021-10-06loplugin:moveparam in drawinglayerNoel Grandin
Change-Id: I428116d96a011b061dda8376b6f27fb135a62964 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123114 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-09-24reduce copying in drawinglayerNoel Grandin
by passing PrimitiveContainer&& around. There are lots of place where we were preparing a local variable of type PrimitiveContainer, and then copying it someplace else, then throwing it away. Change-Id: Iacfd983640c9e55da25800ccc01734dfc8b4d64a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122527 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-09-22Extend loplugin:stringviewparam to starts/endsWith: svgioStephan Bergmann
Change-Id: Ia48465b86e6b2e5362b95a2b228414bfc6ac6490 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122481 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-09-09tdf#144052 reduce Primitive2D copyingNoel Grandin
when creating charts, by using a Primitive2DContainer&& parameter in the GroupPrimitive2D constructor, which forces the call sites to pass a temporary, and at most call sites, we can std::move in an existing local variable. Change-Id: I531970918800c6832ab606b5a4ff5fd2d47ccf5b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121844 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-09-02clang-tidy:readability-redundant-member-initNoel Grandin
Change-Id: I39b9ac81d65f4a269293824642c1b2ec593c0584 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121490 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-08-22no need to use unique_ptr for B2DHomMatrixNoel Grandin
it is already a COW type Change-Id: Ide1dedfb8be7593bf45b0e78899450f04291f09e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120828 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-08-22no need to use unique_ptr for B2DPolygonNoel Grandin
it is already a COW type Change-Id: I86c4be9dd83b98eedf169c3b6668a7994204bca0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120827 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-08-22no need to use unique_ptr for B2DPolyPolygonNoel Grandin
it is already a COW type Change-Id: Iaf8bf1671781923555df3e43b0db78e87c2c5a87 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120826 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-06-28loplugin:indentation improve checks for brace alignmentNoel Grandin
Change-Id: I333100fda7e181f68f36b03279b3fbb8cb768310 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117615 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-06-23EMF+ tdf#142975 Add brush support to DrawString recordBartosz Kosiorek
Change-Id: Icfcb4199dcd755fb20e14a8166571b6d6e763f2e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117671 Tested-by: Jenkins Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
2021-05-04svgio: instead of assert(false && ...) rather use SAL_WARN insteadTomaž Vajngerl
Previously OSL_ENSURE was changed to assert(false && ...) which wasn't a good idea as now we hit asserts in some cases, so rather than that, use SAL_WARN instead. Change-Id: I69740d71ae97a79ece56d77c3dd7d0ce83c9bb34 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115040 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2021-05-01svgio: add test for SvgNumber::solveTomaž Vajngerl
Change-Id: I38aa58f9be104754d32ca985022947c3c7225f0c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114963 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2021-05-01svgio: refactor SvgNumber::solve and SvgNumber::solveNonPercentageTomaž Vajngerl
Change-Id: I9eefe4e6d2edf9891dc20f451230aedd44592732 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114962 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2021-05-01svgio: move SvgNumber methods to its own SvgNumber.cxx fileTomaž Vajngerl
Change-Id: I2b52eaf83162b80ccc6f656a5808e8b2aa6c2541 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114961 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2021-05-01svgio: covnert enum to enum class in svgtools.cxxTomaž Vajngerl
Change-Id: Ib442bfc60d16021f314a063643e199a776afa10f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114959 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2021-05-01svgio: convert enum to enum class in svgstyleattributes.hxxTomaž Vajngerl
Change-Id: I97ac8922f4d6b921c2ef862f2168d14b66d8fc53 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114958 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2021-05-01svgio: use pragma once in the header filesTomaž Vajngerl
Change-Id: I781e2083f4aab2e11bf78c3b941701ff7dd35772 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114957 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2021-05-01svgio: add test for svgtools starting with SvgNumberTomaž Vajngerl
Change-Id: I1f903a947fb1c338cf62980256c5369fefb7740e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114956 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2021-05-01svgio: move isPositive to the SvgNumber header fileTomaž Vajngerl
Change-Id: I05c7d59000ac7f14a5d34ed30273379f6fc31677 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114955 Tested-by: Tomaž Vajngerl <quikee@gmail.com> Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2021-05-01svgio: move SvgNumber to its own header fileTomaž Vajngerl
Change-Id: I3f65b73cf0dd21e9818fa3596664662e1aa52c8d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114954 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2021-05-01convert enums to enum classes in svgnode.hxxTomaž Vajngerl
converted XmlSpace, Display Change-Id: I4aced2d7c2f6fcb4adc59949a6ac22d4ddd375a3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114953 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2021-05-01convert enums to enum classes in svgtools.hxxTomaž Vajngerl
converted SvgUnits, NumberType, SvgUnit, SvgAlign Change-Id: I703b1d9396f42b3af1a36c683628e90161f2717d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114952 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2021-04-30svgio: change some OSL_ENSUREs to (std) assertTomaž Vajngerl
Change-Id: Ie7e7e6276e5a528fb99a6dfda00e9826c5245fb7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114899 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2021-04-30svgio: change SVGToken enum to enum classTomaž Vajngerl
Change-Id: Ic2618c91b1793463b7ce0a42ec1db100d11acfa4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114898 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2021-04-12update PCHsCaolán McNamara
Change-Id: Id3728ac0011d3deed7e56081e3a854c7fa5336f3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113959 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-04-07Updated README.md files to represent current code / use Markdown formatHossein
Previously, all of the README files have been renamed to README.md and now, the contents of these files were changed to use Markdown format. Other than format inconsistency, some README.md files lacked information about modules, or were out of date. By using LibreOffice / OpenOffice wiki and other documentation websites, these files were updated. Now every README.md file has a title, and some description. The top-level README.md file is changed to add links to the modules. The result of processing the Markdown format README.md files can be seen at: https://docs.libreoffice.org/ Change-Id: Ic3b0c3c064a2498d6a435253b041df010cd7797a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113424 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de> Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
2021-03-24Using .md extension/Markdown syntax for modules READMEHossein
Renaming all README files for all top level modules to README.md, applying no content change at this stage to be able to track history of the files. These files should be edited to use correct Markdown syntax later. Change-Id: I542fa3f3d32072156f16eaad2211a397cc212665 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112977 Tested-by: Jenkins Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
2021-03-21update pchesCaolán McNamara
Change-Id: I60e61133c305673bb305e41957f5414820c7c358 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112790 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-03-09Make sal/config.h the first in pchMike Kaganski
By convention, it should be the first include in C/CXX files; so use of pch should not break that. Change-Id: Ic329c5f39e8f48ad1778724368e262e48972342b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112123 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-03-06update pchesJulien Nabet
I just used ./bin/update_pch.sh Change-Id: I06a7f36eb4c511b8d6c6477fd87e57f0d9702457 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112097 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2021-02-23update pchesCaolán McNamara
Change-Id: I44424081b7f55710c4db7f10d1829de1ae08be76 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111363 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-02-20loplugin:refcounting in svgioNoel
Change-Id: Id7669026fbe4b6cc92e2b137cba0c6c3c33f7712 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111259 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>