561 Commits

Author SHA1 Message Date
Katarina Behrens
351dead74b tdf#106529: Revert "tdf#80731 Closing parenthesis is now detected"
This reverts commit 65e294e221e0ad1d37c6667eecb995817ace870d, which
breaks several widely used Basic extensions and hundreds of anonymous
macros that miss closing parenthesis here and there

(cherry picked from commit 660e394b893a045a077ccded263f94a1be03fcf9)

Change-Id: I5d27e6d4e7c8aea3f0762c41ede46e35a5a24aaa
Reviewed-on: https://gerrit.libreoffice.org/35970
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Jenkins <ci@libreoffice.org>
2017-03-31 14:27:57 +00:00
Jens Carl
243b3fa9c4 tdf#39468 Translate German comments
Translate German comments and terms in basic/

Change-Id: I8baf76ea866823a155dfa25c74149dac989c841c
Reviewed-on: https://gerrit.libreoffice.org/35793
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Michael Stahl <mstahl@redhat.com>
2017-03-28 11:22:53 +00:00
Andrea Gelmini
5ad636acc6 Fix typos
Change-Id: Idbf0aa261b829e83d4c08a2e989a4ced871dc6de
Reviewed-on: https://gerrit.libreoffice.org/35616
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Tested-by: Julien Nabet <serval2412@yahoo.fr>
2017-03-26 20:37:59 +00:00
Stephan Bergmann
6291574d94 Remove unused #include <ctype.h>
Change-Id: I8bf3e30687e20151a9e1936e69362abfe9b3a99d
2017-03-23 17:55:31 +01:00
Stephan Bergmann
7778d9f51b Prevent calls to rtl/character.hxx functions with (signed) char arguments
...that would implicitly be sign extended (for plain char only if it is signed),
so non-ASCII char values would trigger the isUnicodeCodePoint assert.

Change-Id: Iaf8024ad509e64525558e882fe3fd078cfb4ea91
Reviewed-on: https://gerrit.libreoffice.org/35523
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-03-22 09:00:57 +00:00
Justin Luth
97caa8a8a0 VBA: allow and ignore compiler directives
Instead of erroring out on this:
 #If Win64 Then
   Declare PtrSafe Function aht_apiGetOpenFileName Lib "comdlg32.dll"
 #Else
   Declare Function aht_apiGetOpenFileName Lib "comdlg32.dll"
 #End If
just treat the # commands as remarks and continue on.

This type of coding will become more common as 64bit versions of
Office require such constructs.

Change-Id: I63bfb8cbe9ad3ef35bab4c041d9d94daa7fbba18
Reviewed-on: https://gerrit.libreoffice.org/34518
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Justin Luth <justin_luth@sil.org>
Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
2017-02-28 02:48:16 +00:00
Justin Luth
51eb2ad7a0 VBA: accept the PtrSafe keyword
64bit MSOffice VBA7 requires the PtrSafe Declare attribute
 #If Win64 Then
   Declare PtrSafe Function aht_apiGetOpenFileName Lib "comdlg32.dll"
 #Else
   Declare Function aht_apiGetOpenFileName Lib "comdlg32.dll"
 #End If

Accept this new keyword to enable compatibility with macros adjusted
to work in a 64bit MSOffice environment.

Change-Id: I9e64cb5339075cdda2ec91e8128fd0a35d458432
Reviewed-on: https://gerrit.libreoffice.org/34519
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Justin Luth <justin_luth@sil.org>
2017-02-27 04:25:45 +00:00
Andrea Gelmini
7bc1c43800 Fix typos/translations, following 04644956e53d
No automatic tools

Change-Id: I3a6d18760f90c4ee02b9380758f97f6fca6c4428
Reviewed-on: https://gerrit.libreoffice.org/30874
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Michael Stahl <mstahl@redhat.com>
2017-02-21 13:34:20 +00:00
Stephan Bergmann
73be3ce38a loplugin:subtlezeroinit: basic
Change-Id: I3d5f157db315fce3492ff6ce88e8ded763af944e
2017-02-21 07:35:12 +01:00
Julien Nabet
89b57084a0 Related tdf#105473: Crash in: ScRangeList::operator[]
fixes this bt:
3  0x00002aaaab314ef2 in __GI___assert_fail (assertion=assertion@entry=0x2aaaaf8dc448 "index >= 0 && static_cast<sal_uInt32>(index) < static_cast<sal_uInt32>(getLength())",
    file=file@entry=0x2aaaaf8ac488 "/home/julien/lo/libreoffice/include/rtl/ustring.hxx", line=line@entry=678,
    function=function@entry=0x2aaaaf8dc800 <rtl::OUString::operator[](int) const::__PRETTY_FUNCTION__> "sal_Unicode rtl::OUString::operator[](sal_Int32) const")
    at assert.c:101
