summaryrefslogtreecommitdiff
path: root/basegfx
AgeCommit message (Collapse)Author
2022-01-19tdf#145614 Convert #define to enum or constexprVaibhavMalik4187
Change-Id: Ib6694ec77c275c9a604abfa7d87df6ab262449b6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128250 Tested-by: Hossein <hossein@libreoffice.org> Reviewed-by: Hossein <hossein@libreoffice.org>
2022-01-13Recheck modules [a-c]* with IWYUGabor Kelemen
See tdf#42949 for motivation Change-Id: I74a3c3a67c3639376e2251c3eb917fa4139dfbd0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127808 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2021-12-27use comphelper::WeakComponentImplHelper in UnoPolyPolygonNoel Grandin
Change-Id: I82248cfbb0cbdb765fa2f97f53e8990a9e05a28b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127547 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-12-21loplugin:flatten in accessibility..basicNoel Grandin
Change-Id: If2cc282c2b135d634daf393a082c29049b10a677 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127223 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-12-20Missing inlcude (for std::as_const)Stephan Bergmann
(presumably since 807f238f12e0774fabf507a17ca0ba9204d47833 "Recheck include/[e-r]* with IWYU") Change-Id: I188edd1e9cea0bc2ca65cc834b94aa9c0913c0ea Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127187 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-12-07improve loplugin:cow_wrapperNoel Grandin
to find my previous attempt at this, which only obscured the problem <noelgrandin> I'm such an idiot <noelgrandin> I changed a whole bunch of code to avoid calling const methods on a non-const object <noelgrandin> from p->foo() to std::as_const(*p).foo() <noelgrandin> can you spot the mistake? <bubli> Is this a job interview question? :D <vmiklos> noelgrandin: you did the opposite, now you always call const member functions, while you wanted to always call non-const member functions? <noelgrandin> more like a "why didn't the smart people on this channel tell me I was an idiot" :-) <noelgrandin> in this case, we have o3tl::cow_wrapper, which overrides operator* and operator-> <vmiklos> ah, and by the time you would add/remove the const, cow_wrapper already did the expensive task of copying based on const/non-const <noelgrandin> exactly <thorsten> heh Change-Id: I5366e6a87c414b862668b61e6adfbccfdd9d3b04 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126473 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-12-03flatten ImplB2DPolygon data a littleNoel Grandin
Change-Id: I64860888bf23a11e8dfaf1fc72132b6fadc526ea Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126311 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-12-01improve the script for reducing symbol exportsNoel Grandin
And apply some of the results Change-Id: If555476fdd951cbc1d01fb3ef3ab1cbca2b64960 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124896 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-11-19Drop F_2PIMike Kaganski
Change-Id: Ie98606607b2ce262e4eed76bb8cd86fbfe846f76 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125506 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@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-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-06loplugin:moveparam in basegfxNoel Grandin
Change-Id: I68d0de099641ae5b2ae92f46e86bdf4a43c468a4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123141 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-09-30loplugin:constparams improve handling of pointer paramsNoel Grandin
Change-Id: I4c0002e72703eded435bfe4985f5b0121bf8524b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122843 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-09-15loplugin:constvarsNoel Grandin
Change-Id: I9b35d6333afa6b305bf73fc55a7e60c8365674e9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122134 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-09-13loplugin:cow_wrapperNoel Grandin
check the classes that use o3tl::cow_wrapper so that they don't unnecessarity trigger copies Change-Id: I545e627598217f3e61ba2c384adb8d4f8b404829 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122030 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-09-08no need to allocate this separatelyNoel Grandin
Change-Id: Ib92bd39d1c5057731d670a79bf788909856247be Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121799 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-08-27clang-tidy:readability-redundant-member-initNoel Grandin
Change-Id: Ibeff6e5cbc20ab86b1e9cb96292acb340849ede3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121149 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-18loplugin:sequenceloop also check for B2DPolyPolygonNoel Grandin
which has the same problem Change-Id: I98f9924626f26739e91d6a9d21e4276473ea314d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120620 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-08-17reduce alloc costs for some basegfx objects (tdf#105575)Noel Grandin
we can use a default object for the default constructo case, and remove one malloc for each default constructed object Change-Id: I0bec37ef9161a210973abb25669a9f16a5e0ea75 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120603 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-07-31getArray->getConstArrayNoel Grandin
Change-Id: I951dd4a02c9ead98e7eb13ae2995ba2e1e57b38a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119740 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-07-27Drop redundant checkMike Kaganski
If value is not approximately equal to zero, its square root also is not Change-Id: I0a2c30a8a85c64406e3a8ea8cff2315f25c2226d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119444 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
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-17basegfx: generalise tuples with template class Tuple2D and Tuple3DTomaž Vajngerl
B2DTuple2D, B2ITuple2D and B2I64Tuple share a lot in common so we can generalise it as a template class. The same goes for the 3D variants - B3DTuple and B3ITuple. This is the initial attempt, but doesn't yet generalise all that is possible. Add some tests for the tuple variants that test the behaviour of overloaded operators and other common methods. Change-Id: Iee5ed15d58ea88e65ee7854bd05a87ceab22023d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117104 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2021-06-16basegfx: use namespace for "ftools", make sure input is FP numberTomaž Vajngerl
Don't use empty class with static methods for ftools, but just use namespace instead. Also make sure it works with any floating point numbers (float and double) and don't allow input if it is anything else than a floating point number Change-Id: I94b964291b3999d38ae13afe6ddfdbe6d891d410 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117154 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2021-06-11Simplify vector initializationsJulien Nabet
Change-Id: Icf8972be204799e9b3b3824ab18d8584911fe1c4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117061 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2021-04-19Updated README.md filesHossein
* Updated README.md contents to fix various issues * Fixed source links by using [git:], processed by mkdocs scripts * Added README.md for ios, setup_native, unotest * Fixed issues with "underline" and "less than" sign Change-Id: I3e52a1d3372586c390ee6c42a2ef48bbabc81398 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114248 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2021-04-09Recheck include/ with IWYUGabor Kelemen
See tdf#42949 for motivation Change-Id: Ifc253bf800bb1468b5774663a93f4fb30bec81d3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113657 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.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-04-01tdf#124176 Use pragma once instead of include guardsrounak
Change-Id: I778393686b9a51df6437c61a814e5c62a34302de Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113433 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2021-03-26Drop these definesMike Kaganski
Change-Id: I7ff56d6f016ea90c4b5cdcbbb36141627037c0ba Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113125 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.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-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-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