summaryrefslogtreecommitdiff
path: root/stoc
AgeCommit message (Collapse)AuthorFilesLines
2021-10-05drop 'using namespace std' in s* + toolkitJulien Nabet4-5/+1
Change-Id: Ibd0b983d46a5683df64b4de79cd444427705e9e3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123118 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2021-10-03A more lightweight O[U]StringConcatenationStephan Bergmann1-8/+8
...compared to a full-blown O[U]String, for temporary objects holding an O[U]StringConcat result that can then be used as a std::[u16]string_view. It's instructive to see how some invocations of operator ==, operator !=, and O[U]StringBuffer::insert with an O[U]StringConcat argument required implicit materialization of an O[U]String temporary, and how that expensive operation has now been made explicit with the explicit O[U]StringConcatenation ctor. (The additional operator == and operator != overloads are necessary because the overloads taking two std::[u16]string_view parameters wouldn't even be found here with ADL. And the OUString-related ones would cause ambiguities in at least sal/qa/rtl/strings/test_oustring_stringliterals.cxx built with RTL_STRING_UNITTEST, so have simply been disabled for that special test-code case.) Change-Id: Id29799fa8da21a09ff9794cbc7cc9b366e6803b8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122890 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-09-15Use <comphelper/servicehelper.hxx> implementing XUnoTunnel part 4Mike Kaganski1-1/+3
- Change implementations of getSomething to use getSomethingImpl Or where that's impossible, use getSomething_cast to unify this and reduce number of places where we reinterpret_cast. All static methods getting tunnel ids were renamed to getUnoTunnelId, to comply with the convention used in <comphelper/servicehelper.hxx>. TODO (in separate commits): - Revise uses of getSomething to use getFromUnoTunnel Change-Id: Ifde9e214b52e5df678de71fcc32d2199c82e85cf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122100 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-09-02clang-tidy:readability-redundant-member-initNoel Grandin1-1/+0
Change-Id: I39b9ac81d65f4a269293824642c1b2ec593c0584 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121490 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-08-19Fix locking of public UriReference members againStephan Bergmann2-14/+21
...after 074790ad6f4e02e7aed3f9c954f0b4005b40fa21 "remove some locking from UriReference" (and its follow-up 0f44815ce7b2925189cd603853ce55d8363549dd "loplugin:constmethods"): The m_path member is modified by UrlReference::setName in stoc/source/uriproc/UriSchemeParser_vndDOTsunDOTstarDOTscript.cxx. Also make the non-mutated members (for which locking is thus indeed not needed) private for now. (The original intention was that there can be further parsers for other URI schemes, which might need to modify further UriReference members. If such further parsers are ever implemented, the relevant members can be made public again, and the locking be restored where necessary.) Change-Id: I80b437fe14f43294a52e465a7e1f31ddf2ab0482 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120749 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-08-19loplugin:constmethodsNoel Grandin2-14/+14
Change-Id: I786096b989daa6004a6527aafbe825b6f0a22d90 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120710 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-08-19remove some locking from UriReferenceNoel Grandin2-16/+6
we write these fields in the constructor and then never modify them again, so safe to skip locking Change-Id: I5cb5ea085ee8c2f6e4ce6417c2648265aa5a06d1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120704 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-08-03osl::Mutex->std::mutex in UriReferenceNoel Grandin3-22/+22
Change-Id: Ic5fb97774821be582af62e74bd2e00fca503b8f3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119889 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-08-03Consolidate on C++17 std::scoped_lock instead of std::lock_guardNoel Grandin5-45/+45
as in commit 9376f65a26240441bf9dd6ae1f69886dc9fa60fa Change-Id: I3ad9afd4d113582a214a4a4bc7eea55e38cd6ff9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119927 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-08-02convert #defines to OUStringLiteralNoel Grandin1-10/+10
mostly by doing $ git grep -l '#define.*\"' -- *.cxx | xargs perl -pi -e 's/^#define\s+(\w+)\s+(\".*\")/constexpr OUStringLiteral \1 = u\2;/g' Change-Id: Idface893449b0ef2a3c5254865a300585d752fbb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119669 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-08-02osl::Mutex->std::mutex in SimpleRegistryNoel Grandin1-35/+35
Change-Id: I92d76187ec9f487aaf43cbf19f3911110ddd8d82 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119833 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-08-02osl::Mutex->std::mutex in LRU_CacheNoel Grandin1-5/+5
Change-Id: Ia84cef550412540aa511f917198712add32fc7ac Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119831 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-08-01osl::Mutex->std::mutex in InteractionRequest::RetryContinuationNoel Grandin1-4/+4
Change-Id: I36a238f9b61471266b8fbc81c8e159a0e36182da Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119832 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-07-19osl::Mutex->std::mutex in ImplementationEnumeration_ImplNoel Grandin1-3/+3
Change-Id: I4bb9c6dc7efd76b730e2c8acf824b1e29bca8df5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119134 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-07-18osl::Mutex->std::mutex in ServiceEnumeration_ImplNoel Grandin1-3/+4
Change-Id: I3d754006c7c2766281d924253f2caa0ff4963fea Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119133 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-07-18osl::Mutex->std::mutex in NamingService_ImplNoel Grandin1-5/+5
Change-Id: Ief6cf9df4caafcf72e31394488c407acb5d545fc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119132 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-06-29Drop old MSVC workaroundStephan Bergmann2-12/+5
Change-Id: Ifbbbad0bf837533d36fdeddcb0184baa5b789ca3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118118 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-06-29Fix JavaVirtualMachine::disposeStephan Bergmann2-6/+0
...which must call derived-from JavaVirtualMachine_Impl::dispose (explicitly, when overriding it), but which got lost with 951a9342631129832e647bd8a303a959308bad65 "use single-use attribute for JavaVirtualMachine" Change-Id: I0ca581ae10400f430c24a04b056afbb45a5c1445 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118121 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-06-29Missing acquire in UNO constructor functionStephan Bergmann1-1/+2
...that was lost in 951a9342631129832e647bd8a303a959308bad65 "use single-use attribute for JavaVirtualMachine". (Noticed with `SDK_HOME=.../instdir/sdk URE_HOME=.../instdir make -f Makefile.pln test-javatest` in ure/source/uretest failing at [...] > warn:legacy.osl:1255514:1255514:cppuhelper/source/implbase.cxx:84: OSL_ASSERT: rBHelper.bDisposed > ================================================================= > ==1255514==ERROR: AddressSanitizer: heap-use-after-free on address 0x610000001740 at pc 0x7f14cbe32a2a bp 0x7fff46636a70 sp 0x7fff46636a68 > READ of size 8 at 0x610000001740 thread T0 > #0 in com::sun::star::uno::cpp_release(void*) at include/com/sun/star/uno/genfunc.hxx:52:43 > #1 in cppu::_release(void*, void (*)(void*)) at cppu/source/uno/prim.hxx:85:13 > #2 in cppu::_destructAny(_uno_Any*, void (*)(void*)) at cppu/source/uno/destr.hxx:129:9 > #3 in uno_any_destruct at cppu/source/uno/any.cxx:131:5 > #4 in com::sun::star::uno::Any::~Any() at include/com/sun/star/uno/Any.hxx:115:5 > #5 in cppu::(anonymous namespace)::ComponentContext::ContextEntry::~ContextEntry() at cppuhelper/source/component_context.cxx:131:12 > #6 in std::pair<rtl::OUString const, cppu::(anonymous namespace)::ComponentContext::ContextEntry>::~pair() at ~/gcc/trunk/inst/lib/gcc/x86_64-pc-linux-gnu/12.0.0/../../../../include/c++/12.0.0/bits/stl_iterator.h:2368:12 > #7 in void std::destroy_at<std::pair<rtl::OUString const, cppu::(anonymous namespace)::ComponentContext::ContextEntry> >(std::pair<rtl::OUString const, cppu::(anonymous namespace)::ComponentContext::ContextEntry>*) at ~/gcc/trunk/inst/lib/gcc/x86_64-pc-linux-gnu/12.0.0/../../../../include/c++/12.0.0/bits/stl_construct.h:88:15 > #8 in void std::allocator_traits<std::allocator<std::__detail::_Hash_node<std::pair<rtl::OUString const, cppu::(anonymous namespace)::ComponentContext::ContextEntry>, true> > >::destroy<std::pair<rtl::OUString const, cppu::(anonymous namespace)::ComponentContext::ContextEntry> >(std::allocator<std::__detail::_Hash_node<std::pair<rtl::OUString const, cppu::(anonymous namespace)::ComponentContext::ContextEntry>, true> >&, std::pair<rtl::OUString const, cppu::(anonymous namespace)::ComponentContext::ContextEntry>*) at ~/gcc/trunk/inst/lib/gcc/x86_64-pc-linux-gnu/12.0.0/../../../../include/c++/12.0.0/bits/alloc_traits.h:533:4 > #9 in std::__detail::_Hashtable_alloc<std::allocator<std::__detail::_Hash_node<std::pair<rtl::OUString const, cppu::(anonymous namespace)::ComponentContext::ContextEntry>, true> > >::_M_deallocate_node(std::__detail::_Hash_node<std::pair<rtl::OUString const, cppu::(anonymous namespace)::ComponentContext::ContextEntry>, true>*) at ~/gcc/trunk/inst/lib/gcc/x86_64-pc-linux-gnu/12.0.0/../../../../include/c++/12.0.0/bits/hashtable_policy.h:1932:7 > #10 in std::__detail::_Hashtable_alloc<std::allocator<std::__detail::_Hash_node<std::pair<rtl::OUString const, cppu::(anonymous namespace)::ComponentContext::ContextEntry>, true> > >::_M_deallocate_nodes(std::__detail::_Hash_node<std::pair<rtl::OUString const, cppu::(anonymous namespace)::ComponentContext::ContextEntry>, true>*) at ~/gcc/trunk/inst/lib/gcc/x86_64-pc-linux-gnu/12.0.0/../../../../include/c++/12.0.0/bits/hashtable_policy.h:1954:4 > #11 in std::_Hashtable<rtl::OUString, std::pair<rtl::OUString const, cppu::(anonymous namespace)::ComponentContext::ContextEntry>, std::allocator<std::pair<rtl::OUString const, cppu::(anonymous namespace)::ComponentContext::ContextEntry> >, std::__detail::_Select1st, std::equal_to<rtl::OUString>, std::hash<rtl::OUString>, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<true, false, true> >::clear() at ~/gcc/trunk/inst/lib/gcc/x86_64-pc-linux-gnu/12.0.0/../../../../include/c++/12.0.0/bits/hashtable.h:2332:13 > #12 in std::__cxx1998::unordered_map<rtl::OUString, cppu::(anonymous namespace)::ComponentContext::ContextEntry, std::hash<rtl::OUString>, std::equal_to<rtl::OUString>, std::allocator<std::pair<rtl::OUString const, cppu::(anonymous namespace)::ComponentContext::ContextEntry> > >::clear() at ~/gcc/trunk/inst/lib/gcc/x86_64-pc-linux-gnu/12.0.0/../../../../include/c++/12.0.0/bits/unordered_map.h:791:14 > #13 in std::__debug::unordered_map<rtl::OUString, cppu::(anonymous namespace)::ComponentContext::ContextEntry, std::hash<rtl::OUString>, std::equal_to<rtl::OUString>, std::allocator<std::pair<rtl::OUString const, cppu::(anonymous namespace)::ComponentContext::ContextEntry> > >::clear() at ~/gcc/trunk/inst/lib/gcc/x86_64-pc-linux-gnu/12.0.0/../../../../include/c++/12.0.0/debug/unordered_map:223:9 > #14 in cppu::(anonymous namespace)::ComponentContext::disposing() at cppuhelper/source/component_context.cxx:444:11 > #15 in cppu::WeakComponentImplHelperBase::dispose() at cppuhelper/source/implbase.cxx:104:13 > #16 in cppu::PartialWeakComponentImplHelper<com::sun::star::uno::XComponentContext, com::sun::star::container::XNameContainer>::dispose() at include/cppuhelper/compbase.hxx:90:36 > #17 in sal_main() at cpputools/source/unoexe/unoexe.cxx:540:16 > #18 in main at cpputools/source/unoexe/unoexe.cxx:358:1 > > 0x610000001740 is located 0 bytes inside of 192-byte region [0x610000001740,0x610000001800) > freed by thread T0 here: > #0 in free at ~/github.com/llvm/llvm-project/compiler-rt/lib/asan/asan_malloc_linux.cpp:111:3 > #1 in rtl_freeMemory at sal/rtl/alloc_global.cxx:51:5 > #2 in cppu::WeakComponentImplHelperBase::operator delete(void*) at include/cppuhelper/compbase_ex.hxx:70:11 > #3 in stoc_javavm::JavaVirtualMachine::~JavaVirtualMachine() at stoc/source/javavm/javavm.cxx:1122:1 > #4 in cppu::OWeakObject::release() at cppuhelper/source/weak.cxx:242:9 > #5 in cppu::WeakComponentImplHelperBase::release() at cppuhelper/source/implbase.cxx:86:18 > #6 in cppu::PartialWeakComponentImplHelper<com::sun::star::lang::XInitialization, com::sun::star::lang::XServiceInfo, com::sun::star::java::XJavaVM, com::sun::star::java::XJavaThreadRegister_11, com::sun::star::container::XContainerListener>::release() at include/cppuhelper/compbase.hxx:86:36 > #7 in com::sun::star::uno::Reference<com::sun::star::uno::XInterface>::~Reference() at include/com/sun/star/uno/Reference.hxx:114:22 > #8 in cppuhelper::ServiceManager::Data::Implementation::~Implementation() at cppuhelper/source/servicemanager.hxx:72:16 > #9 in void std::destroy_at<cppuhelper::ServiceManager::Data::Implementation>(cppuhelper::ServiceManager::Data::Implementation*) at ~/gcc/trunk/inst/lib/gcc/x86_64-pc-linux-gnu/12.0.0/../../../../include/c++/12.0.0/bits/stl_construct.h:88:15 > #10 in void std::allocator_traits<std::allocator<cppuhelper::ServiceManager::Data::Implementation> >::destroy<cppuhelper::ServiceManager::Data::Implementation>(std::allocator<cppuhelper::ServiceManager::Data::Implementation>&, cppuhelper::ServiceManager::Data::Implementation*) at ~/gcc/trunk/inst/lib/gcc/x86_64-pc-linux-gnu/12.0.0/../../../../include/c++/12.0.0/bits/alloc_traits.h:533:4 > #11 in std::_Sp_counted_ptr_inplace<cppuhelper::ServiceManager::Data::Implementation, std::allocator<cppuhelper::ServiceManager::Data::Implementation>, (__gnu_cxx::_Lock_policy)2>::_M_dispose() at ~/gcc/trunk/inst/lib/gcc/x86_64-pc-linux-gnu/12.0.0/../../../../include/c++/12.0.0/bits/shared_ptr_base.h:528:2 > #12 in std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release() at ~/gcc/trunk/inst/lib/gcc/x86_64-pc-linux-gnu/12.0.0/../../../../include/c++/12.0.0/bits/shared_ptr_base.h:168:6 > #13 in std::__shared_count<(__gnu_cxx::_Lock_policy)2>::~__shared_count() at ~/gcc/trunk/inst/lib/gcc/x86_64-pc-linux-gnu/12.0.0/../../../../include/c++/12.0.0/bits/shared_ptr_base.h:705:11 > #14 in std::__shared_ptr<cppuhelper::ServiceManager::Data::Implementation, (__gnu_cxx::_Lock_policy)2>::~__shared_ptr() at ~/gcc/trunk/inst/lib/gcc/x86_64-pc-linux-gnu/12.0.0/../../../../include/c++/12.0.0/bits/shared_ptr_base.h:1154:31 > #15 in std::shared_ptr<cppuhelper::ServiceManager::Data::Implementation>::~shared_ptr() at ~/gcc/trunk/inst/lib/gcc/x86_64-pc-linux-gnu/12.0.0/../../../../include/c++/12.0.0/bits/shared_ptr.h:122:11 > #16 in (anonymous namespace)::SingletonFactory::~SingletonFactory() at cppuhelper/source/servicemanager.cxx:510:43 > #17 in (anonymous namespace)::SingletonFactory::~SingletonFactory() at cppuhelper/source/servicemanager.cxx:510:42 > #18 in cppu::OWeakObject::release() at cppuhelper/source/weak.cxx:242:9 > #19 in cppu::WeakImplHelper<com::sun::star::lang::XSingleComponentFactory>::release() at include/cppuhelper/implbase.hxx:115:66 > #20 in com::sun::star::uno::cpp_release(void*) at include/com/sun/star/uno/genfunc.hxx:52:43 > #21 in cppu::_release(void*, void (*)(void*)) at cppu/source/uno/prim.hxx:85:13 > #22 in cppu::_destructAny(_uno_Any*, void (*)(void*)) at cppu/source/uno/destr.hxx:129:9 > #23 in uno_any_destruct at cppu/source/uno/any.cxx:131:5 > #24 in com::sun::star::uno::Any::~Any() at include/com/sun/star/uno/Any.hxx:115:5 > #25 in cppu::(anonymous namespace)::ComponentContext::ContextEntry::~ContextEntry() at cppuhelper/source/component_context.cxx:131:12 > #26 in std::pair<rtl::OUString const, cppu::(anonymous namespace)::ComponentContext::ContextEntry>::~pair() at ~/gcc/trunk/inst/lib/gcc/x86_64-pc-linux-gnu/12.0.0/../../../../include/c++/12.0.0/bits/stl_iterator.h:2368:12 > #27 in void std::destroy_at<std::pair<rtl::OUString const, cppu::(anonymous namespace)::ComponentContext::ContextEntry> >(std::pair<rtl::OUString const, cppu::(anonymous namespace)::ComponentContext::ContextEntry>*) at ~/gcc/trunk/inst/lib/gcc/x86_64-pc-linux-gnu/12.0.0/../../../../include/c++/12.0.0/bits/stl_construct.h:88:15 > #28 in void std::allocator_traits<std::allocator<std::__detail::_Hash_node<std::pair<rtl::OUString const, cppu::(anonymous namespace)::ComponentContext::ContextEntry>, true> > >::destroy<std::pair<rtl::OUString const, cppu::(anonymous namespace)::ComponentContext::ContextEntry> >(std::allocator<std::__detail::_Hash_node<std::pair<rtl::OUString const, cppu::(anonymous namespace)::ComponentContext::ContextEntry>, true> >&, std::pair<rtl::OUString const, cppu::(anonymous namespace)::ComponentContext::ContextEntry>*) at ~/gcc/trunk/inst/lib/gcc/x86_64-pc-linux-gnu/12.0.0/../../../../include/c++/12.0.0/bits/alloc_traits.h:533:4 > #29 in std::__detail::_Hashtable_alloc<std::allocator<std::__detail::_Hash_node<std::pair<rtl::OUString const, cppu::(anonymous namespace)::ComponentContext::ContextEntry>, true> > >::_M_deallocate_node(std::__detail::_Hash_node<std::pair<rtl::OUString const, cppu::(anonymous namespace)::ComponentContext::ContextEntry>, true>*) at ~/gcc/trunk/inst/lib/gcc/x86_64-pc-linux-gnu/12.0.0/../../../../include/c++/12.0.0/bits/hashtable_policy.h:1932:7 > #30 in std::__detail::_Hashtable_alloc<std::allocator<std::__detail::_Hash_node<std::pair<rtl::OUString const, cppu::(anonymous namespace)::ComponentContext::ContextEntry>, true> > >::_M_deallocate_nodes(std::__detail::_Hash_node<std::pair<rtl::OUString const, cppu::(anonymous namespace)::ComponentContext::ContextEntry>, true>*) at ~/gcc/trunk/inst/lib/gcc/x86_64-pc-linux-gnu/12.0.0/../../../../include/c++/12.0.0/bits/hashtable_policy.h:1954:4 > #31 in std::_Hashtable<rtl::OUString, std::pair<rtl::OUString const, cppu::(anonymous namespace)::ComponentContext::ContextEntry>, std::allocator<std::pair<rtl::OUString const, cppu::(anonymous namespace)::ComponentContext::ContextEntry> >, std::__detail::_Select1st, std::equal_to<rtl::OUString>, std::hash<rtl::OUString>, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<true, false, true> >::clear() at ~/gcc/trunk/inst/lib/gcc/x86_64-pc-linux-gnu/12.0.0/../../../../include/c++/12.0.0/bits/hashtable.h:2332:13 > #32 in std::__cxx1998::unordered_map<rtl::OUString, cppu::(anonymous namespace)::ComponentContext::ContextEntry, std::hash<rtl::OUString>, std::equal_to<rtl::OUString>, std::allocator<std::pair<rtl::OUString const, cppu::(anonymous namespace)::ComponentContext::ContextEntry> > >::clear() at ~/gcc/trunk/inst/lib/gcc/x86_64-pc-linux-gnu/12.0.0/../../../../include/c++/12.0.0/bits/unordered_map.h:791:14 > #33 in std::__debug::unordered_map<rtl::OUString, cppu::(anonymous namespace)::ComponentContext::ContextEntry, std::hash<rtl::OUString>, std::equal_to<rtl::OUString>, std::allocator<std::pair<rtl::OUString const, cppu::(anonymous namespace)::ComponentContext::ContextEntry> > >::clear() at ~/gcc/trunk/inst/lib/gcc/x86_64-pc-linux-gnu/12.0.0/../../../../include/c++/12.0.0/debug/unordered_map:223:9 > #34 in cppu::(anonymous namespace)::ComponentContext::disposing() at cppuhelper/source/component_context.cxx:444:11 > #35 in cppu::WeakComponentImplHelperBase::dispose() at cppuhelper/source/implbase.cxx:104:13 > #36 in cppu::PartialWeakComponentImplHelper<com::sun::star::uno::XComponentContext, com::sun::star::container::XNameContainer>::dispose() at include/cppuhelper/compbase.hxx:90:36 > #37 in sal_main() at cpputools/source/unoexe/unoexe.cxx:540:16 > #38 in main at cpputools/source/unoexe/unoexe.cxx:358:1 when presumably removing first /singletons/com.sun.star.java.theJavaVirtualMachine/service and then /singletons/com.sun.star.java.theJavaVirtualMachine from ComponentContext::m_map.) Change-Id: If1563e463becb4d22b754e173ebcb60386e1d828 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118049 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-06-10Simplify Sequences initializations (sot/stock/svl/svtools/svx)Julien Nabet1-6/+1
Change-Id: Iec21851d69f4a8d5f557e9ed2d30e5f680cd62c2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116943 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2021-05-29std::unique->std::optionalNoel Grandin4-47/+42
rather than having a pointer to a pointer (which is what Sequence is) Change-Id: Ieb7b9995f6a25022fe2401adc3c38124edb83506 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116376 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-05-02throw() -> noexcept, part 2/3: Automatic loplugin:noexcept rewriteStephan Bergmann11-31/+31
Change-Id: I076f16d0536b534abf0ced4d76051eadb4c0e033 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114949 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-04-29loplugin:stringadd simplify some *StringBuffer operationsNoel Grandin1-5/+4
pulled from a larger patch which I created with a more permissive variant of this plugin Change-Id: I7abf1f3f09e84703b6e0e52fe9587dff691b2187 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114875 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-04-07Updated README.md files to represent current code / use Markdown formatHossein1-20/+19
Previously, all of the README files have been renamed to README.md and now, the contents of these files were changed to use Markdown format. Other than format inconsistency, some README.md files lacked information about modules, or were out of date. By using LibreOffice / OpenOffice wiki and other documentation websites, these files were updated. Now every README.md file has a title, and some description. The top-level README.md file is changed to add links to the modules. The result of processing the Markdown format README.md files can be seen at: https://docs.libreoffice.org/ Change-Id: Ic3b0c3c064a2498d6a435253b041df010cd7797a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113424 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de> Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
2021-03-24Using .md extension/Markdown syntax for modules READMEHossein1-0/+0
Renaming all README files for all top level modules to README.md, applying no content change at this stage to be able to track history of the files. These files should be edited to use correct Markdown syntax later. Change-Id: I542fa3f3d32072156f16eaad2211a397cc212665 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112977 Tested-by: Jenkins Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
2021-03-23use single-use attribute for IdlReflectionServiceImplNoel Grandin2-20/+3
instead of rtl::Instance, which means it will get cleaned up when UNO shuts down Change-Id: Icf87023bba5932c3b6e229b71c421fce17e86db9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112931 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-03-23use single-use attribute for IntrospectionNoel Grandin2-16/+3
instead of rtl::Instance, which means it will get cleaned up when UNO shuts down Change-Id: I8b9ed057ca77b9c783ad353b88205b296dbe54ed Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112930 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-03-23use single-use attribute for JavaVirtualMachineNoel Grandin2-19/+4
instead of rtl::Instance, which means it will get cleaned up when UNO shuts down Change-Id: Iecf943584d71aac0ed147ff4b6fce49192ef2787 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112929 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-03-22cid#1473974 silence Explicit null dereferencedCaolán McNamara1-0/+1
Change-Id: Id9e381c3919dac989a5957beddd0c070d38ad47d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112870 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-03-10Drop 'static_cast<cppu::OWeakObject*>' syntactic noiseMike Kaganski1-1/+1
... a leftover from 96388e5e809a48573970df9b6b2649517a08447f. Change-Id: I909a470612c421472d8bf94f80e3e94ecb51d6e3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112257 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-03-10Drop 'static_cast<cppu::OWeakObject*>' syntactic noiseMike Kaganski1-1/+1
... where the object is created in-place, and its type is known Change-Id: Ifabfcf2f3ad0d60152f14e8d970c1faa42115288 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112256 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-02-16loplugin:referencecasting in stoc..svtoolsNoel1-1/+1
Change-Id: I806ffb3ab06731c61fe9c58788aabf00a05e980f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110987 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-01-28simplify code, use more subView()Noel2-7/+5
Change-Id: I569c7f34acbdf8451cd5c9acf1abd334637072d1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110051 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-01-10Fix some warnings for Raspberry pi 4 (part5)Julien Nabet3-1/+22
Change-Id: I843746f976855168c791c97a56bcce430af1eea5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109046 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2021-01-09fix coverity parse errorsCaolán McNamara1-1/+1
Change-Id: I3a1179947704452e3ffec02be59d0f7bf0b75ab0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109017 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-12-29loplugin:stringviewparam: operator +Stephan Bergmann3-19/+22
Change-Id: I044dd21b63d7eb03224675584fa143009c6b6008 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108418 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-12-26New loplugin:stringliteralvarStephan Bergmann1-1/+1
See the comment at the top of compilerplugins/clang/stringliteralvar.cxx for details. (Turned some affected variables in included files into inline variables, to avoid GCC warnings about unused variables.) Change-Id: Ie77219e6adfdaaceaa8b4e590b08971f2f04c83a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108239 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-12-21Revert "lok: add pre-condition "DontEnableJava""Henry Castro1-3/+0
This reverts commit 8c5c6b8993a52c40b9de231e778204bcdca16333. Reason for revert: "This is broken. For example, "Tools - Macros - Run Macro... - Library - LibreOffice Macros - HelloWorld" under "Macro Name" no longer lists the JVM-based scripts ("helloworld.bsh", "helloworld.js", "org.libreoffice.exmpale.java_scripts.HelloWorld.printHW")." Change-Id: I6fef6ea80689f036e79816c8d58d2c1f9e64967c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108007 Tested-by: Henry Castro <hcastro@collabora.com> Reviewed-by: Henry Castro <hcastro@collabora.com>
2020-12-18lok: add pre-condition "DontEnableJava"Henry Castro1-0/+3
The context data "DontEnableJava" is set when it is not required to JVM to get involved, in particular case when the Macro Selector Dialog tries to fill the macro scripts, but the client side has disabled the JVM and it produces a lot of checks to try to get booted the JVM. Is there any reason why it is not a pre-condition at the beginning of the function? Change-Id: I3bd4a22ddef12a130ea5ecd08c67f1db66bbac72 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107242 Tested-by: Jenkins Reviewed-by: Henry Castro <hcastro@collabora.com>
2020-12-01tdf#42949 Fix new IWYU warnings in directories s*Gabor Kelemen6-9/+7
Except recently checked sc, sd, svx, sw Found with bin/find-unneeded-includes Only removal proposals are dealt with here. Change-Id: Ice1b86628e4f22a39f307b9c5fa567b6ab9d5acb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106917 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2020-12-01OSL_FAIL.*exception -> TOOLS_WARN_EXCEPTIONNoel3-7/+8
Change-Id: I6800e23ead2767d245d5da71d2d40e0f8a6d7e1f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106859 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-11-24loplugin:stringviewparam extend to comparison operatorsNoel2-8/+8
which means that some call sites have to change to use unicode string literals i.e. u"foo" instead of "foo" Change-Id: Ie51c3adf56d343dd1d1710777f9d2a43ee66221c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106125 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-11-19tdf#123936 Formatting files in module stoc with clang-formatPhilipp Hofer3-20/+11
Change-Id: I401279561e2481a8af7ed600d4133812b08386ba Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105712 Tested-by: Jenkins Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
2020-11-11loplugin:stringviewNoel2-4/+4
Add new methods "subView" to O(U)String to return substring views of the underlying data. Add a clang plugin to warn when replacing existing calls to copy() would be better to use subView(). Change-Id: I03a5732431ce60808946f2ce2c923b22845689ca Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105420 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-11-10new loplugin:reducevarscopeNoel Grandin1-6/+3
Change-Id: Iefe922c2e0d605114d54673d63eccc5e4abd545d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102143 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-10-02Use the new single-instance="true" attribute in stocStephan Bergmann4-24/+6
Change-Id: Icc0d2555bb90a5e0bf6ea828d14fb9e836dd7981 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103845 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-09-24speed-up: preload JVM when PreloadJVM is setSerge Krot1-1/+7
Change-Id: I57f77f127f7cb45fb181b755b40873d47015e5b2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91059 Tested-by: Thorsten Behrens <Thorsten.Behrens@CIB.de> Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2020-09-04Make many OUString functions take std::u16string_view parametersStephan Bergmann1-1/+1
...instead of having individual overloads for OUString, OUStringLiteral, and literal char16_t const[N]. (The variants taking OUString are still needed for !LIBO_INTERNAL_ONLY, though. The variants taking ASCII-only literal char const[N] are also left in place.) This nicely reduces the number of needed overloads. std::u16string_view allows to pass as arguments: * OUString * OUStringLiteral * OUStringChar (with the necessary conversion added now) * OUStringNumber * u"..." char16_t string literals * u"..."sv std::u16string_view literals * std::u16string, plain char16_t*, and more A notable exceptions is OUStringConcat, which now needs to be wrapped in OUString(...), see the handful of places that needed to be adapted. One caveat is the treatment of embedded NUL characters, as std::u16string_view(u"x\0y") constructs a view of size 1, while only u"x\0y"sv constructs a view of size 3 (which matches the old behavior of overloads for literal char16_t const[N] via the ConstCharArrayDetector<>::TypeUtf16 machinery). See the new checkEmbeddedNul in sal/qa/rtl/strings/test_oustring_stringliterals.cxx. The functions that have been changed are generally those that: * already take a string of determined length, so that using std::u16string_view, which is always constructed with a determined length, is no pessimization (e.g., there are operator == overloads taking plain pointers, which do not need to determine the string length upfront); * could not benefit from the fact that the passed-in argument is an OUString (e.g., the corresponding operator = overload can reuse the passed-in OUString's rtl_uString pData member); * do not run into overload resolution ambiguity issues, like the comparison operators would do. One inconsistency that showed up is that while the original replaceAll(OUString const &, OUString const &, sal_Int32 fromIndex = 0) overload takes an optional third fromIndex argument, the existing replaceAll overloads taking OUStringLiteral and literal char16_t const[N] arguments did not. Fixing that required a new (LIBO_INTERNAL_ONLY) rtl_uString_newReplaceAllFromIndexUtf16LUtf16L (with test code in sal/qa/rtl/strings/test_strings_replace.cxx). Another issue was posed by test code in sal/qa/rtl/strings/test_oustring_stringliterals.cxx that used the RTL_STRING_UNITTEST-only OUString(Except*CharArrayDetector) ctors to verify that certain function calls should not compile (and would compile under RTL_STRING_UNITTEST by taking those Except*CharArrayDetector converted to OUString as arguments). Those problematic "should fail to compile" tests have been converted into a new CompilerTest_sal_rtl_oustring. Change-Id: Id72e8c4cc338258cadad00ddc6ea5b9da2e1f780 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102020 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-08-30Goodbye O[U]StringView, welcome O[U]String::ConcatStephan Bergmann1-1/+1
O[U]StringView had an odd mixture of uses. For one, it was used like std::[u16]string_view, for which directly using the latter std types is clearly the better alternative. For another, it was used in concatenation sequences, when neither of the two leading terms were of our rtl string-related types. For that second use case introduce O[U]String::Concat (as std::[u16]string_view can obviously not be used, those not being one of our rtl string-related types). Also, O[U]StringLiteral is occasionally used for this, but the planned changes outlined in the 33ecd0d5c4fff9511a8436513936a3f7044a775a "Change OUStringLiteral from char[] to char16_t[]" commit message will make that no longer work, so O[U]String::Concat will be the preferred solution in such use cases going forward, too. O[U]StringView was also occasionally used to include O[U]StringBuffer values in concatenation sequences, for which a more obvious alternative is to make O[U]StringBuffer participate directly in the ToStringHelper/O[U]StringConcat machinery. Change-Id: I1f0e8d836796c9ae01c45f32c518be5f52976622 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101586 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-08-28Change OUStringLiteral from char[] to char16_t[]Stephan Bergmann1-11/+11
This is a prerequisite for making conversion from OUStringLiteral to OUString more efficient at least for C++20 (by replacing its internals with a constexpr- generated sal_uString-compatible layout with a SAL_STRING_STATIC_FLAG refCount, conditionally for C++20 for now). For a configure-wise bare-bones build on Linux, size reported by `du -bs instdir` grew by 118792 bytes from 1155636636 to 1155755428. In most places just a u"..." string literal prefix had to be added. In some places char const a[] = "..."; variables have been changed to char16_t, and a few places required even further changes to code (which prompted the addition of include/o3tl/string_view.hxx helper function o3tl::equalsIgnoreAsciiCase and the additional OUString::createFromAscii overload). For all uses of macros expanding to string literals, the relevant uses have been rewritten as u"" MACRO instead of changing the macro definitions. It should be possible to change at least some of those macro definitions (and drop the u"" from their call sites) in follow-up commits. Change-Id: Iec4ef1a057d412d22443312d40c6a8a290dc6144 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101483 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>