summaryrefslogtreecommitdiff
path: root/basegfx
AgeCommit message (Collapse)Author
2021-02-08update pchesCaolán McNamara
Change-Id: Icf55ddda055d11b649e7607c2cdd8b6d6ddfefbc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110483 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-02-08Improve loplugin:cppunitassertequal for CPPUNIT_ASSERT(a && b)Stephan Bergmann
...by re-enabling the code temporarily #if'ed-out in a528392e71bc70136021be4e3d83732fccbb885e "Fixed/improved loplugin:cppunitassertequals" (and which then triggers lots of other lopglugin:cppunitassertequal CPPUNIT_ASSERT -> CPPUNIT_ASSERT_EQUAL warnings). For two css::uno::Reference equality comparisons in cppu/qa/test_any.cxx, it was more straightforward to rewrite them with an explicit call to operator == (which silences loplugin:cppunitassertequal) than to adapt them to CPPUNIT_ASSERT_EQUAL's requirement for arguments of identical types. In sc/qa/unit/ucalc_pivottable.cxx, ScDPItemData needs toString, which has been implemented trivially for now, but might want to combine that with the DEBUG_PIVOT_TABLE-only ScDPItemData::Dump. Change-Id: Iae6d09cf69bd4e52fe4411bba9e50c48e696291c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110546 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-02-02Added Unit test to BColorModifierDeb Barkley-Yeung
Change-Id: I19aee93f68e5e01ef99f8447db4ffb1f68acaaa9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109853 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2021-02-02tdf#139002 dont hang opening pathological SVGsNoel Grandin
This is a workaround, but (a) this contains several pathological SVGs, which have clearly been very badly created eg. an svg path with 2699660320 elements. (b) the diagrams all look fine to me, so clearly the winding-rule change is not that critical in this case Change-Id: I48aac512e2de2ae4e63a4d1816c3d4d5901b3bf0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110242 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-01-31basegfx::utils::applyLineDashing simplify !aLineTargetCallBack checksDr. David Alan Gilbert
cppcheck points out that there's an early check and return for !aLineTargetCallback: if(fTools::lessOrEqual(fDotDashLength, 0.0) || !aLineTargetCallback || !nPointCount) { .... return; } so we don't need to test it later. Change-Id: I93fead38ced03ad52c6a81701902cf9deda3bb58 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109847 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-01-24Use ContainerType().swap and avoid local variablesMike Kaganski
Change-Id: I773555180758a97aff37f9bc27de83c355d71521 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109761 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-01-09fix coverity parse errorsCaolán McNamara
Change-Id: I3a1179947704452e3ffec02be59d0f7bf0b75ab0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109017 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-12-27std::list::size() has constant complexity since C++11Jochen Nitschke
Change-Id: I18cfbf84e1ca2cc6d3a7e7f01e943ef8afb23362 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108334 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-12-26New loplugin:stringliteralvarStephan Bergmann
See the comment at the top of compilerplugins/clang/stringliteralvar.cxx for details. (Turned some affected variables in included files into inline variables, to avoid GCC warnings about unused variables.) Change-Id: Ie77219e6adfdaaceaa8b4e590b08971f2f04c83a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108239 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-11-16replace std::min(std::max()) with std::clampNoel
Change-Id: I76e34e8020d98292e8ffde387542b7029f85a42d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105754 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-11-13tdf#123936 Formatting files in module basegfx with clang-formatPhilipp Hofer
Change-Id: I29bfa5de3bfd8ad2989cba0269f48f79edd58fd4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105645 Tested-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com> Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
2020-11-12New loplugin:stringviewparamStephan Bergmann
...to "Find functions that take rtl::O[U]String parameters that can be generalized to take std::[u16]string_view instead." (Which in turn can avoid costly O[U]String constructions, see e.g. loplugin:stringview and subView.) Some of those functions' call sites, passing plain char string literals, needed to be adapted when converting them. Change-Id: I644ab546d7a0ce9e470ab9b3196e3e60d1e812bc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105622 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-11-05tdf#42949 Fix new IWYU warnings in directories [ab]*Gabor Kelemen
Found with bin/find-unneeded-includes Only removal proposals are dealt with here. Change-Id: Ib0008b9bb095f27e5e436d6b507dc709ab7bf01a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105313 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2020-10-30tdf#124176 Using pragma once instead of inclusive guardsdiwanshu885
Change-Id: I39f34dc94e0df09e6951c26a90a666553cadf4d9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105036 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
2020-10-24tdf#124176 Using pragma once instead of include guardsBetül İnce
Change-Id: Ib8cfeb774851afd62e2bd5b29b0d61d52a0dbad9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104694 Tested-by: Jenkins Reviewed-by: Gülşah Köse <gulsah.kose@collabora.com>
2020-10-23tdf#124176 Using pragma once instead of include guardsgizemozgun
Change-Id: I2f2470f509ff4a6cef5962755c6de86ebf1a89a5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104708 Reviewed-by: Muhammet Kara <muhammet.kara@collabora.com> Tested-by: Jenkins
2020-10-21use tools::Long in basegfx..chart2Noel
Change-Id: Ide4014348d51f0b5f59e1e91b8d41c7748853254 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104608 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-10-06loplugin:const* make some params and methods constNoel
Change-Id: If7fbb25037343e18081a8ee7064840d75e9a45a7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104010 Tested-by: Noel Grandin <noel.grandin@collabora.co.uk> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-09-03Add unit tests to B2DPointDeb Barkley-Yeung
Change-Id: I760721a691730dc588f271a5b51f7e1ffcc6eef7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101818 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2020-09-02drop unused MinimalSystemDependentDataManagerCaolán McNamara
Change-Id: I6e5413bb79acac93abfb8398550c157e7b667a67 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101942 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-08-30Fix typo in codeAndrea Gelmini
Change-Id: If6683cd134e9bd675ec9b6f9a59fa667ebb41da0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101647 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-08-17Fix typosAndrea Gelmini
Change-Id: Id31299912b822baf9eecbb03cba53339f0528ae8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100867 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2020-08-14loplugin:simplifybool moreNoel Grandin
look for expressions like !(a && !b) which can be expanded out Change-Id: I72515a9638762b050f9a258c08da39ebfa2ef8e7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100579 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-08-07tdf#133477 basegfx: fix center of rotated gradientsTünde Tóth
in the case of square and quadratic gradient styles. Change-Id: I2e5522930b472bf2ee702c780f39aa187bd7b64f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95356 Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org>
2020-07-26basegfx: remove completly useless namespace opening and closingArnaud Versini
Change-Id: I6959e9eabd6623435cc534c55869a844b0f207d0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99459 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-07-16compact namespace: basegfx,canvasNoel Grandin
Change-Id: Idc808459b403bcdcccbd86b73dd22b424e507c8e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98897 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-07-16merge needlessly split polygons back in Skia drawing (tdf#133016)Luboš Luňák
There are places in LO code that needlessly split polygons into a group of adjacent polygons. These should theoretically result in the same, but only if antialiasing is not used (where Skia has a problem and according to Skia developers that's not really Skia's fault). So whenever a possibly problematic polygon is asked to be drawn, delay it and try to merge it with followup polygons back into one polygon where those needlessly created problematic edges do not exist. This is indeed just a hack and those problematic places should be fixed, but oh well :/. Change-Id: I1b03fe7c2f5e8c962b0dcb8962196b7fea090146 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98887 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2020-07-10replace usage of blacklist with excludelist for IWYUThorsten Behrens
Background and motivation: https://tools.ietf.org/html/draft-knodel-terminology-02 Change-Id: I2f22d455d2a936a85750eaab1fda215ebb6d9d48 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98182 Tested-by: Thorsten Behrens <Thorsten.Behrens@CIB.de> Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2020-06-30Upcoming improved loplugin:staticanonymous -> redundantstatic: basegfxStephan Bergmann
Change-Id: I66b7e0fd74c7ce57cd2859e189caadb84be4d541 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97521 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-06-24use more std::container::insert instead of std::copyNoel Grandin
which is both more compact code, and more efficient, since the insert method can do smarter resizing Change-Id: I17f226660f87cdf002edccc29b4af8fd59a25f91 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96948 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-06-02basegfx: test of coordinate system conversionTomaž Vajngerl
Change-Id: I059d1f272f0633c450287f272083bb09732357b0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95304 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2020-05-28loplugin:simplifybool in accessibility..basicNoel Grandin
Change-Id: Ibf6cef4baa2d3d400d953ac8bc97a66b5901def9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94972 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-05-19tdf#88205 EasyHack change css::uno::Sequence initializationsvgeof
1st commit. Use initializer lists for uno::Sequence in 4 files Change-Id: I0192b4b8f023fb8d606dff81c4b910c8c7c2a9a2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93900 Reviewed-by: Michael Stahl <michael.stahl@cib.de> Tested-by: Jenkins
2020-05-15use for-range on Sequence in basctl..canvasNoel Grandin
Change-Id: Idad3d8fbe785c7b1b8b287a3227372adb2757de8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94260 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-05-04Fix typoAndrea Gelmini
Change-Id: Ic084ebbc04731b362bac0cf51e4b2bbdf5ef0526 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93208 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2020-04-22tdf#42949 Simplify use of rtl::math::approxEqual in include/basegfx/Gabor Kelemen
Turns out we can save about 500Mb of preprocessor input if we use rtl_math_approxEqual from rtl/math.h instead of its C++ wrapper rtl::math::approxEqual from rtl/math.hxx and manage the fallout accordingly. Before: bin/includebloat.awk | head sum total bytes included (excluding system headers): 19017296671 After: $ bin/includebloat.awk | head sum total bytes included (excluding system headers): 18535432672 Change-Id: I1691171f3a309405a7099882ad9989d147f59118 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92508 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2020-04-19loplugin:flatten in basegfxNoel Grandin
Change-Id: Ic8bc586e1a4977322dcb371c0fff6411783df9d7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92484 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-04-14loplugin:buriedassign in b*Noel Grandin
Change-Id: Ic20f46105a30b54bc5a991b4070e6c8edb15376e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92189 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-03-30OSL_ASSERT->assert in basegfxNoel Grandin
Change-Id: I7ff49d327e435e2d6ea5f8bdcf7ce8d5302eea1a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91332 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-03-30remove Matrix class from basegfx, convert B2DHomMatrix testsTomaž Vajngerl
The common test cases of MAtrix and B2DHomMatrix are just converted into additional test cases for B2DHomMatrix. Change-Id: I8ed2f6d25263797b21a844e209e910a8a3f2a347 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91342 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2020-03-29basegfx: test B2DHomMatrix and Matrix togetherTomaž Vajngerl
This adds a test for B2DHomMatix and Matrix to test them together. Ther reason for this is that we can remove Matrix in favour to B2DHomMatrix, but first we need to make sure it is safe so by checking that the operations in Matrix yield the same result as with B2DHomMatrix. Change-Id: Ia93c1d3c7b2b7ff257c35831ff31afad3e8f34ba Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91312 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2020-03-23make more classes private in mergedlibs modeNoel Grandin
Change-Id: I486922d0652f26fa7ee56f5fe308e19fe5ff137e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90856 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-03-14tdf#130974 replace `rtl::math::isSignBitSet` with `std::signbit`.Yukio Siraichi
Change-Id: I91235eee8c6a9d4a59c1933527b49141f64cd91b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90478 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2020-03-09tdf43157:Clean up OSL_ASSERT, DBG_ASSERT, etc..Pelin Kuran
Change-Id: Id93ebb5cb466580c25eb0e5669bc31510bdd7c1c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89717 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@cib.de>
2020-03-04tdf#130150 Improve clipping in PDF exportArmin.Le.Grand (CIB)
For more info and discusson please have a look at the task. It reverts the change from tdf#99680 which did a wrong paradigm change in how clip in Region(s) is defined and tries to fix the underlying error in a more correct way. This includes problems noted in tdf#44388 and tdf#113449. This is a decent improvement, but - due to dealing with numerical problems - not yet the whole healing. Still thinking about how to solve this for good. Adapted PdfExportTest::testTdf99680() and PdfExportTest::testTdf99680_2() as needed, empty clip regions are allowed again. Added comments, too. Had to change solvePolygonOperationAnd to work on ranges if both inputs *are* ranges. The AND-case is then completely solvable. Also increased geometry for transformations of clip geometries - may help later. Change-Id: I2370447597faa6efb81d58ee31c63654e304262e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89874 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2020-02-14tdf#130655 callback interface for 3D and secure dashArmin Le Grand
Added same interface for 3D but just for lines, it uses no gaps. Added the security mechanism mentioned in the task in comment (2) to 2D and 3D Change-Id: I5da303c01562088682d95ee4f294c99e1f17bf6b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88728 Tested-by: Jenkins Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
2020-02-14tdf#130655 added callback interface to ::applyLineDashingArmin Le Grand (Collabora)
This version of the tooling method allows to avoid collecting line snippets in a return value PolyPolygon. Instead, offer lambda functions to get callbacks for created snippets. The original method using a B2DPolyPolygon return value is adapted to already use this, so serves as example of usage and ensures that only one identical algorithm is used. Change-Id: Ie306968a895ad280fc2425fb40b3244769216ba0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88684 Tested-by: Jenkins Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
2020-02-07tdf#130478 Enhance Dashed line drawing on all systemsArmin Le Grand (Collabora)
For more info and explanation including state of process information and discussion(s) see task please. Adding corrections for gerrit build Change-Id: Ie10fb8093a86459dee80db5ab4355b47e46c1f8c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88130 Tested-by: Jenkins Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
2020-02-03loplugin:constantparamNoel Grandin
Change-Id: If2dee122bf07dc179fd8f6e766442ec1891a5f3d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87845 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-02-01make update_pch also consider files in <module>/src/**/incLuboš Luňák
With --enable-pch=full there's not much difference between a "public" header in <module>/inc and a private one in <module>/src/somewhere/inc . And since the script searches recursively, this apparently helps to find even more headers for lower pch levels. Change-Id: I8483d0aa5b4fea5a59107c20a8aa5f1ef694af0a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87799 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>