summaryrefslogtreecommitdiff
path: root/include/tools/ref.hxx
AgeCommit message (Collapse)Author
2019-10-30loplugin:finalclasses toolsNoel Grandin
Change-Id: I6577a0947acda837dd3f775b10fc09bac9fbb27e Reviewed-on: https://gerrit.libreoffice.org/81728 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-08-23Mark move ctors/assignments noexceptMike Kaganski
This should enable using move semantics where possible e.g. in standard containers. According to https://en.cppreference.com/w/cpp/language/move_constructor: To make strong exception guarantee possible, user-defined move constructors should not throw exceptions. For example, std::vector relies on std::move_if_noexcept to choose between move and copy when the elements need to be relocated. Change-Id: I6e1e1cdd5cd430b139ffa2fa7031fb0bb625decb Reviewed-on: https://gerrit.libreoffice.org/77957 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2019-07-20Fix typosAndrea Gelmini
Change-Id: I8561dc27229a2430bfdfd8ac806139b4450496c7 Reviewed-on: https://gerrit.libreoffice.org/76026 Tested-by: Jenkins Reviewed-by: Andrea Gelmini <andrea.gelmini@gelma.net>
2018-07-10tdf#79877 perf loading docx file, writerfilter/ improvementsNoel Grandin
this improves load time by 20%. We switch from shared_ptr to tools::SvRef to manage the objects I noticed some double inheritance like this: DomainMapper LoggedProperties Properties SvRefBase LoggedTable Table SvRefBase so to be safe I made all the ref-count-base-class inheritance virtual. Change-Id: Ia3de9733f5c6966e8171f43d083dcc087040b8cd Reviewed-on: https://gerrit.libreoffice.org/57022 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-06-06add COVERITY_NOEXCEPT_FALSECaolán McNamara
to markup dtors that coverity warns might throw exceptions which won't throw in practice, or where std::terminate is an acceptable response if they do Change-Id: I32b94814e8245372e1d1dc36be0d81e3564042f4 Reviewed-on: https://gerrit.libreoffice.org/38318 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-04-22revert bits of "remove some old MSVC workarounds"Noel Grandin
in commit 841e1a6f3619054ecc9240e061cd83d4e41d1ca9, since MSVC 2015 still does not pack heterogenous bitfields tightly Change-Id: I251c797492762cbd2381496b2f2c6c3223d563c6 Reviewed-on: https://gerrit.libreoffice.org/36800 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-04-21remove some old MSVC workaroundsNoel Grandin
Change-Id: I6abd8aaffb27b3c85df7c0518f7f576be4e32222 Reviewed-on: https://gerrit.libreoffice.org/36660 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-03-03Remove redundant 'inline' keywordStephan Bergmann
...from function definitions occurring within class definitions. Done with a rewriting Clang plugin (to be pushed later). Change-Id: I9c6f2818a57ccdb361548895a7743107cbacdff8 Reviewed-on: https://gerrit.libreoffice.org/34874 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-02-02convert method names in tools::SvRef to be more like our other..Noel Grandin
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-01-26add 'explicit operator bool' to our reference classesNoel Grandin
Change-Id: I91cfbe2646dcc55b98d2b809c49c9ea073f54f58 Reviewed-on: https://gerrit.libreoffice.org/33517 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-11-16new loplugin finalprotectedNoel Grandin
look for final classes, and make sure they don't have protected members Change-Id: I1fa810659bba02b61a5160dbfd8e24185ec9abf4 Reviewed-on: https://gerrit.libreoffice.org/30895 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-10-18tdf#89307: Removed T* SvRef::opeartor &()Jacek Fraczek
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-12use more 'nullptr' in SvRef templatesJochen Nitschke
Change-Id: Idfe140863b7ec51230110d942c5732e18f411192 Reviewed-on: https://gerrit.libreoffice.org/29701 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-10-11Demonstrate that SvRef ==/!= are acceptable as member functionsStephan Bergmann
Change-Id: I30771393bc16f2320cd89f018ff93c756913b70d
2016-10-10tdf#89307: Removed SvRef::operator T*()Jacek Fraczek
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-08-29cid#1371154 Missing move assignment operatorNoel Grandin
Change-Id: If434a0ee5c97018777646c96f52ddded46ce0337
2016-02-22BASIC : Add tools::make_ref and simplify SvRef usageArnaud Versini
Change-Id: I8fe846dbd353bace05a8732a9b961f3507d97ef8 Reviewed-on: https://gerrit.libreoffice.org/22587 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-01-15loplugin:unusedmethods unused return value in include/toolsNoel Grandin
Change-Id: I77a6a46ca20cb41ed73050185fb2064a1bbf2009 Reviewed-on: https://gerrit.libreoffice.org/21485 Reviewed-by: Noel Grandin <noelgrandin@gmail.com> Tested-by: Noel Grandin <noelgrandin@gmail.com>
2015-12-10More loplugin:nullptr automatic rewrite (within templates)Stephan Bergmann
Change-Id: I9bc06cfb5eeb38fd7ae7fb25f876ea9f96e4a65a
2015-11-24add SAL_WARN_UNUSED to css::uno::WeakReference and SvCompatWeakRefNoel Grandin
Change-Id: Idb784d398ed22f2291f1beaffb82f68642d68bcd
2015-11-04tools: re-order members of SvRefBase to work around clang 3.5 bugMichael Stahl
http://fpaste.org/285206/ has minimized reproducer Change-Id: I898dfe0c3246a4ee2b093559530db5446d31e8bc Reviewed-on: https://gerrit.libreoffice.org/19692 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2015-10-27move SvRefMemberList into idlNoel Grandin
since it's only usage is there Change-Id: I882ddd3e08ab37cf7b3cca8121463598ea3d3bc4
2015-10-27loplugin:unusedmethodsNoel Grandin
Change-Id: I161cd52606c11b6008f5d8b1d8ee391692f91861 Reviewed-on: https://gerrit.libreoffice.org/19231 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2015-08-20afl-clang-fast apparently miscompiles thisCaolán McNamara
leading to the delete not getting called, which results in temp files leaking and eventually filling tmp I wonder if generic clang suffers from this ? Change-Id: Iecc266544b3c779026593a16e96bb1a2dfbe8328
2015-02-05fdo#39440: replace C-style cast'sJuan Picca
* Add get() method to tools::SvRef Change-Id: I3825852176c9c37f3ee21f4fd57328b1c7451951 Reviewed-on: https://gerrit.libreoffice.org/14268 Tested-by: Michael Stahl <mstahl@redhat.com> Reviewed-by: Michael Stahl <mstahl@redhat.com>
2015-01-26Visible function type RTTI for Clang -fsanitize=functionStephan Bergmann
...by adding some further SAL_DLLPUBLIC_RTTI type annotations (cf. b4f6b26b5a1a78fecfa95ec2eb7ac8b80495d8aa "SAL_DLLPUBLIC_RTTI for proper RTTI visibility for LLVM") and by making sure relevant function types do not use incomplete types in their parameter and return types (which would make the RTTI hidden). Change-Id: Id7aadcbc0704b9759968ae36266fc9ce11a2e340
2014-10-09remove SvRefBase::QueryDeleteNoel Grandin
Move it's functionality into the only place that needs it, in the dbase driver. Removes an extra virtual call from a widely used class. The dbase driver seems to be using to perform some kind of whacky object recycling, so it's not like we want this functionality to be used somewhere else. Change-Id: I41018f71e0b0a79fdd3d527536f0ac95c788e614 Reviewed-on: https://gerrit.libreoffice.org/11786 Reviewed-by: Noel Grandin <noelgrandin@gmail.com> Tested-by: Noel Grandin <noelgrandin@gmail.com>
2014-10-03rename SvRef::AddRef to AddFirstRefNoel Grandin
to make it's intended purpose clearly distinguishable from AddNextRef Change-Id: I5da780b48b19fd873667b648031bc394113f953b Reviewed-on: https://gerrit.libreoffice.org/11763 Reviewed-by: Noel Grandin <noelgrandin@gmail.com> Tested-by: Noel Grandin <noelgrandin@gmail.com>
2014-07-29simplify "no delete" logic in SvRefBaseNoel Grandin
by converting the bit munging to use bitfields. Remove unused return values. Add asserts to check that AddRef() is not called after the object is deleted. Fix the code in SfxObjectShell to not call AddRef() after SfxObjectShell is deleted. Change-Id: I3a3565a0bc45fc9d1d086222265ab8b8175818a7
2014-07-25convert the weak reference macro in tools into a templateNoel Grandin
which required making SfxFrame subclass SvCompatWeakBase, but that makes the relationships clearer anyhow. Change-Id: I209d05359d50111eacac72c971bb46ccf569ba49 Reviewed-on: https://gerrit.libreoffice.org/10285 Tested-by: LibreOffice gerrit bot <gerrit@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2014-07-22remove dead codeNoel Grandin
Change-Id: I0d3d1a14d8eb880a5a054fe2e736f8ac97f8b727 Reviewed-on: https://gerrit.libreoffice.org/10284 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2014-07-17rename the Weak stuff in tools/ref.hxx to WeakRefNoel Grandin
.. which more accurately reflects it's purpose Change-Id: Ibb87a47a3d1f3e35ac2820f14c71adf3b227c961 Reviewed-on: https://gerrit.libreoffice.org/10283 Reviewed-by: Thomas Arnhold <thomas@arnhold.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com> Tested-by: Noel Grandin <noelgrandin@gmail.com>
2014-07-15Revert "remove unused SvRefBase constructor"Michael Stahl
This reverts commit 09a90c2ff5d39c3ae61b4041c3b39d3da0c640c1. Apparently causes a crash in CppunitTest_sc_macros_test; it is suspicious that the copy ctor is not made private in this commit, since the compiler generated one would do something different. Change-Id: Icb1121332d83e9f08d89535e3da6e10d690ac88a
2014-07-14add some comments to include/tools/ref.hxxNoel Grandin
Change-Id: Ic38d7f5f816f2a91bfb468c0b7fb241b084a0c44
2014-07-14inline SvCompatWeakHdlRef typedefNoel Grandin
.. only used in 2 places in the same file Change-Id: I5dc1dc77c3841bf86134f6a48597f8c1e71b2b3f
2014-07-14inline tools::SvRefBaseRef typedefNoel Grandin
..it is only used in two places Change-Id: If333936b26592ed44d3525f2eb3c21aafde7dddc
2014-07-14remove unused SvRefBase constructorNoel Grandin
Change-Id: I81991231a2cc0b0c9d8289db8435ef8286f1c2bb
2014-07-14include/tools/ref.hxx - cleanup formattingNoel Grandin
Change-Id: I1f7f566ea80723b188aab9c2f65437ca902ce9b9
2014-07-14fix spelling in commentNoel Grandin
Change-Id: Id0b3792b037b2e1a9357c7f26f554cc4222fed0b
2014-07-10remove SvRefBase::ReleaseReferenceNoel Grandin
because no-one is using the return value of ReleaseRef, but everyone is calling ReleaseRef, so make ReleaseRef void-returning and remove ReleaseReference Change-Id: I0bedcb65a887ba7a4953132b4c1ccefbdd554a43
2014-06-19Catch illegal null pointer dereferences earlyStephan Bergmann
Change-Id: I4d558e9a6e2c4e4d9feb45eb5a3fd01ee322bef8
2014-04-07Replace SV_DECL/IMPL_REF macros with SvRef templateStephan Bergmann
Change-Id: I0ef2e67f6d61e0ce118c0f5e926b8194ef9d8058
2014-04-07Unroll sole use of SV_IMPL/DECL_LOCKStephan Bergmann
Change-Id: I0d4691f700a415d0376e2bc346bc51fbf6a000b2
2014-02-18tools: sal_Bool -> boolStephan Bergmann
Change-Id: I3aad235d92b3972b44199294c0f3de65ad57f450
2014-01-28bool improvementsStephan Bergmann
Change-Id: Ia3fd76aa70564cbc683d0d66cc39aa368bea29d9
2013-11-09fdo#65108 inter-module includes <> include/toolsNorbert Thiebaud
Change-Id: I5f44f041e465230d10d562e8bd6f141848465e07
2013-10-23fixincludeguards.sh: include/{toolkit,tools}Thomas Arnhold
Change-Id: I5572c320431222be2405f8c2dc8adeafe4f3828b
2013-10-15Some clean-upStephan Bergmann
Change-Id: I5f99e79e21bd33561dab10cb7044f2fa148ef156
2013-04-23execute move of global headersBjoern Michaelsen
see https://gerrit.libreoffice.org/#/c/3367/ and Change-Id: I00c96fa77d04b33a6f8c8cd3490dfcd9bdc9e84a for details Change-Id: I199a75bc4042af20817265d5ef85b1134a96ff5a