summaryrefslogtreecommitdiffstats
path: root/chart2/source
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 /chart2/source
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 'chart2/source')
-rw-r--r--chart2/source/controller/chartapiwrapper/Chart2ModelContact.cxx8
1 files changed, 3 insertions, 5 deletions
diff --git a/chart2/source/controller/chartapiwrapper/Chart2ModelContact.cxx b/chart2/source/controller/chartapiwrapper/Chart2ModelContact.cxx
index e0cd9e0311bb..813b5b4339af 100644
--- a/chart2/source/controller/chartapiwrapper/Chart2ModelContact.cxx
+++ b/chart2/source/controller/chartapiwrapper/Chart2ModelContact.cxx
@@ -30,6 +30,8 @@
#include <ChartModel.hxx>
+#include <comphelper/servicehelper.hxx>
+
using namespace ::com::sun::star;
using namespace ::com::sun::star::chart2;
@@ -110,13 +112,9 @@ uno::Reference< lang::XUnoTunnel > const & Chart2ModelContact::getChartView() co
ExplicitValueProvider* Chart2ModelContact::getExplicitValueProvider() const
{
getChartView();
- if(!m_xChartView.is())
- return nullptr;
//obtain the ExplicitValueProvider from the chart view
- ExplicitValueProvider* pProvider = reinterpret_cast<ExplicitValueProvider*>(m_xChartView->getSomething(
- ExplicitValueProvider::getUnoTunnelId() ));
- return pProvider;
+ return comphelper::getFromUnoTunnel<ExplicitValueProvider>(m_xChartView);
}
uno::Reference< drawing::XDrawPage > Chart2ModelContact::getDrawPage() const