summaryrefslogtreecommitdiffstats
path: root/animations
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2021-09-13 11:29:37 +0300
committerMike Kaganski <mike.kaganski@collabora.com>2021-09-15 06:08:27 +0200
commit96bd77de5ad7b7a13f7e48e0f95c05ef49255aa0 (patch)
tree4c79c57712124a8589c9e6579b6ec7fec9200c3b /animations
parentUse <comphelper/servicehelper.hxx> implementing XUnoTunnel part 4 (diff)
downloadcore-96bd77de5ad7b7a13f7e48e0f95c05ef49255aa0.tar.gz
core-96bd77de5ad7b7a13f7e48e0f95c05ef49255aa0.zip
Use <comphelper/servicehelper.hxx> implementing XUnoTunnel part 5
- Revise uses of getSomething to use getFromUnoTunnel Where that is impossible, use getSomething_cast to unify casting, and minimize number of places doing low-level transformations. The change keeps the existing tunnel references that last for the duration of the pointers' life, because sometimes destroying such reference may destroy the pointed object, and result in use after free. Change-Id: I291c33223582c34cd2c763aa8aacf0ae899ca4c0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122101 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'animations')
-rw-r--r--animations/source/animcore/animcore.cxx6
1 files changed, 1 insertions, 5 deletions
diff --git a/animations/source/animcore/animcore.cxx b/animations/source/animcore/animcore.cxx
index 71d4ab97e9e2..b664b683347a 100644
--- a/animations/source/animcore/animcore.cxx
+++ b/animations/source/animcore/animcore.cxx
@@ -1221,11 +1221,7 @@ void SAL_CALL AnimationNode::setParent( const Reference< XInterface >& Parent )
if( Parent != mxParent.get() )
{
mxParent = Parent;
-
- mpParent = nullptr;
- Reference< XUnoTunnel > xTunnel( mxParent.get(), UNO_QUERY );
- if( xTunnel.is() )
- mpParent = reinterpret_cast< AnimationNode* >( sal::static_int_cast< sal_IntPtr >(xTunnel->getSomething( getUnoTunnelId() )));
+ mpParent = comphelper::getFromUnoTunnel<AnimationNode>(mxParent.get());
fireChangeListener();
}