Commit Graph

817 Commits

Author SHA1 Message Date
Stephan Bergmann
7a10def632 loplugin:unnecessaryoverride (dtors) in cppuhelper
Change-Id: Ia23b1fdf126fc57ce929feef60e57b64c782fb50
2016-11-28 14:15:09 +01:00
Noel Grandin
5c2c2d8dc4 loplugin:expandablemethods in comphelper..cppuhelper
Change-Id: I9d5487af4729bd3ee4f6450092e4b77f74a12e6d
Reviewed-on: https://gerrit.libreoffice.org/30717
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-11-10 06:51:53 +00:00
Stephan Bergmann
d2615f96ac Improve some error reporting
Change-Id: Ibfdb0eeebec785438d46a0e8e6e9f4c847bfb807
2016-11-02 10:33:49 +01:00
Jochen Nitschke
d1ea6ecda6 replace <<= with assign for <<= with rhs Any
found by deleting specialization of '<<=' template

Change-Id: I253f15177ab20fd3ef9baf4158da8c662cb47e6c
Reviewed-on: https://gerrit.libreoffice.org/29956
Reviewed-by: Jochen Nitschke <j.nitschke+logerrit@ok.de>
Tested-by: Jochen Nitschke <j.nitschke+logerrit@ok.de>
2016-10-18 19:16:44 +00:00
Stephan Bergmann
2b32603793 clang-cl loplugin: cppuhelper
Change-Id: I03d082bb6e403bda0028286d89e22006578da4a8
Reviewed-on: https://gerrit.libreoffice.org/29873
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2016-10-16 14:19:23 +00:00
Stephan Bergmann
4f86b7a86c cid#1371142: Move semantics for css::uno::WeakReferenceHelper
Change-Id: I442b2d8061bd7d50cbf832b345a7a63461e26224
2016-09-19 12:40:51 +02:00
Stephan Bergmann
91dd2db17b loplugin:override: No more need for the "MSVC dtor override" workaround
The issue of 362d4f0cd4 "Explicitly mark
overriding destructors as 'virtual'" appears to no longer be a problem with
MSVC 2013.

(The little change in the rewriting code of compilerplugins/clang/override.cxx
was necessary to prevent an endless loop when adding "override" to

  OOO_DLLPUBLIC_CHARTTOOLS    virtual ~CloseableLifeTimeManager();

in chart2/source/inc/LifeTime.hxx, getting stuck in the leading
OOO_DLLPUBLIC_CHARTTOOLS macro.  Can't remember what that
isAtEndOfImmediateMacroExpansion thing was originally necessary for, anyway.)

Change-Id: I534c634504d7216b9bb632c2775c04eaf27e927e
2016-09-13 13:19:22 +02:00
Stephan Bergmann
d1c0a77ed1 getFactory only called with nullptr "key" argument
Change-Id: I5148e1902cb3c1d2bb87b623dfd843ccadf6c430
2016-07-11 17:27:23 +02:00
Otto Kekäläinen
428e23f4f7 Fix some spelling errors in comments and strings
Change-Id: Iecd6b5e13d6be14651f77d8e37f01117ba15a11e
Reviewed-on: https://gerrit.libreoffice.org/26883
Reviewed-by: jan iversen <jani@documentfoundation.org>
Tested-by: jan iversen <jani@documentfoundation.org>
2016-07-04 06:11:36 +00:00
Michael Stahl
131e604073 cppuhelper: fix use-after-free race in OWeakConnectionPoint
OWeakObject::m_pWeakConnectionPoint is returned from
OWeakObject::queryAdapter(), and stored in
OWeakRefListener::m_xWeakConnectionPoint.

This is cleared in OWeakRefListener::dispose(), called from
OWeakConnectionPoint::dispose(), called from
OWeakObject::disposeWeakConnectionPoint(), but it can happen that
another thread is in WeakReferenceHelper::get() and has copied
m_xWeakConnectionPoint onto the stack before the OWeakObject is
released and deleted, then calls OWeakConnectionPoint::queryAdapted()
after it is released, accessing the dead m_pObject.

