summaryrefslogtreecommitdiff
path: root/svgio
AgeCommit message (Collapse)AuthorFilesLines
2019-11-08widget theme: Gradient support when drawing widgetsTomaž Vajngerl1-0/+37
Change-Id: I29239348e36e4963d9708a22ac649b2b1d68bf02 Reviewed-on: https://gerrit.libreoffice.org/82207 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2019-10-18make bin/update_pch.s always include code in trivial #if'sLuboš Luňák1-1/+1
E.g. #ifdef LIBO_INTERNAL_ONLY is always true for code that builds with our PCHs. Change-Id: I3cf311ea3621b909105754cfea2cb0116b8b67f5 Reviewed-on: https://gerrit.libreoffice.org/80961 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2019-10-03loplugin:unusedfieldsNoel Grandin2-28/+4
and filter out the weld fields, since we're not touching them yet Change-Id: I3cc23c46d2650f13cb29c7d381687939d23e2882 Reviewed-on: https://gerrit.libreoffice.org/80104 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-09-29constmethod for accessor-type methodsNoel Grandin1-1/+1
Apply the constmethod plugin, but only to accessor-type methods, e.g. IsFoo(), GetBar(), etc, where we can be sure of that constifying is a reasonable thing to do. Change-Id: Ibc97f5f359a0992dd1ce2d66f0189f8a0a43d98a Reviewed-on: https://gerrit.libreoffice.org/74269 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-09-23SVGIO: Fix conditions after ab147995Xisco Fauli1-2/+2
Thanks to Michael Stahl Change-Id: I708dd87e82138a59afe311c9397f2c9e0fd4c274 Reviewed-on: https://gerrit.libreoffice.org/79404 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@cib.de>
2019-09-23do not require $(SRCDIR) in every gb_Library_set_precompiled_headerLuboš Luňák1-1/+1
Change-Id: I7b3a22584bb2e4d501f509ffcd80929feed23a4c Reviewed-on: https://gerrit.libreoffice.org/79360 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2019-09-23SVGIO: add unittest for fill:noneXisco Fauli2-0/+21
Change-Id: I218a0d24222ae3d91c4e6dbd7a619f36823752ee Reviewed-on: https://gerrit.libreoffice.org/79370 Tested-by: Jenkins Reviewed-by: Xisco Faulí <xiscofauli@libreoffice.org>
2019-09-22SVGIO: Use correct type for <use> elementsXisco Fauli1-1/+1
Since it was rebased in 44cfc7cb6533d827fd2d6e586d92c61d7d7f7a70 Change-Id: I2845367a9017b24f4623138d5501384e5ed81d7d Reviewed-on: https://gerrit.libreoffice.org/79359 Tested-by: Jenkins Reviewed-by: Xisco Faulí <xiscofauli@libreoffice.org>
2019-09-19tdf#123926: SVGIO: Check parent's fill when...Xisco Fauli3-0/+42
... 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-19tdf#104339: SVGIO: Add unittestXisco Fauli2-0/+79
Change-Id: I6ecb366a889fe64bc90db0e041b4ddd4bc3dfc3f Reviewed-on: https://gerrit.libreoffice.org/79129 Tested-by: Jenkins Reviewed-by: Xisco Faulí <xiscofauli@libreoffice.org>
2019-09-19tdf#94765: SVGIO: Look for gradient/pattern ids once the file...Xisco Fauli4-28/+93
... 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-16tdf#99115: add Css selector '*' style only if the element...Xisco Fauli3-14/+112
... 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-08-25loplugin:returnconstval in svgioNoel Grandin13-27/+27
Change-Id: Idb195e43303e22ddf36a4529dd9704725c4de0e5 Reviewed-on: https://gerrit.libreoffice.org/78061 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-08-15loplugin:sequenceloop in starmath..svlNoel Grandin1-2/+2
Change-Id: I473a8eec9cbf6d44b55ffd6f2233bf39cf6217da Reviewed-on: https://gerrit.libreoffice.org/77528 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-08-12Fix typosAndrea Gelmini2-4/+4
Change-Id: Ia44a9dd214b5b09ed6f9c39b8057c41ae03897f1 Reviewed-on: https://gerrit.libreoffice.org/77285 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2019-07-31Improved loplugin:stringconstant (now that GCC 7 supports it): svgioStephan Bergmann2-3/+3
Change-Id: I998fb299c52766dc7240926af69ce25347f79505 Reviewed-on: https://gerrit.libreoffice.org/76643 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-07-22Simplify Sequence iterations in shell..svgioArkadiy Illarionov1-11/+3
Use range-based loops, STL and comphelper functions Change-Id: I612d36abcc09a91c60f7212de6747a1a1bdcfc69 Reviewed-on: https://gerrit.libreoffice.org/76056 Tested-by: Jenkins Reviewed-by: Arkadiy Illarionov <qarkai@gmail.com>
2019-06-18loplugin:logexceptionnicely in starmath..svgioNoel Grandin1-2/+3
Change-Id: I356e574e28338f6fddc6932b4e41a461d851406d Reviewed-on: https://gerrit.libreoffice.org/74141 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-06-14loplugin:unusedfields improvementsNoel Grandin2-12/+1
tighten up the only calling write-only methods part of the analysis Change-Id: I5bc6fdf0ce51940653317e8a48c5241705c90d4c Reviewed-on: https://gerrit.libreoffice.org/74022 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-05-09regenerate PCH headers for the 4 new levelsLuboš Luňák1-10/+14
Plus some build fixes triggered by this. Change-Id: I59b21def706598ceffd45ae5b1f0262ec9c1ad50 Reviewed-on: https://gerrit.libreoffice.org/71581 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2019-04-14loplugin:sequentialassign in starmath..svlNoel Grandin1-2/+1
Change-Id: I95d7b67cd8b6b68c087ff96fdb6bb283ab8b49ec Reviewed-on: https://gerrit.libreoffice.org/70718 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-04-12Downgrade a SAL_WARN() that shows up a lot but can be ignored to SAL_INFO()Tor Lillqvist1-1/+1
Quikee said it was OK. Change-Id: I8f45d3c5e264f5658985399487e9c6e2a3fbced3
2019-04-05support opacity for widget definition draw SVGsTomaž Vajngerl4-2/+12
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-03-20tdf#42949 Fix IWYU warnings in include/drawinglayer/Gabor Kelemen1-0/+1
Found with bin/find-unneeded-includes Only removal proposals are dealt with here. Change-Id: I8daf57df5b8f9c609d4f3ca44bae7366addceb6c Reviewed-on: https://gerrit.libreoffice.org/69151 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2019-03-12svgio: don't use_library_objects in CppunitTest_svgio_readMichael Stahl1-4/+0
==26032==ERROR: AddressSanitizer: odr-violation (0x7f3b41f544a0): [1] size=96 'vtable for svgio::svgreader::SvgCharacterNode' master/svgio/source/svgreader/svgcharacternode.cxx [2] size=96 'vtable for svgio::svgreader::SvgCharacterNode' master/svgio/source/svgreader/svgcharacternode.cxx These globals were registered at these points: [1]: #0 0x43a090 in __asan_register_globals.part.13 (workdir/LinkTarget/Executable/cppunittester+0x43a090) #1 0x7f3b31e6e86d in asan.module_ctor (instdir/program/libsvgiolo.so+0x6186d) [2]: #0 0x43a090 in __asan_register_globals.part.13 (workdir/LinkTarget/Executable/cppunittester+0x43a090) #1 0x7f3b41da5bad in asan.module_ctor (workdir/LinkTarget/CppunitTest/libtest_svgio_read.so+0x82bad) Change-Id: Id2b32936d603ac2ed7df12d7e6f3ade094621578 Reviewed-on: https://gerrit.libreoffice.org/69092 Reviewed-by: Tomaž Vajngerl <quikee@gmail.com> Tested-by: Jenkins
2019-03-08Removed duplicated includesAndrea Gelmini1-1/+0
Change-Id: I4b701814e40f1ca3ced81c619696d7c3e18dc765 Reviewed-on: https://gerrit.libreoffice.org/68894 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2019-03-08new loplugin constvarsNoel Grandin1-1/+1
detect static variables that can be made const. Thanks to mike kaganski for suggesting this. Here I introduce a new plugin feature - using markers in nearby comments to disable the plugin for specific vars. Some of this stuff was old debugging code. I removed the stuff that was older than 5 years. Change-Id: I6ec7742a7fdadf28fd128b592fcdf6da8257585c Reviewed-on: https://gerrit.libreoffice.org/68807 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-03-07Update SvgRead test - add new parameters and path parsingTomaž Vajngerl2-12/+56
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-06parse more attributes in SvgDrawVisitorTomaž Vajngerl1-6/+31
- add additional parameters for DrawRectangle, DrawPath - parse stroke width, stroke and fill color for path and rect - parse rx, ry for rect - use getCurrentViewPort for top-level SVG rectangle Change-Id: Ife498bdaa721852ef2542ac5df2be0e86dfb4e62 Reviewed-on: https://gerrit.libreoffice.org/68785 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2019-03-06use gfx namespace for DrawCommandsTomaž Vajngerl4-12/+13
Change-Id: Ib2d97c4fee4e1bb433beeba4fb507fdc7d542af9 Reviewed-on: https://gerrit.libreoffice.org/68775 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2019-03-06svgio visitor, add draw commands and create the from svgTomaž Vajngerl9-36/+413
Adds a visitor for svgio for visiting svg nodes and create something useful from them. Basic draw commands - a tree of draw commands (with sub-pixel precision support) just to store a simple definition for drawing. Adds a svg draw visitor and create draw commands from the svg structure and expose the commands through UNO API. Change-Id: I073e891a2cffdd76d4e3b838590e3a19c998e9bf Reviewed-on: https://gerrit.libreoffice.org/68770 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2019-02-18loplugin:simplifybool, check for !(!a op !b)Noel Grandin3-3/+3
Change-Id: Ic3ee9c05705817580633506498f848aac3ab7ba6 Reviewed-on: https://gerrit.libreoffice.org/67866 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-02-09move and extend primitive2dxmldump to drawinglayerTomaž Vajngerl1-67/+67
Also needs extending the XmlWriter to output double numbers as the attribute content. Change-Id: Ie749ea990d856c8c90092ed8153c24efda99c444 Reviewed-on: https://gerrit.libreoffice.org/67573 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2019-01-29loplugin:flatten in svgioNoel Grandin18-1976/+1976
Change-Id: I3276c2c368c755e070fd8b19a15a954948a68df7 Reviewed-on: https://gerrit.libreoffice.org/67008 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-01-11Drop o3tl/clamp.hxx, use C++17 std::clamp insteadStephan Bergmann1-8/+9
Change-Id: I5043c787dcc3b78bc7fdff130564801194e39f46 Reviewed-on: https://gerrit.libreoffice.org/66177 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-01-07tdf#42949 Fix IWYU warnings in include/vcl/[v-x]*Gabor Kelemen1-0/+1
Found with bin/find-unneeded-includes Only removal proposals are dealt with here. Change-Id: I98f49765c6b74808dcbd692e0f375dd2848fcfd4 Reviewed-on: https://gerrit.libreoffice.org/65614 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2018-12-08Remove obsolete SAL_FALLTHROUGH completelyStephan Bergmann1-2/+2
...after 7ffdd830d5fb52f2ca25aa80277d22ea6d89970b "HAVE_CPP_ATTRIBUTE_FALLTHROUGH is always true now" Change-Id: I54e5ff4e036a6bb3e5774d1c0524158aae18e937 Reviewed-on: https://gerrit.libreoffice.org/64800 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-11-25Simplify containers iterations in svgio, svl, svtoolsArkadiy Illarionov1-3/+3
Use range-based loop or replace with STL functions Change-Id: I98a3e55a14c8ac00188c5003f84194c2cc6795fb Reviewed-on: https://gerrit.libreoffice.org/63959 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-11-10tdf#120703 PVS: V547 Expression is always true/falseMike Kaganski1-12/+8
Change-Id: I0b3c407331bfa1fa0c5003250d327d4f26de3643 Reviewed-on: https://gerrit.libreoffice.org/63235 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2018-11-08tdf#113624 EMF+ Fix shift of DrawString without StringFormatBartosz Kosiorek1-2/+2
While we are drawing DrawString record, in most cases optional StringFormat information is available. If StringFromat information is available then we should use default values. For LeadingMargin for String the default value is 1/6 inch. Change-Id: I4a0a68df5ebe74e810f8b5864232b477b3aac255 Reviewed-on: https://gerrit.libreoffice.org/62927 Tested-by: Jenkins Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
2018-10-24clang-tidy performance-unnecessary-copy-init in sfx2..svtoolsNoel Grandin4-5/+5
Change-Id: I1e92472b4aaeca1eb1372bd18d10cc9e0766dc39 Reviewed-on: https://gerrit.libreoffice.org/62251 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-10-19clang-tidy readability-container-size-emptyNoel Grandin2-7/+7
Change-Id: I1df70b7dff5ebb6048f7fc618789faa15ca5d422 Reviewed-on: https://gerrit.libreoffice.org/61967 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-10-19clang-tidy readability-misleading-indentationNoel Grandin1-4/+4
Change-Id: I4673fc7c694924b41d048a1918ddb8b0e0af1f79 Reviewed-on: https://gerrit.libreoffice.org/61935 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-10-18Turn SvgMarkerNode::MarkerUnits into scoped enumStephan Bergmann3-5/+5
...to avoid -Werror,-Wshadow from Clang trunk with <https://reviews.llvm.org/D52400> "Improve -Wshadow warnings with enumerators", warning about shadowing of userSpaceOnUse in enum SvgUnits in svgio/inc/svgtools.hxx Change-Id: Ie1438e6ad0f73c73ad643157e5f8366a6e3f6851 Reviewed-on: https://gerrit.libreoffice.org/61933 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-10-08loplugin:constfields in stoc..svgioNoel Grandin3-3/+3
Change-Id: Icfd936fe9b83e0e122af5b09f7ed6dde2ead4400 Reviewed-on: https://gerrit.libreoffice.org/61512 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-09-26loplugin:useuniqueptr in SvgDocumentNoel Grandin5-20/+12
Change-Id: I299e97c276b60be86491bfeee22d46774739ca44 Reviewed-on: https://gerrit.libreoffice.org/60969 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-09-17remove duplicate lineNoel Grandin1-1/+0
accidentally introduced with commit 23f9d2b092989c5f105144083e79066e3070afbc match_colorKeyword should be using static const lookup table Change-Id: I64c85504af6edba9f5e6a20b20ef245d43fd611b
2018-09-17New loplugin:externalStephan Bergmann2-3/+3
...warning about (for now only) functions and variables with external linkage that likely don't need it. The problems with moving entities into unnamed namespacs and breaking ADL (as alluded to in comments in compilerplugins/clang/external.cxx) are illustrated by the fact that while struct S1 { int f() { return 0; } }; int f(S1 s) { return s.f(); } namespace N { struct S2: S1 { int f() { return 1; } }; int f(S2 s) { return s.f(); } } int main() { return f(N::S2()); } returns 1, both moving just the struct S2 into an nunnamed namespace, struct S1 { int f() { return 0; } }; int f(S1 s) { return s.f(); } namespace N { namespace { struct S2: S1 { int f() { return 1; } }; } int f(S2 s) { return s.f(); } } int main() { return f(N::S2()); } as well as moving just the function f overload into an unnamed namespace, struct S1 { int f() { return 0; } }; int f(S1 s) { return s.f(); } namespace N { struct S2: S1 { int f() { return 1; } }; namespace { int f(S2 s) { return s.f(); } } } int main() { return f(N::S2()); } would each change the program to return 0 instead. Change-Id: I4d09f7ac5e8f9bcd6e6bde4712608444b642265c Reviewed-on: https://gerrit.libreoffice.org/60539 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-09-14match_colorKeyword should be using static const lookup tableNoel Grandin1-152/+150
no need to re-init this every time we look up a color Change-Id: I68113fc6a36880752f5eb7813df1f0d971678013 Reviewed-on: https://gerrit.libreoffice.org/60493 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-09-12loplugin:simplifyconstruct in stoc..svlNoel Grandin20-31/+6
Change-Id: I81d465d66a979e9a1e092e5d23ed339840d1fb2d Reviewed-on: https://gerrit.libreoffice.org/60315 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>