305 Commits

Author SHA1 Message Date
Jochen Nitschke
da56de9ac4 remove type decorations on char literals
they are only needed where type deduction fails.
left them in defines for now.

Change-Id: I7f002dd6bc7acc083c73b6c64076de6dd28d0b09
Reviewed-on: https://gerrit.libreoffice.org/35893
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-03-30 12:21:40 +00:00
Tor Lillqvist
013d9789c7 Drop :: prefix from std in [a-b]*/
Change-Id: I0422aaf39bbce889c95ed9a81a0784cb03a1badd
Reviewed-on: https://gerrit.libreoffice.org/34320
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Tor Lillqvist <tml@collabora.com>
2017-02-15 21:50:23 +00:00
Tor Lillqvist
b21ba53be7 loplugin:staticmethods
Change-Id: I46d24d74e48806368f1726688747f0872100c438
2017-02-09 12:44:14 +02:00
Caolán McNamara
49c007b394 split getApplicationBasicManager into get and getOrCreate
Change-Id: I8e35594104ba85470eda387bc227e88bf77ccffd
2017-02-09 09:22:31 +00:00
Noel Grandin
bcad173faa Reapply "create ErrorHandlerFlags scoped enum for error handling flags""
This effectively reverts commit 32cae6a2eaa41568888df9c8fc5605debd8d704a.

Change-Id: I15bb0a5c4acaeee6d47dd93a71601d9687d701bc
Reviewed-on: https://gerrit.libreoffice.org/34028
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-02-09 05:47:36 +00:00
Michael Stahl
653e181fb8 Revert "remove ugly operator* in DynamicErrorInfo"
This reverts commit b5e3f8a5fa98a249ecd50021c33cf2a5c7a3b4fc.

The problem is this:

==24217== Conditional jump or move depends on uninitialised value(s)
==24217==    at 0x29A25FCE: SfxObjectShell::SetError(unsigned int, rtl::OUString const&) (objmisc.cxx:220)
==24217==    by 0x29A35E6E: SfxObjectShell::ImportFrom(SfxMedium&, com::sun::uno::Reference<com::sun::text::XTextRange> const&) (objstor.cxx:2300)
==24217==    by 0x29A3705C: SfxObjectShell::DoLoad(SfxMedium*) (objstor.cxx:765)
==24217==    by 0x29A6BC48:
SfxBaseModel::load(com::sun::uno::Sequence<com::sun:🫘:PropertyValue> const&) (sfxbasemodel.cxx:1802)

The commit is bogus because it introduces a
DynamicErrorInfo::GetErrorCode(), which overloads
ErrorInfo::GetErrorCode(), which is used at least in
DynamicErrorInfo_Impl::RegisterEDcr() and used to return a constructor
argument of DynamicErrorInfo but now returns pImpl->lErrId,
which is what this statement is trying to initialize.

Ultimately this causes my clang+ASAN build to fail because the
uninitialized error code happens to be detected as a mere Warning:

Test name: testMathMalformedXml::Import
assertion failed
- Expression: !xComponent.is()
- loading succeeded: sw/qa/extras/ooxmlimport/data/math-malformed_xml.docx

Change-Id: I9141144e0bc356ee54279948f2fce036d1831a86
2017-02-07 23:02:57 +01:00
Michael Stahl
32cae6a2ea Revert "create ErrorHandlerFlags scoped enum for error handling flags"
This reverts commit 05e78bde26d8b8b257ed22a0ce20c5b386a629d1.

Depends on the other commit that needs reverting
2017-02-07 23:02:28 +01:00
Noel Grandin
05e78bde26 create ErrorHandlerFlags scoped enum for error handling flags
Change-Id: I30c80979c87bad7bc98f36a158c31c88d80d1caf
Reviewed-on: https://gerrit.libreoffice.org/33991
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-02-07 12:04:35 +00:00
Noel Grandin
b5e3f8a5fa remove ugly operator* in DynamicErrorInfo
I can see why you'd want to hide this horrible tunnelling of
information with objects registering themselves in a global list.
Urrgh.

Change-Id: Ib151a0d2d5a4508dc456e52883e488ce56d9a095
Reviewed-on: https://gerrit.libreoffice.org/33984
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-02-07 09:12:58 +00:00
Noel Grandin
83721f4365 makeAny->Any in basctl..chart2
Change-Id: Ief1cdffbfc59ab4e35ac945d020772ff84c50d61
Reviewed-on: https://gerrit.libreoffice.org/33867
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-02-03 08:50:50 +00:00
Noel Grandin
4978328534 convert method names in tools::SvRef to be more like our other..
reference classes, uno::Reference and rtl::Reference.

