summaryrefslogtreecommitdiff
path: root/basic
AgeCommit message (Collapse)AuthorFilesLines
2016-04-21new plugin stylepoliceNoel Grandin2-7/+7
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 Bergmann6-15/+15
Change-Id: Ib91f20761167ab78b68813d8877dceea5fef801f
2016-04-19BASIC : Partially revert SbxArray simplification.Arnaud Versini1-1/+16
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 Grandin1-1/+1
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 Nitschke1-3/+0
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 Versini1-23/+4
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 McCoskrie1-6/+5
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 Nabet1-0/+2
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 Grandin1-3/+7
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 Grandin6-12/+12
Change-Id: Ie93b33502325f00ba95ab168a445a347148f9edd
2016-04-13Related tdf#99089: avoid second crashJulien Nabet1-1/+1
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 Bergmann1-2/+2
Change-Id: Ic59b23de2c11e8a0a86c3711a4507cd76e07896f
2016-04-12Avoid reserved identifierStephan Bergmann1-5/+5
Change-Id: I0ed8754bb06328b61a41079a4f446d8dd2b61bb7
2016-04-12Avoid reserved identifiersStephan Bergmann1-393/+393
Change-Id: If64f146fd9c6417ed16d459cef39b3a2d47bfb4d
2016-04-12cleanup: remove unused com/sun/star/uno includesJochen Nitschke1-1/+0
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 Versini1-23/+20
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 Bergmann1-8/+8
Change-Id: I6dfb2961adeb412405c58e0a0b51e130cbd3e0c3
2016-04-11Remove an useless check I had addedJulien Nabet1-1/+1
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 Grandin9-41/+33
Change-Id: I997213ca28efc2df04d454ffaf3c81c9cbad09ac
2016-04-11make GetGlobalUNOConstant and GetUNOConstant take an OUStringNoel Grandin2-10/+7
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 Nabet2-2/+2
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 Grandin1-1/+1
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 Bergmann1-3/+3
Change-Id: I2f8dc470100e91841eebbe1e3b02a3d31ab3a535
2016-04-06Avoid reserved identifiersStephan Bergmann5-26/+26
Change-Id: Ibba1a36d4f3744fa68f7e9d0076c997e076262cb
2016-04-06Turn SbiOpcode into scoped enumStephan Bergmann9-199/+199
Change-Id: I75d808dd3a42e57e7f55bad97e24fef65bb62dc6
2016-04-06Avoid reserved identifiersStephan Bergmann8-281/+281
Change-Id: I3fbc7cb107bdab770d5ce9ed3ecddb962d2d4666
2016-04-04BASIC : Use a vector to store the argv stackArnaud Versini2-17/+13
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 Nitschke1-2/+4
.. 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 #4tymyjan2-2/+2
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 #2tymyjan2-2/+2
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 Versini2-40/+21
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' keywordsWastack1-1/+1
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 Grandin2-6/+6
Change-Id: I6831cb8628eed76db35070934f62dccb1345ba12
2016-03-20BASIC: Calling SbxDimArray::Clear should also call SbxArray.Arnaud Versini1-1/+1
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 Versini2-48/+4
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 Grandin2-26/+26
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 McNamara1-1/+1
Change-Id: I8b0597a5ab87d4d4529e3ccc097902486a41e957
2016-03-10Extract Directories from BootstrapFixtureBaseStephan Bergmann2-4/+4
(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>
2016-03-09deref of nullCaolán McNamara1-2/+2
regression from commit f17a4694b07856292804c23b80ce92967d401bb8 Author: Arnaud Versini <arnaud.versini@gmail.com> Date: Sat Feb 13 20:17:41 2016 +0100 BASIC : use std::unique_ptr for storing SbiExprList Change-Id: I37f2a1c837c6742cf6d403962d2730b5e80004ec Reviewed-on: https://gerrit.libreoffice.org/22345 because they have been moved into the container at this point Change-Id: If21e0321ffdce66aa9629637d0ff8c16efbbd25e
2016-03-09loplugin:constantparam in basicNoel Grandin1-2/+2
Change-Id: I5b49406535c1ec95e47fe237a23184a499b875e5
2016-03-08tdf#94306 Replace boost::noncopyable with plain C++11 deleted copy ctorsSteven Guo4-12/+28
Replaced boost::noncopyable with plain C++11 deleted copy ctors in /basic/* files. Change-Id: I9c0eb0a51ec5cb25c88c72b55f42864e73006e6b Reviewed-on: https://gerrit.libreoffice.org/22969 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com>
2016-03-08Remove ancient StarPortal leftoversStephan Bergmann4-160/+0
No UNO bridge has a "user" token in its description anyway, so needsSecurityRestrictions always returned false. Change-Id: Ibc3aa25212a2e8b245c13578fa29582be42791e6
2016-03-07basic: tdf#87530 if a new password is set, must set mbLoadedSource flagMichael Stahl1-0/+10
... so that the library is stored (and encrypted), and not copied unencrypted from source storage. Change-Id: I9546087ec6f07007aa1ec377d2e959f2bae99a38
2016-03-07basic: tdf#87530 don't copy storage that doesn't existMichael Stahl1-2/+15
If the Basic library is newly created it may not have been stored to the document storage yet. (regression from 5246fa262450f686674850c53df666422f441c86) Change-Id: I9c2fc1d7446795b9c1c2224671118b2a671dcad8
2016-03-07tdf84938 Replaced Sb_Attr_ defined constants with enum class in runtime.hxxSteven Guo3-24/+31
Replaced the #define Sb_Attr_* constants with SbAttributes enum class in runtime.hxx and adjusted uses in methods.cxx. Change-Id: Ic7f6f6452849ffc9675ffd697ffc130276082318 Reviewed-on: https://gerrit.libreoffice.org/22948 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com> Tested-by: Noel Grandin <noelgrandin@gmail.com>
2016-03-07loplugin:unuseddefaultparam in variousNoel Grandin2-8/+4
Change-Id: I03d7381aad055cbe9bd905e4082586073f4112e0 Reviewed-on: https://gerrit.libreoffice.org/22900 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-03-03loplugin:unuseddefaultparams in basicNoel Grandin9-42/+28
Change-Id: I286efdac6af47a859693fccc71b445915f76945c
2016-03-02tdf#84938 Change average enum for scoped enumbaltasarq2-23/+25
This is a [partial] patch for tdf#84938, involving the substitution of an average enum for a scoped one. Change-Id: I4b3a19914d30a14dec2640355ba392b943e1ddd7 Reviewed-on: https://gerrit.libreoffice.org/22808 Reviewed-by: Noel Grandin <noelgrandin@gmail.com> Tested-by: Noel Grandin <noelgrandin@gmail.com>
2016-02-26tdf#84938 Eliminate B_xxx defines in filefmt.hxx for FileOffset scoped enum.baltasarq2-40/+44
Second step: Make SbiOpenRecord() accept a FileOffset as second parameter This is a [partial] patch The objective is to substitute all apparitions of #defined constants for enum class. The victim here is the series of constants B_xxx that were located in filefmt.hxx and were changed for a FileOffset enum class. Obviously some other files where the type is used must be changed too. Change-Id: I7406bdc8e780ee89802ab6823f9c91c4c9b765c0 Reviewed-on: https://gerrit.libreoffice.org/22697 Reviewed-by: Noel Grandin <noelgrandin@gmail.com> Tested-by: Noel Grandin <noelgrandin@gmail.com>
2016-02-25coverity#1231668 Unchecked return valueCaolán McNamara1-1/+3
Change-Id: I4c83b1290484dabc9d40f970a3a86de5d6dc3928