summaryrefslogtreecommitdiff
path: root/include/tools/weakbase.h
AgeCommit message (Collapse)Author
2020-08-20Fix typo in commentAndrea Gelmini
Change-Id: Iacc4791157674fde0c2b76b024a7deceb2159e46 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101011 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Andrea Gelmini <andrea.gelmini@gelma.net>
2020-06-10fix reseting WeakReference when moving a ref to another ref.Tomaž Vajngerl
In ViewIteratorImpl::Reverse we std::move a reference, to a local variable, however the reference was not reset correctly, which caused a crash. The issue is that a mpWeakConnection in WeakReference always needs to be non-null as shown in reset(reference_type* pReference) method. In the move constructor of WeakReference, we just std::move the reference like: mpWeakConnection = std::move(rWeakRef.mpWeakConnection); This means rWeakRef.mpWeakConnection will be reset to null, which is not what is expected, so what is missing is to instantiate rWeakRef.mpWeakConnection by calling reset(nullptr) or using the added reset() method. This also adds a test for LOKit PDF search as this is the case where the crash has been reproduced. It happens because of a call to: ... std::move(maPosition.mxObject); in the method ViewIteratorImpl::Reverse() Change-Id: I43692554ba4f6231d00091269b7c902ab5cbc11f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95995 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2020-05-10new loplugin:simplifypointertoboolNoel Grandin
Change-Id: Iff68e8f379614a6ab6a6e0d1bad18e70bc76d76a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91907 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-03-19add operator* to tools::WeakReferenceNoel Grandin
which fixes warnings from commit ef37ab245b8095895f715217236e8e2fb90613c6 Date: Thu Mar 19 09:21:45 2020 +0200 loplugin:redundantpointerops add some more smart pointer types which I pushed earlier, where I added tools::WeakReference to the list of smart pointer types, but of course the conversion it recommended is not possible without an operator* Change-Id: I9433b7aba46a3a15f9d833847ae3659367388109 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90735 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-03-18tools::WeakBase still needs to be TOOLS_DLLPUBLIC under --enable-mergelibsStephan Bergmann
...plus --enable-assert-always-abort: ShapeManagerImpl::checkForImageMap in slideshow/source/engine/slide/shapemanagerimpl.cxx in Library_slideshow calls SvxShape::GetSdrObject, which calls tools::WeakBase::get (include/tools/weakbase.hxx), which contains > assert(dynamic_cast<reference_type *>(pWeakBase)); requiring RTTI for tools::WeakBase. See e.g. <https://ci.libreoffice.org//job/lo_tb_random_config_linux/2281/>. Change-Id: I9598c14bf74eb5a28332d0beecfbe8201b39451e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90697 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-03-06mark some more classes hidden in --enable-mergelibs modeNoel Grandin
and speed up the script using python's multiprocessing module Change-Id: I01e1350937a0531e26603d6357982c91f3bcef0f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90107 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-10-17tdf#42949 Fix IWYU warnings in include/tools/*Gabor Kelemen
Found with bin/find-unneeded-includes Only removal proposals are dealt with here. Change-Id: I9dc920e9388f9e2aa4dcae1f0b3f7562d08f7f70 Reviewed-on: https://gerrit.libreoffice.org/61809 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2018-01-27improve subtyping when dealing with tools::WeakReferenceNoel Grandin
tweak the templating to make it easier to declare a WeakReference that points to a subclass for a weak-capable class. Which lets us declare some fields with more specific types, and dump a lot of unnecessary casting. And make WeakBase be inherited from virtually, so we don't end up with weird states where two weak refernces could point to two different parts of the same object. Change-Id: I3213ea27e087038457b0761b5171c7bce96e71f3 Reviewed-on: https://gerrit.libreoffice.org/48650 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-01-26loplugin: unnecessary destructor test..unotoolsNoel Grandin
Change-Id: I1fd8a3f39b875d1920759f42e37f4c9d6785d62e Reviewed-on: https://gerrit.libreoffice.org/33573 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-08-29cid#1371173 Missing move assignment operatorNoel Grandin
Change-Id: Idf179403426d9714fa73d0c3370a6debc30a0431
2016-06-08remove some manual refcounting in toolsNoel Grandin
Change-Id: Ic911b38f77dda7ce564f315a97624c9054c77a38 Reviewed-on: https://gerrit.libreoffice.org/26010 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2015-11-20mark WeakReference with SAL_WARN_UNUSEDNoel Grandin
Change-Id: I9d56cdecba8066058a0c6f128720534fcf6f6e34
2015-07-03Fix typosAndrea Gelmini
Change-Id: Ie2bbe020fc6e3a4a4f913208c245f395849bb9ee Reviewed-on: https://gerrit.libreoffice.org/16708 Reviewed-by: Michael Stahl <mstahl@redhat.com> Tested-by: Michael Stahl <mstahl@redhat.com>
2013-10-23fixincludeguards.sh: include/{toolkit,tools}Thomas Arnhold
Change-Id: I5572c320431222be2405f8c2dc8adeafe4f3828b
2013-06-30Clean String and sal_Bool in toolsNorbert Thiebaud
Change-Id: I6a92196f33d7a5278c7dcc426112e9c56d582655 Reviewed-on: https://gerrit.libreoffice.org/4627 Reviewed-by: Norbert Thiebaud <nthiebaud@gmail.com> Tested-by: Norbert Thiebaud <nthiebaud@gmail.com>
2013-04-23execute move of global headersBjoern Michaelsen
see https://gerrit.libreoffice.org/#/c/3367/ and Change-Id: I00c96fa77d04b33a6f8c8cd3490dfcd9bdc9e84a for details Change-Id: I199a75bc4042af20817265d5ef85b1134a96ff5a