summaryrefslogtreecommitdiff
path: root/basic/source/runtime/methods1.cxx
AgeCommit message (Collapse)Author
2019-11-12tdf#42949 Fix IWYU warnings in basic/Gabor Kelemen
Found with bin/find-unneeded-includes Only removal proposals are dealt with here. Change-Id: I325149be2ea7697b5b4a2ce4a662edd2f8be6e50 Reviewed-on: https://gerrit.libreoffice.org/82312 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2019-10-29remove unnecessary includesCaolán McNamara
Change-Id: Ia4a622b34ff3f71963cff7a1aa8658a4df12f04f Reviewed-on: https://gerrit.libreoffice.org/81676 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@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-10convert WriteCharPtr..getStr to WriteOStringNoel Grandin
and improve the WriteOString method, we can avoid the strlen here, we already have the length One change in behaviour to be noted - if the string contains trailing zero bytes, which ARE INCLUDED IN THE STRING LENGTH, i.e. I'm not talking about the normal terminating zero, then this patch changes behaviour because we will now write those zeros to the stream. Change-Id: I4668b9b9eb877f820b1dc70d6cd10ba2623bc0a2 Reviewed-on: https://gerrit.libreoffice.org/80597 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-10-09tdf#114441 changed some sal_uLong to better fitting typesChristian Barth
Change-Id: I114a6b028eb59a1ae38c31bc20439a35643fe972 Reviewed-on: https://gerrit.libreoffice.org/80159 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@cib.de>
2019-08-27loplugin:referencecasting find more redundant static_castNoel Grandin
Change-Id: I3a51812bbd3fcdc6b11e47cb12962f0d4fa7a2ae Reviewed-on: https://gerrit.libreoffice.org/78191 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-11-21improve function-local statics in basic..cuiNoel Grandin
Change-Id: If737e8478f6f1c8fffb060ce132d80e0f07ef8ee Reviewed-on: https://gerrit.libreoffice.org/63701 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-11-20Fix a copypaste errorMike Kaganski
Has been like this since commit 2d1ef8aa2493f044fa543c72b40bd8c8394d8d71 Change-Id: Idf0e05246f625befb4872e743b490a5594d24f8f Reviewed-on: https://gerrit.libreoffice.org/63548 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2018-10-23clang-tidy performance-unnecessary-copy-initialization inNoel Grandin
basctl..basic Change-Id: I4009282869cd8a2f269093564bd4fafccab80ec3 Reviewed-on: https://gerrit.libreoffice.org/62212 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-10-09Extend loplugin:redundantinline to catch inline functions w/o external linkageStephan Bergmann
...where "inline" (in its meaning of "this function can be defined in multiple translation units") thus doesn't make much sense. (As discussed in compilerplugins/clang/redundantinline.cxx, exempt such "static inline" functions in include files for now.) All the rewriting has been done automatically by the plugin, except for one instance in sw/source/ui/frmdlg/column.cxx that used to involve an #if), plus some subsequent solenv/clang-format/reformat-formatted-files. Change-Id: Ib8b996b651aeafc03bbdc8890faa05ed50517224 Reviewed-on: https://gerrit.libreoffice.org/61573 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-09-17New loplugin:externalStephan Bergmann
...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-08-10unnecessary null check before dynamic_cast, in variousNoel Grandin
Change-Id: I76ad0b3152030c29ee28f6a6cc80d0832188d02b Reviewed-on: https://gerrit.libreoffice.org/58774 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-07-27loplugin:stringloop in basic, framework, sax, svtoolsNoel Grandin
Change-Id: I2bad74a8f103e9dc68c8e0d0e6315697068d2f6d Reviewed-on: https://gerrit.libreoffice.org/58135 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-05-17New o3tl::temporary to simplify calls of std::modfStephan Bergmann
...that ignore the out-parameter integral part Change-Id: I05f07c1a8909023232f8aecf75ea5541d4eb81ca Reviewed-on: https://gerrit.libreoffice.org/54474 Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Tested-by: Stephan Bergmann <sbergman@redhat.com>
2018-05-16Resolves: tdf#117612 truncate DateAdd("m",...) to last day of monthEike Rathke
... instead of resulting in error because of roll-over not being set. Fallout from commit 6d424f07701bf26d8fb173563b567d5f097c33e2 CommitDate: Tue May 2 23:12:34 2017 +0200 Replace mouth-painted "inaccurate around leap year" rollover algorithm that does stricter checking but DateAdd() needs a lax checking with truncate to last day of month. Change-Id: I9d6f95ad3ac38257d492019bd621070491e98e76
2018-01-15More loplugin:cstylecast: basicStephan Bergmann
Change-Id: I0bb219632da384ab047a2b1fc3f2b041dacaf2cb
2018-01-12More loplugin:cstylecast: basicStephan Bergmann
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: I20b38196ee1b6a34384dc46d9de1b6e1b44947ae
2017-11-24Make the SbiInstance SvNumberFormatter shared_ptrEike Rathke
In preparation to get rid of the per call locally created SvNumberFormatter instances.. Change-Id: Ic7db3bbb655aa18e939f5722964655a20f2eadf2 Reviewed-on: https://gerrit.libreoffice.org/45227 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Eike Rathke <erack@redhat.com>
2017-11-23tdf#114011 limit/truncate date, not only yearEike Rathke
Change-Id: I479040f411fb8b5975c0aa1aa24f95c957cf80cf
2017-11-22drop duplicate methodCaolán McNamara
Change-Id: Idadd0a64e41cd02f5167b275081c3576a6224b12 Reviewed-on: https://gerrit.libreoffice.org/45075 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-10-10basic: consistently use "" and <> in include directivesMike Kaganski
Change-Id: I147c0e9b9b1e09af593f54799e45e1348cd40716 Reviewed-on: https://gerrit.libreoffice.org/43298 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2017-07-21Eliminate Date::operator+=() and -=() and replace with Date::AddDays()Eike Rathke
Clarifies code and gets rid of explicitly casting the operand to sal_Int32. Also in preparation of removing DateTime::operator+=(sal_Int32) that is confusingly similar to DateTime::operator+=(double) and just depends on type. Change-Id: I83422e2940fbb017978db9b5734b4966228af3de Reviewed-on: https://gerrit.libreoffice.org/40248 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Eike Rathke <erack@redhat.com>
2017-07-04loplugin:casttovoid in RTLFUNCStephan Bergmann
Change-Id: I810278640936e9b3c73f56a37e8c4786fd2790e3
2017-07-02loplugin:casttovoid: basicStephan Bergmann
Change-Id: I4e70accf67d4d812b8998b0baa07cd04c27216ad
2017-06-21s/ERRCODE_SBX_OK/ERRCODE_NONENoel Grandin
adds no value Change-Id: Iedf7a6a7be28fed4059b576312890be8cbb980d7 Reviewed-on: https://gerrit.libreoffice.org/39056 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-06-20loplugin:oncevar accessibility..basicNoel Grandin
Change-Id: I8fb41b658ef0f6ad1774ea897eace3dc9bb12de6 Reviewed-on: https://gerrit.libreoffice.org/38969 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-06-15drop SbError typedefNoel Grandin
in favour of ErrCode. Part of a larger patch to convert ErrCode to strong_int Change-Id: Ia846bfc93c58c85c6a6cec79e9d19b9ecbd1c05f Reviewed-on: https://gerrit.libreoffice.org/38783 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-06-14use ERRCODE_NONE instead of 0Noel Grandin
peeling off a small chunk of my ErrCode strong_int conversion Change-Id: Idc89e8496083beed7608cba705cd981139eb7111 Reviewed-on: https://gerrit.libreoffice.org/38777 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-05-19loplugin:comparisonwithconstant in basicNoel Grandin
Change-Id: Ie34a17d2fb465ffbe675ba4e99917d23959f1fb5 Reviewed-on: https://gerrit.libreoffice.org/37809 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-05-02Replace mouth-painted "inaccurate around leap year" rollover algorithmEike Rathke
... with proper tools::Date methods Normalize() and AddMonths(). Also prepare functionality to easily switch on rollover for StarBASIC as well, i.e. when called by DateSerial() runtime function. For StarBASIC, invalid date for day > daysinmonthofyear is now (or better since a previous commit 94bb96ada421b423e9ed30526fe5a6aac95f00b9 from today) properly detected, not just dumb 1<=day<=31. Change-Id: Ibb44f7247726f1e1168f0e66c5ae18e073d19f08
2017-05-02BASIC: handle the full tools::Date range from -32768-01-01 to 32767-12-31Eike Rathke
* Input of two-digit years only possible through CDateFromIso() though to maintain compatibility with previous behavior and also VBA mode. * VBA mode restricted to years 1..9999 Change-Id: Ia9574c3bf136619b4831b349d263c96b162d1ed4
2017-04-06loplugin:redundantcast find cstyle double castsNoel Grandin
Change-Id: I5507be190dac781e5cdb545a60acf3d50056c9f8 Reviewed-on: https://gerrit.libreoffice.org/36187 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-02-07Revert "[API CHANGE] return sal_uInt64 from GetSystemTicks in basic"Noel Grandin
This reverts commit fce604c8ae11b462113305aba080d77f8193cfea, and fixes tdf#105735 - xray ThisComponent no longer works in the process. It turns out Basic doesn't support sal_uInt64 very well, so lets rather have a small possibility of bad timestamps instead of broken scripts. Change-Id: Ic00485bd517a4fc61e05632001c9a5f92e05ddd6 Reviewed-on: https://gerrit.libreoffice.org/33972 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-02-03makeAny->Any in basctl..chart2Noel Grandin
Change-Id: Ief1cdffbfc59ab4e35ac945d020772ff84c50d61 Reviewed-on: https://gerrit.libreoffice.org/33867 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-02-02convert method names in tools::SvRef to be more like our other..Noel Grandin
reference classes, uno::Reference and rtl::Reference. Specifically rename Is()->is() and Clear()->clear(). Change-Id: Icb7e05e2d09cb9977121508b837ba0961dabb4ae Reviewed-on: https://gerrit.libreoffice.org/33576 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-01-19clear ARRAY_VS_SINGLETON coverity warningsCaolán McNamara
experiment to see if this clears them Change-Id: I91a74e06f621d3012b564cad87586ba74b0367ca
2017-01-09[API CHANGE] return unsigned 64-bit value from GetSystemTicks in basic codeNoel Grandin
instead of 32-bit value. looks like this has been incorrect since commit 9f2104e1f3a1ef8a37406b39188234df309241bc Author: Jens-Heiner Rechtien <hr@openoffice.org> Date: Mon Jun 19 16:46:13 2006 +0000 INTEGRATION: CWS warnings01 (1.23.26); FILE MERGED but nobody cared, since the values would previously fit into a 32-bit number. Change-Id: I4c121085977b5e7ff3e33c8ad57749b925ad31b9 Reviewed-on: https://gerrit.libreoffice.org/32879 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-12-05convert DecodeMechanism to scoped enumNoel Grandin
Change-Id: I5c56634b1bca8e37fa73d02d2428645301b6c547
2016-10-18replace <<= with assign for <<= with rhs AnyJochen Nitschke
found by deleting specialization of '<<=' template Change-Id: I253f15177ab20fd3ef9baf4158da8c662cb47e6c Reviewed-on: https://gerrit.libreoffice.org/29956 Reviewed-by: Jochen Nitschke <j.nitschke+logerrit@ok.de> Tested-by: Jochen Nitschke <j.nitschke+logerrit@ok.de>
2016-10-17replace <<= with assign for <<= with rhs AnyJochen Nitschke
makeAny and Any ctor return an Any Change-Id: Iaa361bc315d785f80153acf1009bf47d109728ec Reviewed-on: https://gerrit.libreoffice.org/29914 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Jochen Nitschke <j.nitschke+logerrit@ok.de>
2016-10-16clang-cl loplugin: basicStephan Bergmann
Change-Id: Ibb324ac81343d56038d18a4ee9b27b486df6e520 Reviewed-on: https://gerrit.libreoffice.org/29881 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2016-10-16tdf#96099 Reduce no. of useless typedefs for trivial containers.Hieronymous
Reduced vector< OUString > typedefs in sbintern module. Change-Id: I5b2fd6f0b5fe0ae538a12ac028a08458c6eb4714 Reviewed-on: https://gerrit.libreoffice.org/29916 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-10-10tdf#89307: Removed SvRef::operator T*()Jacek Fraczek
Conditional statements are using SvRef::Is() method. Changed static_cast<T*>(svRef<T>) occurances to svRef.get(). Added operator == and != to SvRef. SbxObject::Execute is using SbxVariableRef internally. SbxObject::FindQualified is using SbxVariableRef internally. Change-Id: I45b553e35d8fca9bf71163e6eefc60802a066395 Reviewed-on: https://gerrit.libreoffice.org/29621 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2016-10-05convert MapUnit to scoped enumNoel Grandin
I left a prefix on the names "Map" so that I would not have to re-arrange each name too much, since I can't start identifiers with digits like "100thMM" And remove RSC_EXTRAMAPUNIT, which doesn't seem to be doing anything anymore. Change-Id: I5187824aa87e30caf5357b51b5384b5ab919d224 Reviewed-on: https://gerrit.libreoffice.org/29096 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-09-15replace sal_Size with std::size_t (or sal_uInt64 for SvStream pos)Michael Stahl
... except in include/rtl, include/sal, include/uno, where sal_Size is retained for compatibility, and where callers of rtl functions pass in pointers that are incompatible on MSVC. Change-Id: I8344453780689f5120ba0870e44965b6d292450c
2016-07-27improve passstuffbyref return analysisNoel Grandin
Change-Id: I4258bcc97273d8bb7a8c4879fac02a427f76e18c Reviewed-on: https://gerrit.libreoffice.org/27317 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-06-14Resolves: tdf#59222 Crash in Basic with an array of values...Caolán McNamara
from a range address trying to make all SbxVariables reference count their parents is ludiciously hard, so just reference count this one known crashing case Change-Id: Ie1fa6624e8184146dd00d766cdbacef674153ef6 Reviewed-on: https://gerrit.libreoffice.org/26272 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2016-06-14drop dramatic distracting commentCaolán McNamara
Change-Id: Ic4b5537075e7ea9a713409982bb21e12f6b53e3f Reviewed-on: https://gerrit.libreoffice.org/26271 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2016-05-23Convert SbxClassType to scoped enumNoel Grandin
Change-Id: I48afcdd9924d22b52a8db21aa253061e4d38c85b Reviewed-on: https://gerrit.libreoffice.org/25259 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-02-17use consistent #define checks for the Windows platformNoel Grandin
stage 2 of replacing usage of various checks for the windows platform with the compiler-defined '_WIN32' macro In this stage we focus on replacing usage of the WIN macro Change-Id: Ie8a4a63198a6de96bd158ecd707dadafb9c8ea84 Reviewed-on: https://gerrit.libreoffice.org/22393 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>