Specifically rename Is()->is() and Clear()->clear().

Change-Id: Icb7e05e2d09cb9977121508b837ba0961dabb4ae
Reviewed-on: https://gerrit.libreoffice.org/33576
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-02-02 08:02:54 +00:00
Stephan Bergmann
e57ca02849 Remove dynamic exception specifications
...(for now, from LIBO_INTERNAL_CODE only).  See the mail thread starting at
<https://lists.freedesktop.org/archives/libreoffice/2017-January/076665.html>
"Dynamic Exception Specifications" for details.

Most changes have been done automatically by the rewriting loplugin:dynexcspec
(after enabling the rewriting mode, to be committed shortly).  The way it only
removes exception specs from declarations if it also sees a definition, it
identified some dead declarations-w/o-definitions (that have been removed
manually) and some cases where a definition appeared in multiple include files
(which have also been cleaned up manually).  There's also been cases of macro
paramters (that were used to abstract over exception specs) that have become
unused now (and been removed).

Furthermore, some code needed to be cleaned up manually
(avmedia/source/quicktime/ and connectivity/source/drivers/kab/), as I had no
configurations available that would actually build that code.  Missing @throws
documentation has not been applied in such manual clean-up.

Change-Id: I3408691256c9b0c12bc5332de976743626e13960
Reviewed-on: https://gerrit.libreoffice.org/33574
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-01-26 12:54:43 +00:00
Noel Grandin
5145f60cc9 loplugin: unnecessary destructor: basctl..codemaker
Change-Id: Iadcfa9bc4fe9efb8d24d6d6afaf2b9b3def0bc3c
Reviewed-on: https://gerrit.libreoffice.org/33452
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-01-24 04:59:44 +00:00
Noel Grandin
3a705ab405 OSL_TRACE->SAL in avmedia..canvas
Change-Id: Id9077ea29e7028c12f40abfd4c57756c863e3cd9
2016-12-13 08:14:00 +02:00
Noel Grandin
a66731982e convert SFX_HINT to scoped enum
Notes

(*) In SC, BULK_DATACHANGED was or'ed into the hint id. Replaced with a
dynamic_cast check.

(*) In SC, removed the hint id field from ScIndexHint, no point in
storing the hint id twice

(*) Fold the SfxStyleSheetHintId enum into the new SfxHintId enum, no
point in storing two different hint ids

(*) In some cases, multiple #define's used to map to the same SFX_HINT
value (notably the SFX_HINT_USER* values). I made all of those separate
values.

Change-Id: I990e2fb587335ebc51c9005588c6a44f768d9de5
Reviewed-on: https://gerrit.libreoffice.org/31751
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-12-08 12:35:09 +00:00
Noel Grandin
bfde4866e0 convert DecodeMechanism to scoped enum
Change-Id: I5c56634b1bca8e37fa73d02d2428645301b6c547
2016-12-05 12:49:02 +02:00
Noel Grandin
bb674aa550 loplugin:unusedfields
Change-Id: Id2dbbf384637223db3d334d95332251832918003
Reviewed-on: https://gerrit.libreoffice.org/30927
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-11-17 13:10:42 +00:00
Stephan Bergmann
7596535983 Simplify some dynamic/static_casts
...that are unnecessarily complicated after the "remove tools/rtti.hxx" commits

Change-Id: I570751a1f81c547b50248fe4e2824c5c7c5dd624
2016-10-18 16:53:18 +02:00
Jacek Fraczek
398d641664 tdf#89307: Removed T* SvRef::opeartor &()
Usage has been replaced with SvRef::get() or removed where applicable.

Change-Id: I49f108910b668466134c40940b53fc3ab2acd816
Reviewed-on: https://gerrit.libreoffice.org/29780
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2016-10-18 09:27:56 +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
Eike Rathke
7d8196ea2f perf: eliminate SfxSimpleHint and move to SfxHint, tdf#87101 related
There were over 150 places in *::Notify() functions that did some
dynamic_cast<SfxSimpleHint*> of which ~98% were unnecessary because the
base class SfxHint passed was an SfxSimpleHint anyway. dynamic_cast
operations come with quite some cost, so avoid if possible. Specifically
for ScFormulaCell::Notify() that created a bottleneck in scenarios where
cells were notified that already handled a previous notification. In
mass operations doing the dynamic_cast before it could be decided
whether having to act on it or not this made 2/3 of all time spent in
the Notify() call.

To get rid of that rename/move SfxSimpleHint to SfxHint and let classes
derive from SfxHint instead of SfxSimpleHint. This comes only with a
slight cost that an additional sal_uInt32 is transported in such hints,
initialized to 0, but this is neglectable compared to the huge gain.