4  0x00002aaaaf810383 in rtl::OUString::operator[] (this=this@entry=0x55555d39c9f8, index=index@entry=0) at /home/julien/lo/libreoffice/include/rtl/ustring.hxx:678
5  0x00002aaaaf822f4e in SbiScanner::NextSym (this=0x55555d39c9d0) at /home/julien/lo/libreoffice/basic/source/comp/scanner.cxx:572
6  0x00002aaaaf82771e in SbiTokenizer::Next (this=this@entry=0x55555d39c9d0) at /home/julien/lo/libreoffice/basic/source/comp/token.cxx:339
7  0x00002aaaaf827d23 in SbiTokenizer::Peek (this=0x55555d39c9d0) at /home/julien/lo/libreoffice/basic/source/comp/token.cxx:266
8  0x00002aaaaf8175d0 in SbiExpression::Unary (this=this@entry=0x55555d43cea0) at /home/julien/lo/libreoffice/basic/source/comp/exprtree.cxx:581
9  0x00002aaaaf8178a4 in SbiExpression::Exp (this=this@entry=0x55555d43cea0) at /home/julien/lo/libreoffice/basic/source/comp/exprtree.cxx:633
10 0x00002aaaaf81792c in SbiExpression::MulDiv (this=this@entry=0x55555d43cea0) at /home/julien/lo/libreoffice/basic/source/comp/exprtree.cxx:647
11 0x00002aaaaf8179b6 in SbiExpression::IntDiv (this=this@entry=0x55555d43cea0) at /home/julien/lo/libreoffice/basic/source/comp/exprtree.cxx:666

Change-Id: Ib56063b3106bd077cda215e34ab763bae1f33c33
Reviewed-on: https://gerrit.libreoffice.org/33933
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Tested-by: Julien Nabet <serval2412@yahoo.fr>
2017-02-05 13:25:13 +00:00
Stephan Bergmann
71511385dd Just pass in OUString directly
Change-Id: Idf7d63672e8b330499e53c1395dedb92d25bb76a
2017-01-27 17:28:27 +01:00
Stephan Bergmann
8c78aa379f Just pass in OUString directly
Change-Id: Id9bd288080fdd5ed4dfaee77b697954ad7bc2458
2017-01-27 17:15:43 +01:00
Noel Grandin
ad694ef65a new loplugin: useuniqueptr: basic
Change-Id: I5a9806e8dd79431f14d6861c8f4d65f828398f07
Reviewed-on: https://gerrit.libreoffice.org/33145
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-01-16 07:30:09 +00:00
Noel Grandin
3a705ab405 OSL_TRACE->SAL in avmedia..canvas
Change-Id: Id9077ea29e7028c12f40abfd4c57756c863e3cd9
2016-12-13 08:14:00 +02:00
Noel Grandin
afabf409aa oops, wasn't supposed to commit that
snuck in with commit 4d2c210c74567d9af6bededf3fae6bfd62406f14
"use early return to simplify flow"

Change-Id: I2a5cbff01c5f40d879d320fd3934bc0856756d37
2016-12-02 13:22:15 +02:00
Noel Grandin
4d2c210c74 use early return to simplify flow
Change-Id: I98201eac2e038c152422bbc6380cfa321ba266df
Reviewed-on: https://gerrit.libreoffice.org/31534
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-12-02 11:17:12 +00:00
Pierre Lepage
379b7ffb68 tdf#80731 Closing parenthesis is now detected (Mid statement and functions).
Change-Id: I5efdb6c3ce71148672a8b76d3f1cc87b0fe04994
Reviewed-on: https://gerrit.libreoffice.org/30593
Tested-by: Julien Nabet <serval2412@yahoo.fr>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-11-30 06:42:48 +00:00
Noel Grandin
b1f8cf3782 loplugin:singlevalfields
Change-Id: I65f96d9cd24572c8d0946acf4d2d45eb3db83a76
Reviewed-on: https://gerrit.libreoffice.org/30476
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-11-02 13:06:37 +00:00
Noel Grandin
f019ee7cf9 loplugin:expandablemethodds in basctl..chart2
Change-Id: I96f565a974fe3e316ae2ab04f8731b8bbfb87993
Reviewed-on: https://gerrit.libreoffice.org/29998
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-10-19 08:07:04 +00:00
Jacek Fraczek
f004aa9951 tdf#89307: Removed SvRef::operator T*()
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-10 08:48:30 +00:00
Andrea Gelmini
8f9af8dd97 Fix typos
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-03 13:43:44 +00:00
Noel Grandin
a2b77b4368 loplugin:singlevalfields in basic..idl
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-16 08:30:26 +00:00
Asela Dasanayaka
057ae1cfca tdf#96505 get rid of "long" integer literals 'L'
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-24 12:19:57 +00:00
Stephan Bergmann
c0ee13464f Avoid OUString::operator[] out-of-bounds assertion when line ends with "&"
Change-Id: I430e1df81a378243b139c654869589f1a75f5897
2016-08-22 16:20:56 +02:00
Arnaud Versini
cb3a00514a BASIC: Use more often std::unique_ptr
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-13 11:47:50 +00:00
Arnaud Versini
f5615df5e8 BASIC: Move SbiParser's destructor to cpp file.
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-08 06:32:32 +00:00
Noel Grandin
e5e7475feb loplugin:countusersofdefaultparams in basctl..basic
Change-Id: I16fac3317ebf55581cb9aaef676a9759de51d695
Reviewed-on: https://gerrit.libreoffice.org/27793
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-08-04 05:46:22 +00:00
Arnaud Versini
8b03ea6555 BASIC: Remove completly useless osl/thread include
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-31 19:42:16 +00:00
Muhammet Kara
d5784e91e9 Improve readability of OUString concatanation in LibPage
, 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-07-03 15:46:58 +00:00
Noel Grandin
cea4c1afdf loplugin:singlevalfields in basic and fix leak
And fix leak in BasicManagerImpl where it would never have freed
the streams.

