summaryrefslogtreecommitdiff
path: root/basic
AgeCommit message (Collapse)AuthorFilesLines
2016-10-10tdf#89307: Removed SvRef::operator T*()Jacek Fraczek20-279/+278
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-07loplugin:staticmethods: basicStephan Bergmann1-1/+1
Change-Id: Ic8c8c8ad4470e14d662f478f6b859cd908c9f78c
2016-10-05Replace DdeData conversion operators with proper functionsStephan Bergmann1-1/+1
Change-Id: I866bdcbf1b6a5cda4472b6655ace866a3d5a8983
2016-10-05convert MapUnit to scoped enumNoel Grandin4-9/+9
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-10-05Remove _TYPED suffix from tools/link.hxx macrosStephan Bergmann7-16/+16
...which was introduced with 3ead3ad52f9bb2f9d1d6cf8dfc73a0a25e6778ed "Gradually typed Link" to distinguish the new, typed versions from the old, untyped ones, but is no longer necessary since 382eb1a23c390154619c385414bdbe6f6e461173 "remove untyped Link<>" removed the old versions. Change-Id: I494025df486a16a45861fcd8192dfe0275b1103c
2016-10-03Fix typosAndrea Gelmini2-3/+3
Change-Id: Ie44267e7c9f92eb1920f05235826abff761251f1 Reviewed-on: https://gerrit.libreoffice.org/29430 Reviewed-by: jan iversen <jani@documentfoundation.org> Tested-by: jan iversen <jani@documentfoundation.org>
2016-10-03tdf#102872 TAB function is missing its argumentLaurent Balland-Poirier1-0/+1
Commit 98f0e0eda50690bd01842c806bd13e3bc5af2966 introduced TAB function but its declaration in basic/source/runtime/stdobj.cxx is missing its argument So it used TAN function as argument Change-Id: Id4461ca805f9c7034b0440de46b845f29f57e3b0 Reviewed-on: https://gerrit.libreoffice.org/29437 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2016-09-30loplugin:constantparamNoel Grandin2-41/+4
Change-Id: Idbe8c8e6b3d44cacce296ec8c79b2b244281057c Reviewed-on: https://gerrit.libreoffice.org/29321 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-09-23perf: eliminate SfxSimpleHint and move to SfxHint, tdf#87101 relatedEike Rathke2-5/+4
There were over 150 places in *::Notify() functions that did some dynamic_cast<SfxSimpleHint*> of which ~98% were unnecessary because the base class SfxHint passed was an SfxSimpleHint anyway. dynamic_cast operations come with quite some cost, so avoid if possible. Specifically for ScFormulaCell::Notify() that created a bottleneck in scenarios where cells were notified that already handled a previous notification. In mass operations doing the dynamic_cast before it could be decided whether having to act on it or not this made 2/3 of all time spent in the Notify() call. To get rid of that rename/move SfxSimpleHint to SfxHint and let classes derive from SfxHint instead of SfxSimpleHint. This comes only with a slight cost that an additional sal_uInt32 is transported in such hints, initialized to 0, but this is neglectable compared to the huge gain. For the rare cases where a Notify() actually expects both, an SfxHint (formerly SfxSimpleHint) and a derived hint, this changed order of the dynamic_cast involved so the simple SfxHint::GetId() is handled last. Modules using such combinations can further optimize by treating the simple SfxHint::GetId() first once verified that none of the other derived hints use an ID not equal to zero respectively none of the ID values the simple hint uses. Change-Id: I9fcf723e3a4487ceb92336189d23a62c344cf0ce Reviewed-on: https://gerrit.libreoffice.org/29205 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Eike Rathke <erack@redhat.com>
2016-09-20Related cid#1371289: Improve code to not depend on missing move assignmentStephan Bergmann1-4/+5
Change-Id: Id254fa76cafe33a36646d517d224ba6a05406c09
2016-09-16loplugin:singlevalfields in basic..idlNoel Grandin7-15/+2
Also fix obvious bug in the initialisation of the connectivity::odbc::OConnection::m_bClosed field. Probably closes some kind of connection leak there. Change-Id: I04579cf91bcd6d6c51c697d83971da4142743a82 Reviewed-on: https://gerrit.libreoffice.org/28932 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 Stahl7-34/+39
... 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-09-14loplugin:constantparamNoel Grandin4-5/+5
clean up the plugin a little, and try to catch params which are default constructed, which doesn't seem to be working yet Change-Id: Ife45f18502a45cd26306424b7432c55fcbb0fd12 Reviewed-on: https://gerrit.libreoffice.org/28861 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-09-14loplugin:constantparam in accessibility to basicNoel Grandin1-9/+1
Change-Id: Id77cbcaefebf310a5d99c6ac12d154e182fd0a1c Reviewed-on: https://gerrit.libreoffice.org/28860 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-09-14tdf#88205 use list ctor for uno::Sequence a11y to canvasJochen Nitschke2-10/+4
Change-Id: Ib719c94c0488b8a48fdb013bc8fbd1a988595d18 Reviewed-on: https://gerrit.libreoffice.org/28866 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-09-13loplugin:dllprivateStephan Bergmann1-4/+3
Change-Id: I1fe70a39c50aba8b84c117653185fc37dbbfeab0
2016-09-13loplugin:override: No more need for the "MSVC dtor override" workaroundStephan Bergmann19-33/+33
The issue of 362d4f0cd4e50111edfae9d30c90602c37ed65a2 "Explicitly mark overriding destructors as 'virtual'" appears to no longer be a problem with MSVC 2013. (The little change in the rewriting code of compilerplugins/clang/override.cxx was necessary to prevent an endless loop when adding "override" to OOO_DLLPUBLIC_CHARTTOOLS virtual ~CloseableLifeTimeManager(); in chart2/source/inc/LifeTime.hxx, getting stuck in the leading OOO_DLLPUBLIC_CHARTTOOLS macro. Can't remember what that isAtEndOfImmediateMacroExpansion thing was originally necessary for, anyway.) Change-Id: I534c634504d7216b9bb632c2775c04eaf27e927e
2016-09-02boost::intrusive_ptr->tools::SvRefCaolán McNamara1-0/+2
Change-Id: I4c913dc62efe3f3747e78670f4efb0216d95c4ad Reviewed-on: https://gerrit.libreoffice.org/28585 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2016-08-31cppcheck:assertWithSideEffectJochen Nitschke1-2/+2
Change-Id: Ib3d2bb85c925a4208a9e2f0032857a11258c3bb2 Reviewed-on: https://gerrit.libreoffice.org/28540 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Jochen Nitschke <j.nitschke+logerrit@ok.de>
2016-08-30loplugin:stringconstant: adapt to improved OUStringLiteral1 (basic)Stephan Bergmann2-3/+3
Change-Id: I7e9ceb5513b34115bb1f41e627af06bbffc6ecf1
2016-08-29BASIC : Remove useless SbxBase::GetCreatorArnaud Versini4-4/+4
Change-Id: I3d9aa358ffaefc11b7d2427f2b567c360be2c667 Reviewed-on: https://gerrit.libreoffice.org/28434 Reviewed-by: Noel Grandin <noelgrandin@gmail.com> Tested-by: Noel Grandin <noelgrandin@gmail.com>
2016-08-28BASIC: Devirtualize SbiExprNode::~SbiExprNode and make SbiExprNode finalArnaud Versini1-2/+2
Change-Id: I95581265e2cc7befc00e67d42b6516d49c794680 Reviewed-on: https://gerrit.libreoffice.org/28438 Reviewed-by: Arnaud Versini <arnaud.versini@libreoffice.org> Tested-by: Arnaud Versini <arnaud.versini@libreoffice.org>
2016-08-27put StreamMode masks in scope of enum classJochen Nitschke1-1/+1
Change-Id: I77682f7e289a59b986bb84edf014029a20266470 Reviewed-on: https://gerrit.libreoffice.org/28420 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com> Tested-by: Noel Grandin <noelgrandin@gmail.com>
2016-08-25new loplugin: countusersofdefaultparamsNoel Grandin3-6/+6
Change-Id: I79e2c690f3e664c14af12cf763dd5a8ac20d6b04 Reviewed-on: https://gerrit.libreoffice.org/28353 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-08-24tdf#96505 get rid of "long" integer literals 'L'Asela Dasanayaka9-14/+14
Remove L from integer literals in module basic all 0L, 1L, 2L and 3L Change-Id: Ia46ce3d206020e16fc17e95731244a557941528c Reviewed-on: https://gerrit.libreoffice.org/27816 Reviewed-by: Tor Lillqvist <tml@collabora.com> Tested-by: Tor Lillqvist <tml@collabora.com>
2016-08-22Avoid OUString::operator[] out-of-bounds assertion when line ends with "&"Stephan Bergmann1-1/+1
Change-Id: I430e1df81a378243b139c654869589f1a75f5897
2016-08-19Resolves: tdf#88953 byref args incorrectly passed in basic->c++Caolán McNamara2-2/+2
partial revert of commit 22b094f5d8e1e82375b135abd3a6f99a9a555244 Date: Tue Jul 14 14:50:07 2015 +0200 loplugin:unusedmethods basic and partial revert of... commit e2080e70fe8b085f18e868e46340454720fa94ca Date: Wed Jun 18 12:14:29 2014 +0200 new compilerplugin returnbyref and revert of... commit 536051f8862203e0e115a5394a6379acd83cc8fe Date: Wed Jul 15 14:04:01 2015 +0200 fix Windows build after commit 22b094f5d8e1e82375b135abd3a6f99a9a555244 "loplugin:unusedmethods basic" Change-Id: I612937334fdb75365080c98a9d4da5ed7ae647e3
2016-08-19Some clang-tidy misc-move-constructor-initStephan Bergmann1-1/+1
...by turning the relevant ctor parameters into "const &". Change-Id: Ia8d0aba5da10ad6b25f8689e2281e45b3d71c1fc
2016-08-16basic: Simplify SbxArrayArnaud Versini1-39/+34
Change-Id: Idcc1e35d0a1d80591e2cebdae37a70cf029b022e Reviewed-on: https://gerrit.libreoffice.org/28147 Reviewed-by: Noel Grandin <noelgrandin@gmail.com> Tested-by: Noel Grandin <noelgrandin@gmail.com>
2016-08-15basic: SbxBase should be abstractArnaud Versini1-14/+0
Change-Id: Ief4297e5c64cfb29645463aca3cc677dc06fc95a Reviewed-on: https://gerrit.libreoffice.org/28112 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-08-13BASIC: Use more often std::unique_ptrArnaud Versini8-26/+22
Change-Id: I37f3b35afcf3b4dba30a6ba841a59e0d851f1ebb Reviewed-on: https://gerrit.libreoffice.org/27930 Reviewed-by: Noel Grandin <noelgrandin@gmail.com> Tested-by: Noel Grandin <noelgrandin@gmail.com>
2016-08-09BASIC: Use rtl/character.hxx in basic/source/sbx/sbxscan.cxxArnaud Versini1-11/+4
Change-Id: I018bc2881bca1973ef5e5133f3954252d5cea65e Reviewed-on: https://gerrit.libreoffice.org/27993 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-08-08BASIC: Remove useless BasicManagerImpl streams.Arnaud Versini1-25/+0
Change-Id: Iac5683afd20d8a2b7bc43474580bd1d05ace562b Reviewed-on: https://gerrit.libreoffice.org/27934 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-08-08BASIC: Move SbiParser's destructor to cpp file.Arnaud Versini2-0/+3
Change-Id: Id920a83693969ab2d93047524a9affa267a231dc Reviewed-on: https://gerrit.libreoffice.org/27931 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-08-04tdf#100726: Improve readability of OUString concatenationnadith5-26/+12
all most all of the places in the basic basctl modules this bug fixed Change-Id: I1a4a03e207c1b520449c31a05265585120da07f6 Reviewed-on: https://gerrit.libreoffice.org/27662 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-08-04loplugin:countusersofdefaultparams in basctl..basicNoel Grandin8-15/+15
Change-Id: I16fac3317ebf55581cb9aaef676a9759de51d695 Reviewed-on: https://gerrit.libreoffice.org/27793 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-07-31BASIC: Remove completly useless osl/thread includeArnaud Versini1-1/+0
Change-Id: I60c0b5d273344cb23c1226d7f2da81b6ee55892b Reviewed-on: https://gerrit.libreoffice.org/27753 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2016-07-27improve passstuffbyref return analysisNoel Grandin7-11/+11
Change-Id: I4258bcc97273d8bb7a8c4879fac02a427f76e18c Reviewed-on: https://gerrit.libreoffice.org/27317 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-07-26masses of MessBoxes not being disposed promptlyCaolán McNamara2-5/+5
since... commit ba81e5c6bd420b41a84ade6ccd774011a8089f7f Date: Thu May 28 21:35:43 2015 +0100 tdf#91702 - fix stack-based MessBox allocation. There is no special ScopedVclPtr<X>::Create or ScopedVclPtrInstance<X>::Create just VclPtr<X>::Create and a raw VclPtr<X>::Create()->foo doesn't call dispose on the owned X Change-Id: Ifacc8d5e742820701307c3c37b9b86487667d84f
2016-07-22basic: fix loplugin:cppunitassertequals warningsMiklos Vajna3-6/+6
Change-Id: I80c773f3127ebbce4b9b2a122a91a2e2ca4f505b Reviewed-on: https://gerrit.libreoffice.org/27424 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2016-07-20Resolves: tdf#98778 fix parsing of exponentsCaolán McNamara1-0/+7
regression from... commit 9e9f39d171cafa035d7b8e74187e25c3581cb89d Date: Tue Mar 19 23:23:16 2013 +0100 resolved rhbz#919020 Basic CDbl() and CSng() scan localized number Change-Id: I96535fd9bc9ec59d6e07739a3118c96eb2d8bd05 Reviewed-on: https://gerrit.libreoffice.org/27342 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Eike Rathke <erack@redhat.com>
2016-07-18BASIC: Remove useless overridesArnaud Versini2-24/+2
Change-Id: I49eb680bb0945a65a98978e98750fd62669fd820 Reviewed-on: https://gerrit.libreoffice.org/27255 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-07-15tdf#100726: Improve readability of OUString concatenation in basic modulenadith3-33/+11
Change-Id: I96c3215cf9f8932127e681aaaaee649774cac2e4 Reviewed-on: https://gerrit.libreoffice.org/27229 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-07-13tdf#84635 - Slow layout of large tablesNoel Grandin1-6/+2
Based on suggestion from Aron Budea. And do something similar to most other places keeping vectors of weak references where the code looks like it will hold more than a few entries. Measurements: the 26 page file file takes 51s without my path 15s with this patch the 69 page file file takes 5m28 without my path 51s with this patch the 84 page file file takes 8m28 without my path 58s with this patch Change-Id: I8da94c525fc73ebd969e0343c6f074be4f0063b1 Reviewed-on: https://gerrit.libreoffice.org/27093 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-07-11BASIC : Remove useless 16bits Remove function from SbxArrayArnaud Versini2-8/+3
Change-Id: I050a034437d3370a28c9e5ab47abee369e634f7d Reviewed-on: https://gerrit.libreoffice.org/27089 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-07-08Resolves: tdf#100452 class Date full (BCE,CE) proleptic Gregorian calendarEike Rathke1-2/+2
... implementing signed years with year 0 gap. Date(31,12,-1) last day BCE Date(1,1,1) first day CE New class Date member functions: * AddYears(sal_Int16) to be used instead of aDate.SetYear(aDate.GetYear()+sal_Int16) to handle year 0 gap. * convenience GetNextYear() to be used insted of GetYear()+1 * convenience GetPrevYear() to be used insted of GetYear()-1 * AddMonths(sal_Int32) * operator=(const css::util::Date&) New class DateTime member functions: * operator=(const css::util::DateTime&) Made some conversion ctors explicit, specifically Date(sal_Int32) Adapted hopefully all places that used a sal_uInt16 year to use sal_Int16 where appropriate. Eliminated some quirks in date handling found on the fly. Added era handling to i18npool icu calendar setting interface, which missing was responsible for 0001-01-01 entered in Calc being set as -0001-01-01, hence subtracting one day resulted in -0002-12-31. Change-Id: I77b39fba9599ebd5067d7864f6c9ebe01f6f578f Reviewed-on: https://gerrit.libreoffice.org/27049 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins <ci@libreoffice.org>
2016-07-08loplugin:redundantcast: redundant static_casts in basicStephan Bergmann1-2/+2
Change-Id: I6504cb70518f8770a0d44b1fb4d8ad91e43dc2b6
2016-07-07loplugin:passstuffbyref also for {css::uno,rtl}::ReferenceStephan Bergmann5-8/+8
Change-Id: I614d91e7e4a686613dc0cbe1b9f4fabb978ffc77
2016-07-03Improve readability of OUString concatanation in LibPageMuhammet Kara4-34/+34
, ScriptDocument , PropBrw , VBATest , SbUnoClass , SbModule , and SbiSymPool It is more readable and more efficient as a bonus. See: https://goo.gl/jsVAwy: Change-Id: I73926989345193b133e538d5aeca36f12723162c Reviewed-on: https://gerrit.libreoffice.org/26853 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
2016-06-27tdf#96505 Get rid of cargo cult long integer literalsapurvapriyadarshi1-4/+4
Cleanup in basic/source/runtime/runtime.cxx Change-Id: I1176251af9c4ca56c29dfafab20caccd7a28d60f Reviewed-on: https://gerrit.libreoffice.org/26627 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>