include/cppuhelper/weak.hxx | 8 ++++++++ 1 file changed, 8 insertions(+)
New commits: commit 0a87d8fed89eacf74eec4dda9e7fb5ec19a32ed5 Author: Mike Kaganski <[email protected]> AuthorDate: Sun Apr 23 19:36:53 2023 +0300 Commit: Mike Kaganski <[email protected]> CommitDate: Sat Apr 29 21:34:54 2023 +0200 Introduce cppu::getXWeak and cppu::OWeakObject::getXWeak To avoid explicit static casts when XWeak or XInterface is needed Change-Id: I0496a5b8dcd48743bceeef9f90904811acd556cd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150807 Tested-by: Jenkins Reviewed-by: Mike Kaganski <[email protected]> diff --git a/include/cppuhelper/weak.hxx b/include/cppuhelper/weak.hxx index b8e4e9955d9b..a1a920ce4193 100644 --- a/include/cppuhelper/weak.hxx +++ b/include/cppuhelper/weak.hxx @@ -147,6 +147,10 @@ public: */ SAL_CALL operator css::uno::Reference< css::uno::XInterface > () { return this; } + +#if defined LIBO_INTERNAL_ONLY + css::uno::XWeak* getXWeak() { return this; } +#endif }; /// @cond INTERNAL @@ -167,6 +171,10 @@ static inline css::uno::XInterface * acquire(OWeakObject * instance) instance->acquire(); return instance; } + +#if defined LIBO_INTERNAL_ONLY +static inline css::uno::XWeak* getXWeak(OWeakObject* instance) { return instance; } +#endif /// @endcond }
