summaryrefslogtreecommitdiff
path: root/basic
AgeCommit message (Collapse)Author
2016-05-10Add SAL_FALLTHROUGH, where apparently appropriateStephan Bergmann
Change-Id: Id6e230d026184ab243e994a17515f2e5539d3646
2016-05-10Replace fallthrough comments with new SAL_FALLTHROUGH macroStephan Bergmann
...which (in LIBO_INTERNAL_ONLY) for Clang expands to [[clang::fallthrough]] in preparation of enabling -Wimplicit-fallthrough. (This is only relevant for C++11, as neither C nor old C++ has a way to annotate intended fallthroughs.) Could use BOOST_FALLTHROUGH instead of introducing our own SAL_FALLTHROUGH, but that would require adding back in dependencies on boost_headers to many libraries where we carefully removed any remaining Boost dependencies only recently. (At least make SAL_FALLTHROUGH strictly LIBO_INTERNAL_ONLY, so its future evolution will not have any impact on the stable URE interface.) C++17 will have a proper [[fallthroug]], eventually removing the need for a macro altogether. Change-Id: I342a7610a107db7d7a344ea9cbddfd9714d7e9ca
2016-05-09tdf#99589 tolower / toupper - dangerous to Turks ...Krishna Keshav
Used toAsciiUpperCase() from character.hxx Change-Id: I79f4638866daf8952103c8a521db925150e8dcda Reviewed-on: https://gerrit.libreoffice.org/24709 Reviewed-by: Michael Meeks <michael.meeks@collabora.com> Tested-by: Michael Meeks <michael.meeks@collabora.com>
2016-05-08BASIC : Remove an useless static_cast and use make_uniqueArnaud Versini
Change-Id: I32ec7e02ebf5a469db87bd2206d5fcd604b86795 Reviewed-on: https://gerrit.libreoffice.org/24720 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-05-07BASIC: SbiParser Remove useless static_cast and indent the code correctly.Arnaud Versini
Change-Id: I8c7a01c3023f998785c8b719f7ae53da57ff3e47 Reviewed-on: https://gerrit.libreoffice.org/23939 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Arnaud Versini <arnaud.versini@libreoffice.org>
2016-05-06teach passstuffbyref plugin to check for..Noel Grandin
unnecessarily passing primitives by const ref. Suggested by Tor Lillqvist Change-Id: I445e220542969ca3e252581e5953fb01cb2b2be6 Reviewed-on: https://gerrit.libreoffice.org/24672 Reviewed-by: Tor Lillqvist <tml@collabora.com> Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-05-04use Any constructor instead of temporariesNoel Grandin
Change-Id: Iffb82a2cee1a28d89eeea2b905aaa14086ee475a
2016-05-04While at it, delete Any functions on sal_Bool*Stephan Bergmann
(at least for LIBO_INTERNAL_ONLY), to help further reduce the occurrences of sal_Bool across the code base Change-Id: I70654a0cb56655984c717b7b894f26c9ab47536e
2016-05-01Fix typo in codeAndrea Gelmini
Change-Id: Ib1daf257018d5a5da90773dd39086f18666fea9f Reviewed-on: https://gerrit.libreoffice.org/24533 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
2016-05-01Fix typosAndrea Gelmini
Change-Id: Ideafa411b53fe4a5f2e6559be10c4cb82b58a256 Reviewed-on: https://gerrit.libreoffice.org/24543 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
2016-04-26update loplugin stylepolice to check local pointers varsNoel Grandin
are actually pointer vars. Also convert from regex to normal code, so we can enable this plugin all the time. Change-Id: Ie36a25ecba61c18f99c77c77646d6459a443cbd1 Reviewed-on: https://gerrit.libreoffice.org/24391 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-04-21clang-tidy modernize-loop-convert in b*Noel Grandin
Change-Id: I8ac6eb59e213eafa78e3dc4578738b53e8adef5b
2016-04-21new plugin stylepoliceNoel Grandin
check for local variables which follow our member field naming convention, which is highly confusing Change-Id: Idacedf7145d09843e96a584237b385f7662eea10
2016-04-20loplugin:salbool: Automatic rewrite of sal_False/TrueStephan Bergmann
Change-Id: Ib91f20761167ab78b68813d8877dceea5fef801f
2016-04-19BASIC : Partially revert SbxArray simplification.Arnaud Versini
Revert partially commit 0fa6c88007f61176ac707cb5d77fd35cf1521123 (BASIC : Simplify SbxArray) to make sure SbxArray::Put add too much objects behind 65k limit. Change-Id: I2d86f213711665f8cb522879ff78ff5bc9f42b31 Reviewed-on: https://gerrit.libreoffice.org/24223 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2016-04-18clang-tidy performance-unnecessary-copy-initializationNoel Grandin
probably not much performance benefit, but it sure is good at identifying leftover intermediate variables from previous refactorings. Change-Id: I3ce16fe496ac2733c1cb0a35f74c0fc9193cc657 Reviewed-on: https://gerrit.libreoffice.org/24026 Reviewed-by: Noel Grandin <noelgrandin@gmail.com> Tested-by: Noel Grandin <noelgrandin@gmail.com>
2016-04-18clean-up: unused using declarations and includesJochen Nitschke
Searched source for using declarations. Checked if those symbols reappear in the source file, even in comments or dead code but not in #include statements. If they don't reappear, remove the declaration. Remove includes whose symbol got removed. Change-Id: Ibb77163f63c1120070e9518e3dc0a78c6c59fab0 Reviewed-on: https://gerrit.libreoffice.org/24148 Reviewed-by: Jochen Nitschke <j.nitschke+logerrit@ok.de> Reviewed-by: Noel Grandin <noelgrandin@gmail.com> Tested-by: Noel Grandin <noelgrandin@gmail.com>
2016-04-18BASIC : Simplify SbxArrayArnaud Versini
Change-Id: I988fcfed2b03039cbc167eaee1d09bffe42cd411 Reviewed-on: https://gerrit.libreoffice.org/24171 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-04-18Remove needless typedef from basic/qa/cppunit/basic_coverage.cxxRyan McCoskrie
Change-Id: Iba1c48d58daa618107ad84240d613f675d447aad Reviewed-on: https://gerrit.libreoffice.org/24175 Reviewed-by: Noel Grandin <noelgrandin@gmail.com> Tested-by: Noel Grandin <noelgrandin@gmail.com>
2016-04-17tdf#99357: Basic, return if .with pNode nullJulien Nabet
Program received signal SIGSEGV, Segmentation fault. 0x00002aaaaed9741e in SbiExprNode::GetVar (this=0x0) at /home/julien/lo/libreoffice/basic/source/comp/exprnode.cxx:118 118 if( eNodeType == SbxVARVAL ) (gdb) bt 0 0x00002aaaaed9741e in SbiExprNode::GetVar (this=0x0) at /home/julien/lo/libreoffice/basic/source/comp/exprnode.cxx:118 1 0x00002aaaaed9afd6 in SbiParser::With (this=0x50eac70) at /home/julien/lo/libreoffice/basic/source/comp/loops.cxx:266 2 0x00002aaaaed9d1a7 in SbiParser::Parse (this=0x50eac70) at /home/julien/lo/libreoffice/basic/source/comp/parser.cxx:437 Change-Id: If0ecacd007a14e2ba81181da0fe472ea667c4cb7 Reviewed-on: https://gerrit.libreoffice.org/24147 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2016-04-15remove tools/solarmutex.hxxNoel Grandin
Deprecated in favour of comphelper::SolarMutex Change-Id: I159077562660de5df25601fa471447f4b64a2cf1 Reviewed-on: https://gerrit.libreoffice.org/24079 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-04-13loplugin:passstuffbyref in basicNoel Grandin
Change-Id: Ie93b33502325f00ba95ab168a445a347148f9edd
2016-04-13Related tdf#99089: avoid second crashJulien Nabet
Second bt quoted in https://cgit.freedesktop.org/libreoffice/core/commit/?id=43109b751bf5fd36318de56b2fb686acc724673f wasn't solved, try to fix it now. Change-Id: I68484f9417ff0bf747306ac8774cad5fdf84b924 Reviewed-on: https://gerrit.libreoffice.org/24042 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2016-04-12Avoid reserved identifierStephan Bergmann
Change-Id: Ic59b23de2c11e8a0a86c3711a4507cd76e07896f
2016-04-12Avoid reserved identifierStephan Bergmann
Change-Id: I0ed8754bb06328b61a41079a4f446d8dd2b61bb7
2016-04-12Avoid reserved identifiersStephan Bergmann
Change-Id: If64f146fd9c6417ed16d459cef39b3a2d47bfb4d
2016-04-12cleanup: remove unused com/sun/star/uno includesJochen Nitschke
Sequence.h(xx), Any.h(xx) and Type.h(xx) and remove unused using-declarations from these files. Add a few missing includes provided by them. Change-Id: I6b91b6d1fdf9d0496dd546c0aab9bdcc6831a5d4 Reviewed-on: https://gerrit.libreoffice.org/23805 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-04-11BASIC: Remove useless static_cast from basmgr.cxxArnaud Versini
Change-Id: If389aaabd22751908beba7dee9dbc79460692524 Reviewed-on: https://gerrit.libreoffice.org/23958 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2016-04-11Avoid reserved identifierStephan Bergmann
Change-Id: I6dfb2961adeb412405c58e0a0b51e130cbd3e0c3
2016-04-11Remove an useless check I had addedJulien Nabet
Reverts partly https://cgit.freedesktop.org/libreoffice/core/commit/?id=43109b751bf5fd36318de56b2fb686acc724673f Change-Id: Ief7fd752d260031e243ea4304f6c55fa4dc42bfd Reviewed-on: https://gerrit.libreoffice.org/23984 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2016-04-11clang-tidy performance-unnecessary-value-param in basicNoel Grandin
Change-Id: I997213ca28efc2df04d454ffaf3c81c9cbad09ac
2016-04-11make GetGlobalUNOConstant and GetUNOConstant take an OUStringNoel Grandin
and eliminate converting backwards and forwards between sal_Char*/OString/OUString Change-Id: Iaf52ce93f0e732ab338f75d21b95ab4b020a4d6f Reviewed-on: https://gerrit.libreoffice.org/23919 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-04-10tdf#99089: avoid some crashes in BasicJulien Nabet
First stacktrace: soffice.bin: /home/julien/compile-libreoffice/libreoffice/include/rtl/ustring.hxx:577: sal_Unicode rtl::OUString::operator[](sal_Int32) const: Assertion `index >= 0 && static_cast<sal_uInt32>(index) < static_cast<sal_uInt32>(getLength())' failed. ... 3 0x00002aaaab327452 in __GI___assert_fail (assertion=0x2aaaaeea62a8 "index >= 0 && static_cast<sal_uInt32>(index) < static_cast<sal_uInt32>(getLength())", file=0x2aaaaeea6260 "/home/julien/compile-libreoffice/libreoffice/include/rtl/ustring.hxx", line=577, function=0x2aaaaeea6860 <rtl::OUString::operator[](int) const::__PRETTY_FUNCTION__> "sal_Unicode rtl::OUString::operator[](sal_Int32) const") at assert.c:101 4 0x00002aaaaed91e89 in rtl::OUString::operator[](int) const (this=0x7fffffff2770, index=0) at /home/julien/compile-libreoffice/libreoffice/include/rtl/ustring.hxx:577 5 0x00002aaaaee1c66f in SbRtl_Val(StarBASIC*, SbxArray&, bool) (pBasic=0xa2a7ec0, rPar=..., bWrite=false) at /home/julien/compile-libreoffice/libreoffice/basic/source/runtime/methods.cxx:1792 Second stacktrace: 0x00002aaaaee6054d in printfmtstr (rStr="", rRes="", rFmt="\£0.##") at /home/julien/compile-libreoffice/libreoffice/basic/source/sbx/sbxscan.cxx:534 534 while( *pFmt != '\' ); (gdb) bt 0 0x00002aaaaee6054d in printfmtstr(rtl::OUString const&, rtl::OUString&, rtl::OUString const&) (rStr="", rRes="", rFmt="\£0.##") at /home/julien/compile-libreoffice/libreoffice/basic/source/sbx/sbxscan.cxx:534 1 0x00002aaaaee617ce in SbxValue::Format(rtl::OUString&, rtl::OUString const*) const (this=0xb12dd60, rRes="", pFmt=0x7fffffff20e0) at /home/julien/compile-libreoffice/libreoffice/basic/source/sbx/sbxscan.cxx:883 2 0x00002aaaaee217af in SbRtl_Format(StarBASIC*, SbxArray&, bool) (pBasic=0xa2cffa0, rPar=..., bWrite=false) at /home/julien/compile-libreoffice/libreoffice/basic/source/runtime/methods.cxx:3519 Change-Id: I1798a1545ce08efa9d6fc39f4696195f9dc96c67 Reviewed-on: https://gerrit.libreoffice.org/23956 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2016-04-07fix bug in SbxArray::MergeNoel Grandin
bug was recently introduced by commit a5c232831395f8987a8395816c5a60105a52b6a0 "BASIC: Store directly SbxVarEntry in SbxArray" bug was found by clang-tidy Change-Id: Ibcce6d6024ac60eb143cd873760586a7f6231858 Reviewed-on: https://gerrit.libreoffice.org/23890 Reviewed-by: Michael Stahl <mstahl@redhat.com> Tested-by: Michael Stahl <mstahl@redhat.com>
2016-04-06Avoid reserved identifierStephan Bergmann
Change-Id: I2f8dc470100e91841eebbe1e3b02a3d31ab3a535
2016-04-06Avoid reserved identifiersStephan Bergmann
Change-Id: Ibba1a36d4f3744fa68f7e9d0076c997e076262cb
2016-04-06Turn SbiOpcode into scoped enumStephan Bergmann
Change-Id: I75d808dd3a42e57e7f55bad97e24fef65bb62dc6
2016-04-06Avoid reserved identifiersStephan Bergmann
Change-Id: I3fbc7cb107bdab770d5ce9ed3ecddb962d2d4666
2016-04-04BASIC : Use a vector to store the argv stackArnaud Versini
Change-Id: I29c93aec598b7f784f549ce05f6b32dfabbfc3ad Reviewed-on: https://gerrit.libreoffice.org/23815 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Arnaud Versini <arnaud.versini@libreoffice.org>
2016-04-04tdf#94306 replace boost::noncopyable in ..Jochen Nitschke
.. accessibility, avmedia, basctl, basic and bridges remove boost from module if not needed anymore Change-Id: I6177f8276766a0a7df1703e81bf1b448912df6e2 Reviewed-on: https://gerrit.libreoffice.org/23744 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2016-04-04tdf#97499 Fixed containers parameters clearing #4tymyjan
Change-Id: I7c96181399f4d7e62d4aceca404b22d68f903513 Reviewed-on: https://gerrit.libreoffice.org/23754 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-04-04tdf#97499 Fixed containers parameters clearing #2tymyjan
Change-Id: I2e77c3b33ae3b8a49a7890cac77be566391972f2 Reviewed-on: https://gerrit.libreoffice.org/23751 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-04-03BASIC : Use a vector to store the go sub stack.Arnaud Versini
Change-Id: I80987f3f7c036279a8292a7fbbd2dcd232196226 Reviewed-on: https://gerrit.libreoffice.org/23753 Reviewed-by: Noel Grandin <noelgrandin@gmail.com> Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Arnaud Versini <arnaud.versini@libreoffice.org>
2016-04-01tdf#97966 Drop 'static' keywordsWastack
Including no keywords from extern "C" blocks Change-Id: Id0304994a692f1004993dda2ffd7fb819ab8e8d0 Reviewed-on: https://gerrit.libreoffice.org/23670 Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Tested-by: Stephan Bergmann <sbergman@redhat.com>
2016-03-23loplugin:constantparam in basicNoel Grandin
Change-Id: I6831cb8628eed76db35070934f62dccb1345ba12
2016-03-20BASIC: Calling SbxDimArray::Clear should also call SbxArray.Arnaud Versini
Change-Id: I832a192bbb3ddd2d32d80f22ae8f2cf95e3edfb7 Reviewed-on: https://gerrit.libreoffice.org/23192 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Arnaud Versini <arnaud.versini@libreoffice.org>
2016-03-20BASIC : Use std::vector in SbiRuntime to save referencesArnaud Versini
Change-Id: Ica819538b39e58416825e651d057620a66f731cd Reviewed-on: https://gerrit.libreoffice.org/23193 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Arnaud Versini <arnaud.versini@libreoffice.org>
2016-03-17loplugin:constantparam in toolsNoel Grandin
Change-Id: I3774661799c074561c694515baba42a375d0a077 Reviewed-on: https://gerrit.libreoffice.org/23301 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-03-14coverity#1355498 assume Unchecked return value is deliberateCaolán McNamara
Change-Id: I8b0597a5ab87d4d4529e3ccc097902486a41e957
2016-03-10Extract Directories from BootstrapFixtureBaseStephan Bergmann
(as some tests derive from the latter only for the Directories part, not for the setUp/tearDown overrides: those tests will be cleaned up next) Change-Id: Ib6b78eea868b8bc21d4cc6e8fd9e1d025deca05f Reviewed-on: https://gerrit.libreoffice.org/23078 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>