summaryrefslogtreecommitdiff
path: root/basegfx/source
AgeCommit message (Collapse)Author
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-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-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-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-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-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-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-01-31new loplugin:namespaceindentationNoel Grandin
check indentation of braces in namespace decls, and the comments that often appear with them. This is my penance for messing up the indentation with clang-tidy-modernize-namespaces. As such I have limited it to new-style namespaces for now, and the check is off by default. Change-Id: I4db7f10a81c79bc0eece8f8e3ee564da8bc7f168 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87723 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-01-26Fix typoAndrea Gelmini
Change-Id: Ice95dfa060c9f6a50cfce704ab7228acbf1129aa Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87293 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Julien Nabet <serval2412@yahoo.fr>
2020-01-23tdf#129845: Better solution using already existing infoArmin Le Grand
Use calculateCombinedHoldCyclesInSeconds() in central places of system-dependent buffering and the zero value to early exclude data from buffering. This solves the problem on all system-dependent usages in a central place. Also enhanced to roughly allow buffering for bitmaps unchanged, for polygons starting with ca. 50 coordinate pairs. Added special treatments to Cairo version to allow temp buffer objects without copying the path data. This needed some extra stuff due to Cairo not allowing to work with it's cr-internal path object directly. Change-Id: Icd0a0d8091707fe356a82f5c7ec48f36ad44ccde Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87199 Reviewed-by: Michael Meeks <michael.meeks@collabora.com> Tested-by: Jenkins
2020-01-14clang-tidy modernize-concat-nested-namespace in basegfxNoel Grandin
Change-Id: I79b5b135c00b31152ff37de3485dcbb955ca1071 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86757 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-01-13crashtesting: downgrade assert to a warningCaolán McNamara
its asserts since... commit 5291c3ef56948a91166a597033f3e48e00d57403 Date: Sun Dec 1 05:41:43 2019 +1100 tdf#43157 basegfx: remove OSL_ENSURE preconditions on e.g. export of tdf12500-2.wmf to odg but its unclear what a fix might look like Change-Id: I26c1b1426a0d5ca7f25ca69cf1b720fe3344ce69 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86714 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2019-12-18sal_Char->char in avmedia..basicNoel Grandin
Change-Id: Ied1331d979539ef1183da64c55351b57d24f4a4f Reviewed-on: https://gerrit.libreoffice.org/85371 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-12-17loplugin:expandablemethodsNoel Grandin
Change-Id: Ifc269d9996928085a3ab78033788465b4f029368 Reviewed-on: https://gerrit.libreoffice.org/85255 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-12-11basegfx: fix assertion textChris Sherlock
Change-Id: Ibfcc30327d2f55b994e3d8aa485bbb5499ed7f22 Reviewed-on: https://gerrit.libreoffice.org/84141 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-12-10tdf#43157 basegfx: remove OSL_ENSURE preconditionsChris Sherlock
The OSL_ENSUREs that I have converted to assert() are all preconditions - no function should ever have these values passed to it, so assert if this does happen so we know passed the values. Change-Id: I11b1141c8cac2fee7ffdd54d177ecc18e96a9620 Reviewed-on: https://gerrit.libreoffice.org/84140 Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl> Tested-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
2019-12-03Adapt SAL_WARN to C++20 deleted ostream << for sal_Unicode (aka char16_t)Stephan Bergmann
<http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1423r3.html> "char8_t backward compatibility remediation", as implemented now by <https://gcc.gnu.org/ git/?p=gcc.git;a=commit;h=0c5b35933e5b150df0ab487efb2f11ef5685f713> "libstdc++: P1423R3 char8_t remediation (2/4)" for -std=c++2a, deletes operator << overloads that would print an integer rather than a (presumably expected) character. Change-Id: Ic70d3e90e4b990d297e35f07379fe4952e138820 Reviewed-on: https://gerrit.libreoffice.org/84321 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-12-03Simplify a bit B2DPolyRange::appendElement (basegfx)Julien Nabet
push_back is more optimized than an insert Change-Id: I8932c4ee61569b5eee3d5dbc5fbfd8eff624d061 Reviewed-on: https://gerrit.libreoffice.org/84276 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-11-22Extend loplugin:external to warn about classesStephan Bergmann
...following up on 314f15bff08b76bf96acf99141776ef64d2f1355 "Extend loplugin:external to warn about enums". Cases where free functions were moved into an unnamed namespace along with a class, to not break ADL, are in: filter/source/svg/svgexport.cxx sc/source/filter/excel/xelink.cxx sc/source/filter/excel/xilink.cxx svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx All other free functions mentioning moved classes appear to be harmless and not give rise to (silent, even) ADL breakage. (One remaining TODO in compilerplugins/clang/external.cxx is that derived classes are not covered by computeAffectedTypes, even though they could also be affected by ADL-breakage--- but don't seem to be in any acutal case across the code base.) For friend declarations using elaborate type specifiers, like class C1 {}; class C2 { friend class C1; }; * If C2 (but not C1) is moved into an unnamed namespace, the friend declaration must be changed to not use an elaborate type specifier (i.e., "friend C1;"; see C++17 [namespace.memdef]/3: "If the name in a friend declaration is neither qualified nor a template-id and the declaration is a function or an elaborated-type-specifier, the lookup to determine whether the entity has been previously declared shall not consider any scopes outside the innermost enclosing namespace.") * If C1 (but not C2) is moved into an unnamed namespace, the friend declaration must be changed too, see <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71882> "elaborated-type-specifier friend not looked up in unnamed namespace". Apart from that, to keep changes simple and mostly mechanical (which should help avoid regressions), out-of-line definitions of class members have been left in the enclosing (named) namespace. But explicit specializations of class templates had to be moved into the unnamed namespace to appease <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92598> "explicit specialization of template from unnamed namespace using unqualified-id in enclosing namespace". Also, accompanying declarations (of e.g. typedefs or static variables) that could arguably be moved into the unnamed namespace too have been left alone. And in some cases, mention of affected types in blacklists in other loplugins needed to be adapted. And sc/qa/unit/mark_test.cxx uses a hack of including other .cxx, one of which is sc/source/core/data/segmenttree.cxx where e.g. ScFlatUInt16SegmentsImpl is not moved into an unnamed namespace (because it is declared in sc/inc/segmenttree.hxx), but its base ScFlatSegmentsImpl is. GCC warns about such combinations with enabled-by-default -Wsubobject-linkage, but "The compiler doesn’t give this warning for types defined in the main .C file, as those are unlikely to have multiple definitions." (<https://gcc.gnu.org/onlinedocs/gcc-9.2.0/gcc/Warning-Options.html>) The warned-about classes also don't have multiple definitions in the given test, so disable the warning when including the .cxx. Change-Id: Ib694094c0d8168be68f8fe90dfd0acbb66a3f1e4 Reviewed-on: https://gerrit.libreoffice.org/83239 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-10-26size some stringbuffer to prevent re-allocNoel Grandin
I started with 32 and kept doubling the size until the site did not need re-alloc, but clamped it at 512 (e.g. in emfio/). Change-Id: Ib7caf35a1b7e42b0e4ed8aa812493449e3eefc8f Reviewed-on: https://gerrit.libreoffice.org/81540 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-10-07cid#1454631 Logically dead codeCaolán McNamara
Change-Id: Ie2850a38db3d2e343d9fc19e245eb97238196110 Reviewed-on: https://gerrit.libreoffice.org/80339 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-09-28loplugin:virtualdead in basegfxNoel Grandin
Change-Id: I8b3f7810eb08b5217df30b7be27aafadeeed247a Reviewed-on: https://gerrit.libreoffice.org/79647 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-08-19loplugin:constvars in accessibility..basegfxNoel Grandin
Change-Id: Id6a0b48c3440be394419e87bd7a4f63bd0a1e758 Reviewed-on: https://gerrit.libreoffice.org/77721 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>