Change-Id: I7782e6fb7e07f5a48cf7064115217376714ba8e8
2016-06-17 22:13:24 +02:00
Michael Stahl
debe788bcf cppuhelper: WeakReference isn't thread-safe
... but its documentation claims that it is, which is partially
misleading, so fix both the documentation and the data race in
WeakReferenceHelper::clear().

This actually crashed in clear() in the multi-threaded ZipPackage code
on exporting the bugdoc from tdf#94212, presumably because clear()
races against OWeakRefListener::dispose().

Change-Id: I85665c11b8157e90d15e8263758e24e66efeb86c
2016-06-17 15:10:37 +02:00
Noel Grandin
80c874dc87 remove "object is disposed" warning in OBroadcastHelperVar::removeListener
doesn't add anything of value.

Change-Id: Ie2dea7c43570640284771c992d0072ab61de425e
Reviewed-on: https://gerrit.libreoffice.org/25871
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
2016-06-08 06:40:25 +00:00
Noel Grandin
4722192098 Convert XmlReader::Result to scoped enum
Change-Id: I6a0d1dcf5ae51d2ac08aacdfec50865f93e51c21
Reviewed-on: https://gerrit.libreoffice.org/25365
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-05-25 11:59:08 +00:00
Noel Grandin
6c419129f2 optimise references list handling in OWeakConnectionPoint some more
After my commit	1e063e8b "optimise references list handling in
OWeakConnectionPoint"

Reduce scope of locking, and copy a the performance trick from
OInterfaceContainerHelper.

Change-Id: Idc218e9d4edf45f8c37c7e517d1a26821800448b
Reviewed-on: https://gerrit.libreoffice.org/25406
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Michael Stahl <mstahl@redhat.com>
2016-05-24 19:46:06 +00:00
Noel Grandin
6bda2bf6fe Convert XmlReader::Text to scoped enum
Change-Id: I4741b13fcf887a95b85886cb41f8236e128e81a2
Reviewed-on: https://gerrit.libreoffice.org/25364
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-05-24 06:54:19 +00:00
Markus Mohrhard
389d8db4d9 add some spaces to make it easier to read
Change-Id: I2eb1c74bc0d91d3a12a66989b696fccbf1d2825e
Reviewed-on: https://gerrit.libreoffice.org/25117
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
2016-05-18 22:46:49 +00:00
Noel Grandin
1e063e8b7e optimise references list handling in OWeakConnectionPoint
avoid the expensive sequence copying and deleting in
OInterfaceContainerHelper.

Change-Id: I00867b8a25b27d2a0b0babdf41a082c014e0e07d
Reviewed-on: https://gerrit.libreoffice.org/24949
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-05-16 08:20:05 +00:00
Stephan Bergmann
9ea219dc5a loplugin:passstuffbyref
Change-Id: I5a98cea6402b0a02c0e7c329d07d05759a74ec95
2016-05-12 14:23:23 +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
Stephan Bergmann
0c2d6574c6 Remove ancient, dead CONTEXT_DIAG code
Change-Id: I24123a54fe847b35f6b3674e2caa9bfb4b339d4a
2016-04-27 14:28:59 +02:00
Stephan Bergmann
11ba28a47d Remove ancient OSL_DEBUG_LEVEL printf
...alerting about something that is not too exciting anyway

