summaryrefslogtreecommitdiff
path: root/scaddins/source
AgeCommit message (Collapse)AuthorFilesLines
2023-04-22Drop some defines in scaddinsMike Kaganski6-100/+101
Change-Id: I6155ad1c9e4627aad65ae1884e03491902c5d8a6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150780 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2023-04-21Resolves: tdf#154941 MROUND() use approxValue of division to roundEike Rathke1-1/+1
Change-Id: I75394b1bdffbdadf051157e84afa06f30126fe23 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150764 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins
2022-11-19tdf#147906 Use std::hypot for Pythagorean additionOmkarAcharekar1-1/+1
Change-Id: I19ecfe80e9a927c14db2680188baa54cb4911d4a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142535 Tested-by: Jenkins Reviewed-by: Hossein <hossein@libreoffice.org>
2022-10-25tdf#145759 Use symbolic constants instead of magic numerical constantsOmkarAcharekar2-4/+6
Change-Id: I68f9dd0bbe5a98de35253220dc33382139b4950e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141657 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-08-23tdf#148251 Use std::swap instead of using temporary valuesLiu Hao1-10/+2
Change-Id: Ibbc46bfb17d4d27dc40e63c65190b3f3a5f2d9c4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138256 Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Tested-by: Jenkins
2022-08-02Related: tdf#150203 Pricing, there is only one compatibility name, en-USEike Rathke2-4/+4
... but that was associated with de-DE instead. Change-Id: I9024666b5d33bbabbdb514075fe0598d072dacd5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137706 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins
2022-08-02Use nNumOfLoc instead of sizeof(pLang)Eike Rathke3-3/+3
... which is count*sizeof(char*), but luckily this private function was never used with out-of-bounds values. Change-Id: Ief3b3de614ca0df00c424f7caabf70e029ea7266 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137703 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins
2022-04-26Pick better variable typesStephan Bergmann1-3/+3
Change-Id: Ia4ba19744e23c20d9b6fb0e9d803bc00b415191f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133441 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-02-15tdf#145759 Using M_PI from cmath instead of magic constants.pragat-pandya1-12/+6
Replace the instances of Pi's value as magic number by M_PI Use M_PI_2 and 2_M_PI instead of calculating these values in code. Use basegfx functions to convert angle units. Change-Id: I6cca7cc93704a70ccf3a0571a56a789bc9df51ef Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129479 Reviewed-by: Arkadiy Illarionov <qarkai@gmail.com> Reviewed-by: Hossein <hossein@libreoffice.org> Tested-by: Jenkins
2021-12-06Add a bit to the WEEKS commentMike Kaganski1-1/+2
Change-Id: I8d409149710d25aa93e33f3c46723239156f4d1e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126304 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-12-04Small refactorMike Kaganski1-4/+3
Change-Id: I9487c32a1482da24e7b656141b116e7c5ca6d2dc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126297 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-12-01Fix typosAndrea Gelmini1-1/+1
Change-Id: I5e41be3f7e650db0019bcd42a3c1c2cb3bc5dd0e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126155 Tested-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com> Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
2021-11-29tdf#145578, tdf#145587 revise calculations for WEEKS Add-In functionWinfried Donkers1-54/+17
The calculations now follow the documentation for WEEKS in https://wiki.documentfoundation.org/Documentation/Calc_Functions/WEEKS. Change-Id: Ifede6e2ec2d9cfb7301fd5eb53bf7b6f187053bc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125319 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-11-14Use M_PI instead of defined value; use rad2deg()Hossein2-6/+2
* Replace defined values of PI with M_PI defined in <cmath> * Use M_PI_2 instead of PI / 2.0 * Instances could be found with: git grep 3.14 *.cxx *.hxx|grep define * One instance is ignored: sc/source/core/opencl/opinlinefun_statistical.cxx * Replace *(180 / PI) with basegfx::rad2deg() * Replace 2*PI/360 with basegfx::deg2rad() * Use atan2 instead of atan where it was more appropriate + atan2() handles all 4 quadrants + Extra conditions for different quadrants are removed Change-Id: I083ee2e1427cd36ba0b8c38e4fe5f782d6486075 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124229 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-10-20loplugin:indentation check for indent inside blockNoel Grandin1-3/+3
look for places where the statements inside a block are not indented Change-Id: I0cbfa7e0b6fb194b2aff6fa7e070fb907d70ca2f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123885 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-10-04drop 'using namespace std' in sax/sc/scaddins/sfx2/shellJulien Nabet1-1/+0
Change-Id: I422a6d5b0151115203fd2d7c0fc5597903d3ec8b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123064 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2021-09-22Extend loplugin:stringviewparam to starts/endsWith: scaddinsStephan Bergmann1-12/+14
Change-Id: I4e6d9d8f429e9a9133a494790522217638ad18e5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122484 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-08-05Pass context and resource string down to boost::locale separatelyNoel Grandin7-32/+36
because this is often on a hot path, and we can avoid the splitting and joining of strings like this. Change-Id: Ia36047209368ca53431178c2e8723a18cfe8260a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119220 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-08-02convert #defines to OUStringLiteralNoel Grandin3-9/+9
mostly by doing $ git grep -l '#define.*\"' -- *.cxx | xargs perl -pi -e 's/^#define\s+(\w+)\s+(\".*\")/constexpr OUStringLiteral \1 = u\2;/g' Change-Id: Idface893449b0ef2a3c5254865a300585d752fbb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119669 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-07-03Purge out when safe rtl::math ( isValidArcArg / sin / cos )BaiXiaochun1-4/+6
/** If a value is a valid argument for sin(), cos(), tan(). IEEE 754 specifies that absolute values up to 2^64 (=1.844e19) for the radian must be supported by trigonometric functions. Unfortunately, at least on x86 architectures, the FPU doesn't generate an error pattern for values >2^64 but produces erroneous results instead and sets only the "invalid operation" (IM) flag in the status word :-( Thus the application has to handle it itself. */ chart2/source/tools/RelativePositionHelper.cxx Function name: RelativePositionHelper::getCenterOfAnchoredObject From here: suppose it's related to the orientation of the chart << 2^64 chart2/source/view/main/LabelPositionHelper.cxx LabelPositionHelper::LabelPositionHelper Suppose: setup label position. There won't be angles grater than 360º. chart2/source/view/main/PlottingPositionHelper.cxx PolarPlottingPositionHelper::transformUnitCircleToScene Suppose: maybe disc chart orientation? Internal angle should be safe. chart2/source/view/main/ShapeFactory.cxx ShapeFactory::getSizeAfterRotation Suppose: rotate shape Internal angle should be safe. drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx Constant 100% safe sc/source/core/data/documen4.cxx bool ScDocument::Solver Suppose: the tangent is being used as numerical derivative (Regula falsi algorithm) So no impossible angles scaddins/source/analysis/bessel.cxx Filtered it out as bad imput Change-Id: Ib348cca6ce13263d087b6731f93f58d8a15cc725 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118193 Tested-by: Jenkins Reviewed-by: Eike Rathke <erack@redhat.com>
2021-07-02Purge rtl::math:: ( erf / erfc / expm1 )BaiXiaochun2-6/+3
Change-Id: Id0e0dce5f9a3bf0bb9ddc73e3aeaa8faf683ad2a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118134 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-06-17use string_view in the Translate APINoel Grandin6-9/+9
Change-Id: I0bb0ea9d39ed623928060ffd3f2e2bc36ba33209 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117272 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-04-15loplugin:stringliteralvar look for assignmentsNoel Grandin1-1/+1
to O[U]String from char array literals, we can convert the char literals to O[U]StringLiteral and avoid a runtime allocation Change-Id: I15d8dddb2cd428b90740e39f20daf98e0941aa6d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114125 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-03-23tdf#124176 Use pragma once in s*Vincent LE GARREC9-36/+9
sc, scaddins, sccomp, scripting Change-Id: Ia99fec9e238033821cb784810edd4762c09bd5db Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112049 Tested-by: Jenkins Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
2021-03-10Drop 'static_cast<cppu::OWeakObject*>' syntactic noiseMike Kaganski3-3/+3
... where the object is created in-place, and its type is known Change-Id: Ifabfcf2f3ad0d60152f14e8d970c1faa42115288 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112256 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-01-06Resolves: tdf#139173 One-off error in limits for DEC2HEX()Eike Rathke1-1/+1
BIN2HEX() and OCT2HEX() were not affected because the string input is already limited to 10 characters and the converted decimal can't even reach the limits. Change-Id: Iba4212e8fc382287a1a454edf91426ba21497ae2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108824 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins
2020-12-01tdf#42949 Fix new IWYU warnings in directories s*Gabor Kelemen5-8/+4
Except recently checked sc, sd, svx, sw Found with bin/find-unneeded-includes Only removal proposals are dealt with here. Change-Id: Ice1b86628e4f22a39f307b9c5fa567b6ab9d5acb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106917 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2020-11-24loplugin:stringviewparam extend to comparison operatorsNoel3-4/+4
which means that some call sites have to change to use unicode string literals i.e. u"foo" instead of "foo" Change-Id: Ie51c3adf56d343dd1d1710777f9d2a43ee66221c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106125 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-11-19tdf#123936 Formatting files in module sc with clang-formatPhilipp Hofer1-8/+6
Change-Id: I66cafda863e3e1e4559a57289c09925d68b0719c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105701 Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com> Tested-by: Jenkins
2020-11-11loplugin:stringviewNoel1-1/+1
Add new methods "subView" to O(U)String to return substring views of the underlying data. Add a clang plugin to warn when replacing existing calls to copy() would be better to use subView(). Change-Id: I03a5732431ce60808946f2ce2c923b22845689ca Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105420 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-10-02Use the new single-instance="true" attribute in scaddinsStephan Bergmann4-10/+6
Change-Id: Ic20da5a128b9225e688011b556f7927901f344f0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103847 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-10-01Use the new single-instance="true" attribute in scaddinsStephan Bergmann3-26/+3
Change-Id: I0d45a760276a4855c03c84f5a3a6fbbc98ddf840 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103737 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-08-30Fix typoAndrea Gelmini1-3/+3
Change-Id: I7fbf7d2c832b3e88b9ea82872c24450c33edc8aa Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101649 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2020-07-30terminate XDesktop properly in unit testsNoel Grandin3-4/+29
So that the UNO constructor work can continue - where we need the desktop to be disposed properly so that all UNO constructors objects have their dispose() called, and they can clean up their global state. We detect this case by changing a SAL_WARN to an assert in Desktop::disposing() (*) in ~ScTabViewShell, don't call EnterHandler, because that tries to create EditEngine's and other stuff, which crashes (*) Need a fake singleton so that the servicemanager calls dispose() on the AnalysAddIn and we can clear the global variable there. Change-Id: Id13b51e17afc16fcbbc65d64281cdf847e4a58cf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99640 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-07-25don't need prefix here anymoreNoel Grandin1-1/+1
Change-Id: Ie3b6681cb4ae8c1138766db7b19cc473367bfbd7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99422 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-07-23scaddins: create instances with uno constructorsNoel Grandin9-149/+38
See tdf#74608 for motivation. Change-Id: I678bc7fb73b5863b1656dc7f8b12c5b903c33b3e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99225 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-07-20compact namespace declNoel Grandin2-8/+4
used git grep -lw namespace | xargs perl -i -p0e 's/(\w+)\s*.\{.\s*namespace\s*(\w+)/\1::\2/smg;' to do the initial replace, then compiled and fixed. Change-Id: If69904d75940c851aeffab0e78c4ba02cc968d44 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98526 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-07-01Upcoming improved loplugin:staticanonymous -> redundantstatic: scaddinsStephan Bergmann3-4/+4
Change-Id: Ib3e2cdac213e59b8906aa42c90a7665b73c10b93 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97653 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-05-10compact namespace in sal..svgioNoel Grandin1-2/+2
Change-Id: I7e70614ea5a1cb1a1dc0ef8e9fb6fd48e85c3562 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93904 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-04-15loplugin:buriedassign in scaddins..sdextNoel Grandin1-3/+12
Change-Id: I72acfdac5879aa251a1074ea850758f66072b46e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92311 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-04-02loplugin:flatten in scaddinsNoel Grandin1-16/+16
Change-Id: I7a973de06d36fb10e9dd7f6826991ff9d503076d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91550 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-03-14tdf#130975 replace `rtl::math::isNan` with `std::isnan`.Yukio Siraichi1-2/+2
Change-Id: I5d53e6369d35093445b2efd8936bbf8c6775ff47 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90451 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2020-03-12tdf#130976 replace `rtl::math::isInf` with `std::inf`.Yukio Siraichi1-2/+2
Change-Id: Id0f0e07b324230d2d69cbf4ab07b0fff5b24474d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90377 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2020-03-12Revert "loplugin:constfields in scaddins,sccomp"Noel Grandin3-32/+32
This reverts commit 1ab27f9ae6f32c7502884c02c2217bbdcf035c48. Change-Id: Iaf9b011201ee763aaf4d08ceedd6074bafad1c3c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90409 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-03-12tdf#130977 replace `rtl::math::isFinite` with `std::isfinite`.Yukio Siraichi2-3/+3
- make all calls look like `std::isfinite`. - change the comments referring `rtl::math::isFinite`. Change-Id: I0cde9ceb9f20150467b454cddde5e62003cfde1a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90234 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2020-02-24tdf#42982: improve UNO API error reportingsMesut Çifci1-1/+1
Change-Id: I5a5df811562da1aafecb0057bcfe888f92f7b887 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87652 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@cib.de>
2020-01-31clang-tidy modernize-concat-nested-namespaceNoel Grandin3-13/+5
Change-Id: Iab35a8b85b3ba1df791c774f40b037f9420a071a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86708 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-12-22sal_Char->char in scaddins..sdextNoel Grandin7-20/+20
Change-Id: If2456800ace3696c2582e19a4c8612fee7d77f90 Reviewed-on: https://gerrit.libreoffice.org/85700 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-12-12Remove some redundant user-provided dtorsStephan Bergmann6-15/+0
...which silences various -Wdeprecated-copy-dtor warnings from Clang 10 trunk about copy functions being implicitly defined as non-deleted even though the class has a user-declared dtor Change-Id: I3409d403c3c709de4ad94eccbc2d7869e41847cc Reviewed-on: https://gerrit.libreoffice.org/85032 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-11-03loplugin:stringaddNoel Grandin1-3/+1
tweak the plugin to be more permissive, then validate by hand afterwards Change-Id: I40c5c911fe6ff7e45baaca372abf7dac211d9654 Reviewed-on: https://gerrit.libreoffice.org/81942 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>