Commit Graph

3894 Commits

Author SHA1 Message Date
e8fd5a07ec update loplugin stylepolice to check local pointers vars
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-26 10:55:58 +00:00
8762aa986d clang-tidy modernize-loop-convert in b*
Change-Id: I8ac6eb59e213eafa78e3dc4578738b53e8adef5b
2016-04-21 10:27:17 +02:00
5abc669599 new plugin stylepolice
check for local variables which follow our member field naming
convention, which is highly confusing

Change-Id: Idacedf7145d09843e96a584237b385f7662eea10
2016-04-21 08:32:47 +02:00
da50c790a7 loplugin:salbool: Automatic rewrite of sal_False/True
Change-Id: Ib91f20761167ab78b68813d8877dceea5fef801f
2016-04-20 17:25:35 +02:00
a7e23e7f7b BASIC : Partially revert SbxArray simplification.
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-19 07:41:48 +00:00
789055bc2a clang-tidy performance-unnecessary-copy-initialization
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-18 07:37:31 +00:00
150ac9cf05 clean-up: unused using declarations and includes
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-18 07:25:24 +00:00
0fa6c88007 BASIC : Simplify SbxArray
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-18 07:20:57 +00:00
666dc67eaf Remove needless typedef from basic/qa/cppunit/basic_coverage.cxx
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-18 07:16:41 +00:00
2f3dcc44ce tdf#99357: Basic, return if .with pNode null
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-17 13:47:07 +00:00
494bd08c48 remove tools/solarmutex.hxx
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-15 08:09:01 +00:00
311bc1fc8b loplugin:passstuffbyref in basic
Change-Id: Ie93b33502325f00ba95ab168a445a347148f9edd
2016-04-13 13:27:51 +02:00
5304b94878 Related tdf#99089: avoid second crash
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-13 07:11:33 +00:00
ea7b57272c Avoid reserved identifier
Change-Id: Ic59b23de2c11e8a0a86c3711a4507cd76e07896f
2016-04-12 20:03:47 +02:00
b2706fcf9c Avoid reserved identifier
Change-Id: I0ed8754bb06328b61a41079a4f446d8dd2b61bb7
2016-04-12 15:50:19 +02:00
d29c682259 Avoid reserved identifiers
Change-Id: If64f146fd9c6417ed16d459cef39b3a2d47bfb4d
2016-04-12 15:50:19 +02:00
4c7ec9f112 cleanup: remove unused com/sun/star/uno includes
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-12 06:38:26 +00:00
d036e4df85 BASIC: Remove useless static_cast from basmgr.cxx
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-11 12:57:56 +00:00
a2f91994df Avoid reserved identifier
Change-Id: I6dfb2961adeb412405c58e0a0b51e130cbd3e0c3
2016-04-11 14:32:29 +02:00
f088a556ca Remove an useless check I had added
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-11 10:15:51 +00:00
f678b82f0e clang-tidy performance-unnecessary-value-param in basic
Change-Id: I997213ca28efc2df04d454ffaf3c81c9cbad09ac
2016-04-11 11:38:57 +02:00
f3dabe7507 make GetGlobalUNOConstant and GetUNOConstant take an OUString
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-11 06:20:10 +00:00
43109b751b tdf#99089: avoid some crashes in Basic
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-10 08:17:56 +00:00
ba95e61314 fix bug in SbxArray::Merge
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-07 21:03:30 +00:00
c83173940a Avoid reserved identifier
Change-Id: I2f8dc470100e91841eebbe1e3b02a3d31ab3a535
2016-04-06 08:31:46 +02:00
45adae8fd6 Avoid reserved identifiers
Change-Id: Ibba1a36d4f3744fa68f7e9d0076c997e076262cb
2016-04-06 08:31:46 +02:00
f7a3bdf623 Turn SbiOpcode into scoped enum
Change-Id: I75d808dd3a42e57e7f55bad97e24fef65bb62dc6
2016-04-06 08:31:46 +02:00
7beeced463 Avoid reserved identifiers
Change-Id: I3fbc7cb107bdab770d5ce9ed3ecddb962d2d4666
2016-04-06 08:31:46 +02:00
c1e4d402c6 BASIC : Use a vector to store the argv stack
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-04 19:44:19 +00:00
8c2f2e1dd7 tdf#94306 replace boost::noncopyable in ..
.. 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-04 06:54:36 +00:00
c20cc7e79b tdf#97499 Fixed containers parameters clearing #4
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-04 05:49:06 +00:00
362ab03eb2 tdf#97499 Fixed containers parameters clearing #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-04 05:44:36 +00:00
917e3656e9 BASIC : Use a vector to store the go sub stack.
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-03 17:34:04 +00:00
0b8e5ca5a2 tdf#97966 Drop 'static' keywords
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-04-01 06:44:05 +00:00
402572e25c loplugin:constantparam in basic
Change-Id: I6831cb8628eed76db35070934f62dccb1345ba12
2016-03-23 11:22:34 +02:00
a62ad21f98 BASIC: Calling SbxDimArray::Clear should also call SbxArray.
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-20 13:45:06 +00:00
bb3930bb91 BASIC : Use std::vector in SbiRuntime to save references
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-20 12:56:04 +00:00
8ca50d20c1 loplugin:constantparam in tools
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-17 06:09:42 +00:00
4530bc5079 coverity#1355498 assume Unchecked return value is deliberate
Change-Id: I8b0597a5ab87d4d4529e3ccc097902486a41e957
2016-03-14 21:00:35 +00:00
60b1c95cc4 Extract Directories from BootstrapFixtureBase
(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-10 08:04:40 +00:00
a139320da2 deref of null
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-09 15:16:07 +00:00
cc091b0343 loplugin:constantparam in basic
Change-Id: I5b49406535c1ec95e47fe237a23184a499b875e5
2016-03-09 10:07:46 +02:00
5819268ad7 tdf#94306 Replace boost::noncopyable with plain C++11 deleted copy ctors
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-08 16:10:46 +00:00
29cb1f1923 Remove ancient StarPortal leftovers
No UNO bridge has a "user" token in its description anyway, so
needsSecurityRestrictions always returned false.

Change-Id: Ibc3aa25212a2e8b245c13578fa29582be42791e6
2016-03-08 15:06:39 +01:00
6a351c5cf9 basic: tdf#87530 if a new password is set, must set mbLoadedSource flag
... so that the library is stored (and encrypted), and not copied
unencrypted from source storage.

Change-Id: I9546087ec6f07007aa1ec377d2e959f2bae99a38
2016-03-07 12:05:32 +01:00
aeb4391636 basic: tdf#87530 don't copy storage that doesn't exist
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-07 12:05:32 +01:00
472d900e81 tdf84938 Replaced Sb_Attr_ defined constants with enum class in runtime.hxx
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-07 09:06:12 +00:00
37a6bafea8 loplugin:unuseddefaultparam in various
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-07 05:56:59 +00:00
bd2bf6bd55 loplugin:unuseddefaultparams in basic
Change-Id: I286efdac6af47a859693fccc71b445915f76945c
2016-03-03 08:11:02 +02:00
d9dacecd90 tdf#84938 Change average enum for scoped enum
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-03-02 12:42:24 +00:00