Change-Id: I7596f14e52a0272762f923882f5f92fc3ac1ddf4
2016-04-27 14:26:51 +02:00
Noel Grandin
e1af7f0c43 clang-tidy modernize-loop-convert in c*
Change-Id: I77d2548f8be97792660761e6156cd24734a95aaf
2016-04-21 11:03:55 +02:00
Stephan Bergmann
918faa4a16 loplugin:salbool: Automatic rewrite of sal_False/True
Change-Id: If965f73934c182a1c96d9fdca6f395c256f6b259
2016-04-20 17:25:38 +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
Stephan Bergmann
5c36205847 Fix indentation
Change-Id: Ia043e0a5b7ec9623f6575a83374720be1f3b6b83
2016-04-11 11:03:48 +02:00
Julien Nabet
297fd836b7 Typo: multible->multiple
Change-Id: I1c61841be58d49132ac3c69a6b227d75e829f769
Reviewed-on: https://gerrit.libreoffice.org/23972
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2016-04-10 22:01:01 +00:00
Julien Nabet
efa2698299 Typo: rubust->robust
Change-Id: Icc6bef40a66d5616667d55bf02f10e19153457a7
Reviewed-on: https://gerrit.libreoffice.org/23971
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2016-04-10 21:25:13 +00:00
Jochen Nitschke
98d7b02f2b tdf#94306 replace boost::noncopyable in cppuhelper
and related modules.
Replace with C++11 delete copy-constructur
and copy-assignment.

Change-Id: I18aa9fe4ff696f9b5472cbe4cd0097cb174618b7
Reviewed-on: https://gerrit.libreoffice.org/23904
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Michael Stahl <mstahl@redhat.com>
2016-04-08 09:32:48 +00:00
Rohan Kumar
d6411207bd tdf#91794 remove OSL_DEBUG_LEVEL > 1 conditionals
I removed OSL_DEBUG_LEVEL > 1 conditionals to SAL_INFO
statements

Change-Id: I6f74f5146473464758f35629877a76bb2bc39b4e
Reviewed-on: https://gerrit.libreoffice.org/23071
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Björn Michaelsen <bjoern.michaelsen@canonical.com>
2016-04-05 10:03:42 +00:00
Jochen Nitschke
f7a75a66fa cleanup: remove unused Reference.h(xx) includes
and unused using-declarations from Reference.h

Change-Id: I297a7ae6044fa329d245ecf08fd5c4cb930f5b19
Reviewed-on: https://gerrit.libreoffice.org/23735
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
2016-04-02 19:01:24 +00:00
Julien Nabet
1151fec7a8 Let's use the iterator return by erase method (final)
Change-Id: I1934b0c2a9ae9fa089d7e9ded4a289908fb2709a
Reviewed-on: https://gerrit.libreoffice.org/23173
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-03-12 14:30:32 +00:00
Wastack
83452dd083 tdf#97966 redundant static keywords removed 6
Change-Id: Iaf034f3b2282a973f6503edea41cb3184543fb11
Reviewed-on: https://gerrit.libreoffice.org/23133
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2016-03-11 08:38:11 +00:00
Stephan Bergmann
daa6a98549 Avoid reserved identifiers
Change-Id: I6add6c03c92576127c3e3f93892bcc00c1f51424
2016-03-10 18:32:03 +01:00
Stephan Bergmann
132b4e91bc Avoid reserved identifiers (use unnamed namespace, just in case)
Change-Id: I3e34368a674e9f128a32604c82181b1b99632c37
2016-03-10 18:32:03 +01:00
Noel Grandin
70f87284c6 improve defaultparams loplugin
to catch calling params with defaults like "= OUSString()"

Change-Id: Iad060e318ed492c22f8be44e326174fe6d28fff9
Reviewed-on: https://gerrit.libreoffice.org/22932
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-03-07 05:57:17 +00:00
Stephan Bergmann
79c11bb56e Use an XInitialization-based channel to request service mgr pre-init
...instead of private cppu::preInitBootstrap function

Change-Id: Id0e6fcf721b697c993e5acffaf7836452cfa9750
Reviewed-on: https://gerrit.libreoffice.org/22699
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Tor Lillqvist <tml@collabora.com>
Tested-by: Tor Lillqvist <tml@collabora.com>
2016-02-26 12:37:04 +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
Henry Castro
8d7f29a933 Re-work cppu::preInitBootstrap()
In the preinit stage, the preInitBootstrap is called to load
implementations for each service registered by the service manager.

All service requests are: initial Component Context and the process
service factory is set.

However, some services require that VCL is properly initialized.

