3700 Commits

Author SHA1 Message Date
Stephan Bergmann
9c6a58f8c4 Clean up uses of Any::getValue() in basic
Change-Id: Ice269eae6b0278d5e089d973aae72b3f871c1272
2016-06-14 16:02:55 +02:00
Noel Grandin
272a8afa60 convert more DBG_ASSERT(false to SAL_WARN
Change-Id: Ie52f28f28c67a91c4d3d4517d5c6a466890c7a55
Reviewed-on: https://gerrit.libreoffice.org/26195
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-06-12 18:10:44 +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
Stephan Bergmann
4d49c9601c Let loplugin:passstuffbyref also look at fn defn not preceded by any decl
Change-Id: I752bc96d2d521d790e919283cabb14b6526626f4
2016-06-08 17:14:34 +02:00
Michael Stahl
62d270116b tools: rename SvStream::Read/Write to ReadBytes/WriteBytes
Change-Id: Ib788a30d413436aa03f813aa2fddcbc4d6cd2f9a
Reviewed-on: https://gerrit.libreoffice.org/25972
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Michael Stahl <mstahl@redhat.com>
2016-06-06 18:09:11 +00:00
Xisco Fauli
0216b8dc61 tdf#89329: use unique_ptr for pImpl in sbxvar
Change-Id: I74734c34e72ba5d508830dbcff88f0d3b93a0766
Reviewed-on: https://gerrit.libreoffice.org/25742
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-06-03 10:25:36 +00:00
Noel Grandin
f3c1d240bd loplugin:constantparams
Change-Id: Ib162ba9297b9d900ea42c7e5216e152d3e58a361
Reviewed-on: https://gerrit.libreoffice.org/25769
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-06-03 09:08:42 +00:00
Caolán McNamara
9a0fd9c7f4 Resolves: tdf#93386 crash when closing a Database with macro editor open
Change-Id: Id3ecee744cb10f539f2b57e83a4b6e4c7744d3d5
2016-05-31 17:33:52 +01:00
Noel Grandin
0b23eec200 teach refcounting clang plugin about uno::Reference
uno::Reference is only allowed to used with classes that have a
::static_type member.
So convert all those places to rtl::Reference.

Maybe we need some LIBO_INTERNAL_ONLY constructors on rtl::Reference and
uno::Reference to make this a little smoother?

Change-Id: Icdcb35d71ca40a87b1dc474096776412adbfc7e3
Reviewed-on: https://gerrit.libreoffice.org/25516
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-05-31 06:25:45 +00:00
Stephan Bergmann
e630df7853 Just use Any::operator <<= for sal_Unicode values
...now that sal_Unicode no longer clashes with sal_uInt16 on any platform (in
LIBO_INTERNAL_ONLY code), after e16fa715c43dcdf836ce8c400b6d54eae87b627d "Handle
wchar_t as native C++11 type on windows"

Change-Id: Id423dd6235bf14823fa5611b804c0974edbe64b3
2016-05-30 14:31:24 +02:00
Noel Grandin
850a8d27ca Convert GRAPHIC to scoped enum
Change-Id: I1fd09a729cbda00f99841532e0dd3fa66bce7bea
Reviewed-on: https://gerrit.libreoffice.org/25534
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-05-27 12:59:23 +00:00
Xisco Fauli
132f7b2a8c tdf#89329: use unique_ptr for pImpl in basmgr
Change-Id: I2d6c6b997155183b058872db354de1b407998d3a
Reviewed-on: https://gerrit.libreoffice.org/25472
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-05-26 07:46:38 +00:00
Andrea Gelmini
2af018e4dd Fix typos
Change-Id: I860cc4aa04b4e5cd1437b2f24176ee2ccdec3266
Reviewed-on: https://gerrit.libreoffice.org/25420
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
2016-05-25 09:50:55 +00:00
Caolán McNamara
fef6bb7af2 Resolves: tdf#93474 crash on importing a macro library
its a SfxLibrary which is not a XLibraryContainer

(a SfxLibraryContainer is however)

I think the issue is simply an empty name making code go down the container
rather than library route.

Change-Id: Ib0245d402fe375ac26ab9f2b14fe708b2a34a7a7
2016-05-24 19:09:51 +01: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
Noel Grandin
d4d2fc2479 clang-tidy modernize-make-unique
Change-Id: I550bb69ddcef69906027516ccde62cf8e87c295b
Reviewed-on: https://gerrit.libreoffice.org/25138
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-05-19 08:33:10 +00:00
Noel Grandin
2c8fe2e737 update unusedmethods plugin to deal with constructors
and fix the operator< implementations in some of the other
plugins too.

Change-Id: Ie5631e0cdc8d2a994ad2af2533cdb558a6cfc035
Reviewed-on: https://gerrit.libreoffice.org/25057
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-05-18 10:03:44 +00:00
Andrea Gelmini
a9ff36a1e9 Fix typos
Change-Id: If7262e114b5b4cd40e9c0a8929940199ea747595
Reviewed-on: https://gerrit.libreoffice.org/25025
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: jan iversen <jani@documentfoundation.org>
2016-05-16 06:18:47 +00:00
Stephan Bergmann
bdacf96e3a Add SAL_FALLTHROUGH, where apparently appropriate
Change-Id: Id6e230d026184ab243e994a17515f2e5539d3646
2016-05-10 17:08:02 +02: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
Noel Grandin
58a32075ca use Any constructor instead of temporaries
Change-Id: Iffb82a2cee1a28d89eeea2b905aaa14086ee475a
2016-05-04 12:39:40 +02:00
Stephan Bergmann
6e70103da0 While at it, delete Any functions on sal_Bool*
(at least for LIBO_INTERNAL_ONLY), to help further reduce the occurrences of
sal_Bool across the code base

Change-Id: I70654a0cb56655984c717b7b894f26c9ab47536e
2016-05-04 11:59:23 +02: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
Andrea Gelmini
d15163eceb Fix typos
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-05-01 09:46:27 +00:00
Noel Grandin
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
Noel Grandin
8762aa986d clang-tidy modernize-loop-convert in b*
Change-Id: I8ac6eb59e213eafa78e3dc4578738b53e8adef5b
2016-04-21 10:27:17 +02:00
Noel Grandin
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
Stephan Bergmann
da50c790a7 loplugin:salbool: Automatic rewrite of sal_False/True
Change-Id: Ib91f20761167ab78b68813d8877dceea5fef801f
2016-04-20 17:25:35 +02:00
Arnaud Versini
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
Noel Grandin
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
Jochen Nitschke
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
Arnaud Versini
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
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
Noel Grandin
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
Noel Grandin
311bc1fc8b loplugin:passstuffbyref in basic
Change-Id: Ie93b33502325f00ba95ab168a445a347148f9edd
2016-04-13 13:27:51 +02:00
Julien Nabet
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
Stephan Bergmann
b2706fcf9c Avoid reserved identifier
Change-Id: I0ed8754bb06328b61a41079a4f446d8dd2b61bb7
2016-04-12 15:50:19 +02:00
Stephan Bergmann
d29c682259 Avoid reserved identifiers
Change-Id: If64f146fd9c6417ed16d459cef39b3a2d47bfb4d
2016-04-12 15:50:19 +02:00
Jochen Nitschke
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
Arnaud Versini
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
Stephan Bergmann
a2f91994df Avoid reserved identifier
Change-Id: I6dfb2961adeb412405c58e0a0b51e130cbd3e0c3
2016-04-11 14:32:29 +02:00
Julien Nabet
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
Noel Grandin
f678b82f0e clang-tidy performance-unnecessary-value-param in basic
Change-Id: I997213ca28efc2df04d454ffaf3c81c9cbad09ac
2016-04-11 11:38:57 +02:00
Noel Grandin
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
Julien Nabet
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
Noel Grandin
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