summaryrefslogtreecommitdiff
path: root/cppuhelper
AgeCommit message (Collapse)AuthorFilesLines
2016-06-20cppuhelper: fix use-after-free race in OWeakConnectionPointMichael Stahl1-0/+3
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 (cherry picked from commit 131e604073f89e6c1dd54be88b94b7befd881f2e) Reviewed-on: https://gerrit.libreoffice.org/26442 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com>
2016-06-17cppuhelper: WeakReference isn't thread-safeMichael Stahl1-7/+4
... 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 (cherry picked from commit debe788bcf3ec258b6b95df3db1f7bfeba881be1) Reviewed-on: https://gerrit.libreoffice.org/26424 Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Tested-by: Stephan Bergmann <sbergman@redhat.com>
2016-05-25Convert XmlReader::Result to scoped enumNoel Grandin1-11/+11
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-24optimise references list handling in OWeakConnectionPoint some moreNoel Grandin1-7/+17
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-24Convert XmlReader::Text to scoped enumNoel Grandin1-1/+1
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-18add some spaces to make it easier to readMarkus Mohrhard1-9/+12
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-16optimise references list handling in OWeakConnectionPointNoel Grandin1-7/+17
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-12loplugin:passstuffbyrefStephan Bergmann1-1/+3
Change-Id: I5a98cea6402b0a02c0e7c329d07d05759a74ec95
2016-05-10Replace fallthrough comments with new SAL_FALLTHROUGH macroStephan Bergmann2-4/+4
...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-04-27Remove ancient, dead CONTEXT_DIAG codeStephan Bergmann1-231/+0
Change-Id: I24123a54fe847b35f6b3674e2caa9bfb4b339d4a
2016-04-27Remove ancient OSL_DEBUG_LEVEL printfStephan Bergmann1-9/+0
...alerting about something that is not too exciting anyway Change-Id: I7596f14e52a0272762f923882f5f92fc3ac1ddf4
2016-04-21clang-tidy modernize-loop-convert in c*Noel Grandin1-2/+2
Change-Id: I77d2548f8be97792660761e6156cd24734a95aaf
2016-04-20loplugin:salbool: Automatic rewrite of sal_False/TrueStephan Bergmann7-43/+43
Change-Id: If965f73934c182a1c96d9fdca6f395c256f6b259
2016-04-18clean-up: unused using declarations and includesJochen Nitschke4-6/+0
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-13tdf#94306 remove unused boost dependenciesJochen Nitschke2-3/+0
remove <boost/noncopyable.hpp> in pch and remove boost from makefile if it was the only boost entry. Change-Id: Icb945ae59c137571f4f63807601738eea5c3e831 Reviewed-on: https://gerrit.libreoffice.org/24061 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com>
2016-04-11Fix indentationStephan Bergmann1-7/+7
Change-Id: Ia043e0a5b7ec9623f6575a83374720be1f3b6b83
2016-04-10Typo: multible->multipleJulien Nabet2-2/+2
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-10Typo: rubust->robustJulien Nabet1-1/+1
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-08tdf#94306 replace boost::noncopyable in cppuhelperJochen Nitschke4-20/+48
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-05tdf#91794 remove OSL_DEBUG_LEVEL > 1 conditionalsRohan Kumar3-26/+7
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-02cleanup: remove unused Reference.h(xx) includesJochen Nitschke1-1/+0
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-03-12Let's use the iterator return by erase method (final)Julien Nabet1-1/+1
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-11tdf#97966 redundant static keywords removed 6Wastack1-2/+2
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-10Avoid reserved identifiersStephan Bergmann1-20/+20
Change-Id: I6add6c03c92576127c3e3f93892bcc00c1f51424
2016-03-10Avoid reserved identifiers (use unnamed namespace, just in case)Stephan Bergmann1-7/+10
Change-Id: I3e34368a674e9f128a32604c82181b1b99632c37
2016-03-07improve defaultparams lopluginNoel Grandin1-3/+1
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-02-26Use an XInitialization-based channel to request service mgr pre-initStephan Bergmann4-145/+139
...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-17use consistent #define checks for the Windows platformNoel Grandin1-1/+1
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-16use consistent #define checks for the Windows platformNoel Grandin1-1/+1
stage 1 of replacing usage of various checks for the windows platform with the compiler-defined '_WIN32' macro Change-Id: Iece73abdee530937e0737190b1aa97a46cd3075f Reviewed-on: https://gerrit.libreoffice.org/22390 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com>
2016-02-15Re-work cppu::preInitBootstrap()Henry Castro2-11/+18
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-15In loadAllImplementations(), also invoke component factoryHenry Castro1-5/+81
Change-Id: Ie6f6d769b611c8440ddab802545e6bdc482d1476
2016-02-15Just abort() in the DISABLE_DYNLOADING case for nowTor Lillqvist1-0/+4
Should fix the build for Android. Change-Id: Iabba9da8755805ad4d9d21d7a6b4b22e3fa6418f
2016-02-15Introduce lok_preinit() to preload all registered UNO implementationsHenry Castro4-0/+58
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-09Remove excess newlinesChris Sherlock12-21/+0
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-01-31unnecessary use of OUString constructorNoel Grandin1-1/+1
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-04tdf#82775: Don't prematurely dispose single-instance servicesStephan Bergmann1-1/+3
...that happen to be requested concurrently from multiple threads Change-Id: Icecfb0b8d88c9123064689643eddf90a99d3b1b8
2015-12-02inline one-liner static methodNoel Grandin1-9/+1
Change-Id: I9e0bd7a34ed691b245738dd66ff5ba7cc879ebe5
2015-11-28Work around clang-cl PR25641Stephan Bergmann2-1/+3
"defaultbootstrap.o : error LNK2001: unresolved external symbol '[thunk]:private: virtual class com::sun::star::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-20loplugin:overrideStephan Bergmann1-3/+3
Change-Id: Ic89d255bf56234a82b23ad6cc36d8d1250acbcab
2015-11-19cppuhelper: enable CppunitTest_cppuhelper_qa_weakMichael Stahl1-0/+4
Change-Id: Ie2339b31b1a2293183a29defb8a4944cb9eb61a8
2015-11-16use initialiser list for Sequence<OUString>Noel Grandin1-4/+3
Change-Id: Ia5e47261d1fc6fac2d046656c05a1c5eedb07e02 Reviewed-on: https://gerrit.libreoffice.org/19978 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2015-11-15Fast PCH generator and optimized PCH filesAshod Nakashian1-95/+53
Ported update_pch.sh to Python with improved performance and features. The new script is invoked from the same update_pch.sh which calls it for each library in parallel, although it can be invoked directly. The ported script (update_pch) updates all PCH files in ~15 seconds where the old script took ~4500 seconds. In addition, the new script supports 3-tiered headers (system, module, and local) and is very flexible to support other improvement. It has a per-library optimal configuration settings that can be updated using another new scripts (update_pch_autotune.sh) which finds optimal per-PCH settings. PCH files have been generated using the new scripts which builds significantly faster (2-3x, depending on module and configuration) and the intermediate binaries are noticably smaller (by several GBs). The new script stamps each generated PCH file with the command that generated it to make it trivial for users to update them, and also adds the command to invoke another script (update_pch_bisect) that helps find missing headers or conflicting headers that may break the build after updating the PCH. Finally update_pch has built-in unit-tests for makefile parsing and other core functionality. Change-Id: Ib933b50e50374d7e2e7e3e95ba8799b0cc8a27fa Reviewed-on: https://gerrit.libreoffice.org/19965 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2015-11-15use initialiser for Sequence<OUString>Noel Grandin3-6/+3
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-13Bogus assertStephan Bergmann1-10/+12
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 ae3a0c8da50b36db395984637f5ad74d3b4887bc "Add .component <implementation constructor='...' feature." Change-Id: Ia70958e4aa18d378ff35063bdf6187f6e073b765
2015-11-10loplugin:nullptr (automatic rewrite)Stephan Bergmann22-144/+144
Change-Id: I62a63915dfc0bced2cd8ffe3999cbde5c4d97b0b
2015-11-04yyyyyNoel Grandin1-5/+4
Change-Id: I9a947beefd2dfe21da8239e841ea3fb416bd1548
2015-11-02tdf#94269: Replace "n" prefix for bool variables with "b"Benjamin Ni1-6/+6
Change-Id: I178545792c7354a362658ac7ef8b1d4cf0865797 Signed-off-by: Michael Stahl <mstahl@redhat.com>
2015-10-30use uno::Reference::set method instead of assignmentNoel Grandin3-7/+5
Change-Id: I080668f86f0ab8b3bba857ee21411f907ae285c4
2015-10-13remove some useless commentsNoel Grandin1-2/+2
found with git grep '// /' Change-Id: I948cf9ae61bbbf2ec706ca5b0572c4f27c58c745
2015-10-12Replace "SAL_OVERRIDE" with "override" in LIBO_INTERNAL_ONLY codeStephan Bergmann13-258/+258
Change-Id: I2ea407acd763ef2d7dae2d3b8f32525523ac8274