Change-Id: Ib116e3da172b860f2df4d672f6181b5de0b7e6b2
2016-02-15 22:23:19 +02:00
Henry Castro
6b41b89cc5 In loadAllImplementations(), also invoke component factory
Change-Id: Ie6f6d769b611c8440ddab802545e6bdc482d1476
2016-02-15 22:23:11 +02:00
Tor Lillqvist
682c48afd9 Just abort() in the DISABLE_DYNLOADING case for now
Should fix the build for Android.

Change-Id: Iabba9da8755805ad4d9d21d7a6b4b22e3fa6418f
2016-02-15 22:16:15 +02:00
Henry Castro
df5f7c6aba Introduce lok_preinit() to preload all registered UNO implementations
Intended to be used from an application like the LibreOffice On-Line
server so that it can be called in a process that then will call
fork() several times, and much space consuming data will end up being
shared.

Change-Id: I65341c57d00308d246ec90deab8050b2c4bb3e61
2016-02-15 16:17:53 +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
Stephan Bergmann
e83f31724e tdf#82775: Don't prematurely dispose single-instance services
...that happen to be requested concurrently from multiple threads

Change-Id: Icecfb0b8d88c9123064689643eddf90a99d3b1b8
2016-01-04 14:21:45 +01:00
Noel Grandin
947cc1b53a inline one-liner static method
Change-Id: I9e0bd7a34ed691b245738dd66ff5ba7cc879ebe5
2015-12-02 08:47:30 +02:00
Stephan Bergmann
80c0767b98 Work around clang-cl PR25641
"defaultbootstrap.o : error LNK2001: unresolved external symbol
'[thunk]:private: virtual class com::sun::uno::Sequence<class
rtl::OUString> __cdecl cppuhelper::ServiceManager::getAvailableServiceNames`adjustor{24}'
(void)'
(?getAvailableServiceNames@ServiceManager@cppuhelper@@GBI@EAA?AV?$Sequence@VOUString@rtl@@@uno@star@sun@com@@XZ)"

Change-Id: I04b7353305ffeeb316d70ab8408aeb52ea0f7186
2015-11-28 08:44:53 +01:00
Noel Grandin
96c26b0d9d use initialiser for Sequence<OUString>
using variations of:
git grep -lP 'Sequence.*OUString.*\(\s*1\s*\)' | xargs perl -0777 -pi -e "s/Sequence<OUString> (\w+)\(1\)\;
\s*OUString\* pArray.*;
.*\[0\]\s*=\s*(\S+)\;/Sequence<OUString> \1 { \2 };/g"

Change-Id: I03c64334ff30ee14dce0d17b67f5122a3893bbe3
Reviewed-on: https://gerrit.libreoffice.org/19971
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
2015-11-15 12:20:39 +00:00
Stephan Bergmann
97464be980 Bogus assert
implementation can indeed be empty when cppu::writeSharedLibComponentInfo calls
getEnvironmentFromModule(mod, curEnv, "", ""), which in the final if-branch
calls getEnvironment with implementation = "".  Happens when adding desktop/qa's
test-active.oxt.  Regression introduced with
ae3a0c8da5 "Add .component <implementation
constructor='...' feature."

Change-Id: Ia70958e4aa18d378ff35063bdf6187f6e073b765
2015-11-13 15:59:33 +01:00
Stephan Bergmann
bf3f840302 loplugin:nullptr (automatic rewrite)
Change-Id: I62a63915dfc0bced2cd8ffe3999cbde5c4d97b0b
2015-11-10 10:31:21 +01:00
Noel Grandin
59b072e22b yyyyy
Change-Id: I9a947beefd2dfe21da8239e841ea3fb416bd1548
2015-11-04 14:10:44 +02:00
Benjamin Ni
be729e7721 tdf#94269: Replace "n" prefix for bool variables with "b"
Change-Id: I178545792c7354a362658ac7ef8b1d4cf0865797
Signed-off-by: Michael Stahl <mstahl@redhat.com>
2015-11-02 23:40:57 +01:00