For the rare cases where a Notify() actually expects both, an SfxHint
(formerly SfxSimpleHint) and a derived hint, this changed order of the
dynamic_cast involved so the simple SfxHint::GetId() is handled last.
Modules using such combinations can further optimize by treating the
simple SfxHint::GetId() first once verified that none of the other
derived hints use an ID not equal to zero respectively none of the ID
values the simple hint uses.

Change-Id: I9fcf723e3a4487ceb92336189d23a62c344cf0ce
Reviewed-on: https://gerrit.libreoffice.org/29205
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: Eike Rathke <erack@redhat.com>
2016-09-23 15:14:03 +00:00
Michael Stahl
b647996a9b replace sal_Size with std::size_t (or sal_uInt64 for SvStream pos)
... except in include/rtl, include/sal, include/uno, where sal_Size is
retained for compatibility, and where callers of rtl functions pass in
pointers that are incompatible on MSVC.

Change-Id: I8344453780689f5120ba0870e44965b6d292450c
2016-09-15 12:01:11 +02:00
Jochen Nitschke
c53912e526 cppcheck:assertWithSideEffect
Change-Id: Ib3d2bb85c925a4208a9e2f0032857a11258c3bb2
Reviewed-on: https://gerrit.libreoffice.org/28540
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Jochen Nitschke <j.nitschke+logerrit@ok.de>
2016-08-31 12:19:05 +00:00
Jochen Nitschke
33b38082ca put StreamMode masks in scope of enum class
Change-Id: I77682f7e289a59b986bb84edf014029a20266470
Reviewed-on: https://gerrit.libreoffice.org/28420
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
2016-08-27 12:06:15 +00:00
Arnaud Versini
31186a1c71 BASIC: Remove useless BasicManagerImpl streams.
Change-Id: Iac5683afd20d8a2b7bc43474580bd1d05ace562b
Reviewed-on: https://gerrit.libreoffice.org/27934
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-08-08 06:33:45 +00:00
Stephan Bergmann
0b424c2506 loplugin:passstuffbyref also for {css::uno,rtl}::Reference
Change-Id: I614d91e7e4a686613dc0cbe1b9f4fabb978ffc77
2016-07-07 18:59:55 +02: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
Muhammet Kara
fafb309d2e prefer OUStringBuffer to concatenating OUString in a loop
And improve OUString readability and efficiency.
See: https://goo.gl/jsVAwy:

Change-Id: I8d847b1ca3cde7cb8733d6f8a649612745cf6aae
Reviewed-on: https://gerrit.libreoffice.org/26511
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-06-21 06:43:57 +00: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
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
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
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
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
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
Noel Grandin
311bc1fc8b loplugin:passstuffbyref in basic
Change-Id: Ie93b33502325f00ba95ab168a445a347148f9edd
2016-04-13 13:27:51 +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
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
Wastack
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
Noel Grandin
cc091b0343 loplugin:constantparam in basic
Change-Id: I5b49406535c1ec95e47fe237a23184a499b875e5
2016-03-09 10:07:46 +02:00
Noel Grandin
bd2bf6bd55 loplugin:unuseddefaultparams in basic
Change-Id: I286efdac6af47a859693fccc71b445915f76945c
2016-03-03 08:11:02 +02: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
Noel Grandin
4c411636d9 sequence->vector in basic
Change-Id: Ic42f7218bda81effe870d950f666ba7653d60c66
Reviewed-on: https://gerrit.libreoffice.org/22177
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
2016-02-08 12:31:10 +00:00
Andrea Gelmini
534b2a4b58 Fix typos
Change-Id: Ice72f8d9971e15dd6ef365e64cd567b8581a92d3
Reviewed-on: https://gerrit.libreoffice.org/21797
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
2016-02-05 06:48:38 +00:00
Noel Grandin
1ef9f3988e unnecessary use of OUString constructor
Change-Id: Idd31b0a53c8318af69bbcd32f6798721ec8eb8e1
Reviewed-on: https://gerrit.libreoffice.org/21945
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-01-31 12:04:02 +00:00
Arnaud Versini
1ae5ceccb8 BASIC : Remove useless methods in StarBasic
Change-Id: I9e8ce92b967ee9c9485b7af15280f6a212ff599d
Reviewed-on: https://gerrit.libreoffice.org/21498
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-01-16 17:06:26 +00:00
Michael Stahl
9694a0edfe basic: coverity#1348466 checked return
Kind of unnecessary but let's hope it shuts up coverity.

Change-Id: I4903c9df788ce5fb9648c5fd68627ff21362828f
2016-01-15 13:03:09 +01:00