Change-Id: I1e99c2c6a70a8cac27dd5c86a7042efc3de7a578
Reviewed-on: https://gerrit.libreoffice.org/26632
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-06-27 05:17:31 +00:00
Arnaud Versini
c0d7dfa56c BASIC : Add SbModule::FindMethod
Change-Id: I3418c4a3d24b3b6630d6c80a6c8aa9d4ffb7e73a
Reviewed-on: https://gerrit.libreoffice.org/24346
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-06-12 07:43:03 +00:00
Noel Grandin
f107d45381 Convert SbxClassType to scoped enum
Change-Id: I48afcdd9924d22b52a8db21aa253061e4d38c85b
Reviewed-on: https://gerrit.libreoffice.org/25259
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-05-23 11:49:32 +00:00
Stephan Bergmann
14cd5182c5 Replace fallthrough comments with new SAL_FALLTHROUGH macro
...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-10 16:42:16 +02:00
Krishna Keshav
26d314d2e2 tdf#99589 tolower / toupper - dangerous to Turks ...
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-09 09:30:27 +00:00
Arnaud Versini
e97a8f339a BASIC : Remove an useless static_cast and use make_unique
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-08 12:02:37 +00:00
Arnaud Versini
464348e82d BASIC: SbiParser Remove useless static_cast and indent the code correctly.
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-07 12:01:23 +00:00
Noel Grandin
f3d9aab841 teach passstuffbyref plugin to check for..
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-06 06:48:38 +00:00
Andrea Gelmini
b0388ef109 Fix typo in code
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-01 09:46:58 +00:00
Noel Grandin
8762aa986d clang-tidy modernize-loop-convert in b*
Change-Id: I8ac6eb59e213eafa78e3dc4578738b53e8adef5b
2016-04-21 10:27:17 +02:00
Julien Nabet
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
Stephan Bergmann
45adae8fd6 Avoid reserved identifiers
Change-Id: Ibba1a36d4f3744fa68f7e9d0076c997e076262cb
2016-04-06 08:31:46 +02:00
Stephan Bergmann
f7a3bdf623 Turn SbiOpcode into scoped enum
Change-Id: I75d808dd3a42e57e7f55bad97e24fef65bb62dc6
2016-04-06 08:31:46 +02:00
Stephan Bergmann
7beeced463 Avoid reserved identifiers
Change-Id: I3fbc7cb107bdab770d5ce9ed3ecddb962d2d4666
2016-04-06 08:31:46 +02:00
Caolán McNamara
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
Noel Grandin
bd2bf6bd55 loplugin:unuseddefaultparams in basic
Change-Id: I286efdac6af47a859693fccc71b445915f76945c
2016-03-03 08:11:02 +02:00
Noel Grandin
2d0dab5b15 loplugin:commaoperator in basic/
Change-Id: I320a06e50d032a55d8d5e6354959c12327e319ee
2016-02-22 16:55:11 +02:00
Norbert Thiebaud
42f9b97dfb WaE vs2015 truncation of literal on static_cast
Change-Id: I63a89c50c653145ea49aa34e4e4dd554da66598f
Reviewed-on: https://gerrit.libreoffice.org/22597
Reviewed-by: Norbert Thiebaud <nthiebaud@gmail.com>
Tested-by: Norbert Thiebaud <nthiebaud@gmail.com>
2016-02-22 02:39:34 +00:00
Noel Grandin
2087484c65 use consistent #define checks for the Windows platform
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>
2016-02-17 11:33:57 +00:00
Arnaud Versini
f17a4694b0 BASIC : use std::unique_ptr for storing SbiExprList
Change-Id: I37f2a1c837c6742cf6d403962d2730b5e80004ec
Reviewed-on: https://gerrit.libreoffice.org/22345
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
2016-02-17 07:08:59 +00:00
Chris Sherlock
a238b1f8d3 Remove excess newlines
A ridiculously fast way of doing this is:

for i in $(pcregrep -l -M -r --include='.*[hc]xx$' \
  --exclude-dir=workdir --exclude-dir=instdir '^
{3,}' .)
do
    perl -0777 -i -pe 's/^
{3,}/

/gm' $i
done

Change-Id: Iebb93eccbee9e4fc5c4380474ba595858a27ac2c
Reviewed-on: https://gerrit.libreoffice.org/22224
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com>
2016-02-09 08:18:05 +00:00