summaryrefslogtreecommitdiff
path: root/svgio
AgeCommit message (Collapse)AuthorFilesLines
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>
2018-08-31tdf#119557 style hierarchy isn't stable so looping check fails falselyCaolán McNamara2-92/+94
Given the css stuff a given style can end up with itself as a grandparent but then the css mutates things so it doesn't loop around to give itself as a grandgrandparent. So undo the loop detection check and turn it into a parse depth test instead with an arbitrary, but high, level Change-Id: If28684ad2b2adc664bc2da6b176b93248b377162 Reviewed-on: https://gerrit.libreoffice.org/59813 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-08-17Consolidate: basegfx::clamp -> o3tl::clampStephan Bergmann1-7/+10
Change-Id: Iffd8b0a19d4479b6c70dc834c6f64499e87e01b1 Reviewed-on: https://gerrit.libreoffice.org/59265 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-08-04Use more basegfx deg<->rad functions, instead of direct formulasMike Kaganski2-5/+3
Also make the functions constexpr. Due to slight changes in floating-point arithmetics (90.0 instead of 180.0, M_PI2 instead of M_PI resp.), results might differ in last digits (usually 17th decimal digit). This has lead to need to tweak char2dump's PieChartTest unit test. Change-Id: I20323dd7dab27e4deb408ea4181e390cc05e7cd3 Reviewed-on: https://gerrit.libreoffice.org/58583 Tested-by: Jenkins Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2018-08-02Add missing sal/log.hxx headersGabor Kelemen4-0/+4
rtl/string.hxx and rtl/ustring.hxx both unnecessarily #include <sal/log.hxx> (and don't make use of it themselves), but many other files happen to depend on it. This is a continuation of commit 6ff2d84ade299cb3d14d4110e4cf1a4b8070c030 to be able to remove those unneeded includes. This commit adds missing headers to every file found by: grep -FwL sal/log.hxx $(git grep -Elw 'SAL_INFO|SAL_INFO_IF|SAL_WARN|SAL_WARN_IF|SAL_DETAIL_LOG_STREAM|SAL_WHERE|SAL_STREAM|SAL_DEBUG') to directories from stoc to svx Change-Id: If562b1aa1d676d2c1cf513e953238abbb846c65c Reviewed-on: https://gerrit.libreoffice.org/58224 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2018-07-31Fix typosAndrea Gelmini1-1/+1
Change-Id: Iaa00d65b518b3e638c2d31912e247cb91bdd0950 Reviewed-on: https://gerrit.libreoffice.org/58347 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2018-07-30loplugin:stringloop in svgio..xmlsecurityNoel Grandin1-3/+3
Change-Id: I1b2fe5674c8350690efc3d3219b9273cc61d5b0c Reviewed-on: https://gerrit.libreoffice.org/58332 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-07-24crashtesting: infinite recurse with moz609361-1.svgCaolán McNamara2-56/+144
Change-Id: I18c2dd159dd7a64c3627abdb472d65013453b1b9 Reviewed-on: https://gerrit.libreoffice.org/57891 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-07-24crashtesting: infinite recurse with moz384637-1.svgCaolán McNamara2-0/+9
Change-Id: Ia4bbc9d471c63812dc3ef490f32e8490bda72bfe Reviewed-on: https://gerrit.libreoffice.org/57888 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-07-23crashtesting: infinite recurse with moz455984-5.svgCaolán McNamara2-20/+52
Change-Id: Idef368c44454ae144b091132cd0d6103f92a6dde Reviewed-on: https://gerrit.libreoffice.org/57854 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-07-18crashtesting: infinite recurse on moz330387-6.svgCaolán McNamara2-21/+55
Change-Id: I3c39d49504a4651b92f41c07e4cef8887366dc2b Reviewed-on: https://gerrit.libreoffice.org/57626 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-07-11tdf#118232 Allow load and insert of SVGs with no GeometryArmin Le Grand1-0/+17
Change-Id: Iaf3d6a0423c5f11dda1e623dd730af01dbd6551c Reviewed-on: https://gerrit.libreoffice.org/57284 Tested-by: Jenkins Reviewed-by: Armin Le Grand <Armin.Le.Grand@cib.de>
2018-06-14Fix typosAndrea Gelmini2-4/+4
Change-Id: I69b4f139be269ff58acd9d74ce0c7897e84a9419 Reviewed-on: https://gerrit.libreoffice.org/55774 Tested-by: Jenkins Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
2018-06-13Replace SVGFilter using SVGIOArmin Le Grand2-17/+104
Next step is to put more logic into the decision if Draw or Impress should be loaded - if we have a self-exported Impress, import as Impress, else (including all not-self-created SVG Graphics) import to Draw. To do this it is necessary to be able to import to different document formats at all. To do this, add an internal filter type to the filter mechanism (types/registration/...) and decide in the SVG XExtendedFilterDetection::detect from SVGFilter which one to use. Added tooling for SVG detection and more, see SVGFileInfo. This allows to detect for SVG, but also if the creator was LO and if it was Draw or Impress. The document format/filter is choosen accordingly. Corrected the error with <g visibility="hidden"> Slides inisde <g class="SlideGroup"> for import of self-exported Impress documents. No idea why this was written that way, but needs to be fixed to get a visible content at all. Also adapted the final mapping from pt to 100thmm in SvgSvgNode::decomposeSvgNode. Unfortunately (and also for unknown reasons) the self-exported Impress does not write svg:width/height values, thus the adaption from assumed svg-units (px) to 100thmm has to be skipped. Have identified the place in svgio where I can embed Pages/Slides to a helper-Primitive to later be able to 'break' such GraphicObjects to multiple Pages/Slides. I have added a Primitive called PageHierarchyPrimitive2D for this purpose. Change-Id: I38bfef6e7b16479a025fc754e38b4e21a006ad38 Reviewed-on: https://gerrit.libreoffice.org/55434 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Armin Le Grand <Armin.Le.Grand@cib.de>
2018-05-28loplugin:useuniqueptr in pathTextBreakupHelperNoel Grandin1-8/+4
Change-Id: Ie8c28403bd6280a733949493bfe693cbfee5e4f5 Reviewed-on: https://gerrit.libreoffice.org/54858 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-05-13svgio: fix rendering when the width/height isn't present in SVGTomaž Vajngerl4-19/+124
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-04-11new loplugin:unusedvariablemoreNoel Grandin1-2/+2
collection of heuristics to look for local variables that are never read from i.e. do not contribute to the surrounding logic This is an expensive plugin, since it walks up the parent tree, so it is off by default. Change-Id: Ib8ba292241bd16adf299e8bba4502cb473513a06 Reviewed-on: https://gerrit.libreoffice.org/52450 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-04-06tdf#114738 Add support for transparency for EMF+ recordsBartosz Kosiorek2-4/+0
With current EMF+ implementation all filled figures, does not support transparency. This patch add transparency support for following EMF+ records: - DrawDriverString - DrawString - FillEllipse - FillRects - FillPolygon - FillPie - FillPath - FillRegion Change-Id: I1e59ea90bdf5fafc07ff9417fccace44872bbecd Reviewed-on: https://gerrit.libreoffice.org/50609 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
2018-04-01remove unused processfactory.hxx includesJochen Nitschke1-1/+0
and fix fallout Change-Id: Id06bf31f2075111e426ba40c84c885ae70697bee Reviewed-on: https://gerrit.libreoffice.org/52206 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Jochen Nitschke <j.nitschke+logerrit@ok.de>
2018-03-28use boost::optional in sc and svgioNoel Grandin2-22/+15
instead of using std:unique_ptr to allocate small objects on the heap Change-Id: Ifd309a9bf331910354406b827b89a0363f3b7eda Reviewed-on: https://gerrit.libreoffice.org/51945 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-03-12loplugin:redundantfcast look for redundant copies in return statementsNoel Grandin1-1/+1
Change-Id: I5f416c865dfe1c36018784246a8007452eb42008 Reviewed-on: https://gerrit.libreoffice.org/50996 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-03-05drop sax::tools::*base64 methodsNoel Grandin2-1/+3
and use the underlying comphelper methods rather. This is so that I can break the dependency that tools has on sax, and can add methods that make sax depend on tools. Change-Id: I8a2d6ce2ffc3529a0020710ade6a1748ee5af7d5 Reviewed-on: https://gerrit.libreoffice.org/50767 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-03-05loplugin:useuniqueptr in SvgNodeNoel Grandin5-25/+18
Change-Id: I7ab382bd90050302c24464eed645d20a435dbd63 Reviewed-on: https://gerrit.libreoffice.org/50657 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-03-05loplugin:useuniqueptr in SvgPolyNodeNoel Grandin2-7/+5
Change-Id: I0227c8a36abbdb88f17cfea186eea28c9f566bd5 Reviewed-on: https://gerrit.libreoffice.org/50656 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-03-05loplugin:useuniqueptr in SvgPatternNodeNoel Grandin2-8/+8
Change-Id: Icf0390d3667c3d55db2266285cacea36e2171e0a Reviewed-on: https://gerrit.libreoffice.org/50655 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-03-05loplugin:useuniqueptr in SvgPathNodeNoel Grandin2-8/+6
Change-Id: I8e4485a308edecf05a2bc70d5c067af3b0eef5d1 Reviewed-on: https://gerrit.libreoffice.org/50654 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-01-25Fix typosAndrea Gelmini1-1/+1
Change-Id: Ieef0e3f21eb12cb5b72d39da4bc0a8c60dd0d5ce Reviewed-on: https://gerrit.libreoffice.org/48545 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Julien Nabet <serval2412@yahoo.fr>
2018-01-22ofz#5565 Indirect-leakCaolán McNamara1-2/+8
Change-Id: I7e201494edcf128389951e09ccfb6c7fc1e53315 Reviewed-on: https://gerrit.libreoffice.org/48309 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-01-17ofz#5431 Direct-leakCaolán McNamara1-2/+0
Change-Id: I4ab6739bd2ae63170ade7019036827455f764666 Reviewed-on: https://gerrit.libreoffice.org/48014 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-01-12More loplugin:cstylecast: svgioStephan Bergmann2-28/+28
auto-rewrite with <https://gerrit.libreoffice.org/#/c/47798/> "Enable loplugin:cstylecast for some more cases" plus solenv/clang-format/reformat-formatted-files Change-Id: Id7f822baae5e5f853308e52eba3633f879af3140
2018-01-02loplugin:passstuffbyref improved return in sd,variousNoel Grandin2-2/+2
Change-Id: I4b6ea89ae2072f4389a696ea3c96d8f7a5731e7a Reviewed-on: https://gerrit.libreoffice.org/47246 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-12-29loplugin:unnecessaryparen improve return checkNoel Grandin1-1/+1
Change-Id: I8128aa4b5fc60efd1dbf5971cdde11e588f5f64b Reviewed-on: https://gerrit.libreoffice.org/47167 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-12-20Fix typosAndrea Gelmini1-1/+1
Change-Id: I28d73221ea83d89f73460f591723c6f80594ff15 Reviewed-on: https://gerrit.libreoffice.org/46822 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2017-12-19inline use-once typedefsNoel Grandin3-6/+3
Change-Id: I5c3ffc03c26b3428f1f336e6ecba7838a1cf1157 Reviewed-on: https://gerrit.libreoffice.org/46764 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-12-19loplugin:unusedenumconstantsNoel Grandin1-7/+0
Change-Id: I9dc4b369872a7c6c076ae9be1dcdf2f8385af8a7 Reviewed-on: https://gerrit.libreoffice.org/46684 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-12-16Fix typosAndrea Gelmini1-1/+1
Change-Id: Iedb99e41887ebfd6fa290bc113b473c5cc9693b4 Reviewed-on: https://gerrit.libreoffice.org/46600 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Julien Nabet <serval2412@yahoo.fr>
2017-12-11loplugin:salcall fix functionsNoel Grandin3-5/+5
since cdecl is the default calling convention on Windows for such functions, the annotation is redundant. Change-Id: I1a85fa27e5ac65ce0e04a19bde74c90800ffaa2d Reviewed-on: https://gerrit.libreoffice.org/46164 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-10-23loplugin:includeform: svgioStephan Bergmann30-58/+58
Change-Id: I5832529b0200295cc54a85dff42bf5692bd59ab5
2017-10-23overload std::hash for OUString and OStringNoel Grandin3-6/+4
no need to explicitly specify it anymore Change-Id: I6ad9259cce77201fdd75152533f5151aae83e9ec Reviewed-on: https://gerrit.libreoffice.org/43567 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>