diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2022-12-13 13:42:10 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2022-12-16 20:17:34 +0000 |
commit | 88b4f966202717cd4ad38a30a8eda22c3e69ed35 (patch) | |
tree | 8e6f6d482af83efb6ad830a7d6d34e9c28cf84d3 /chart2/source | |
parent | f1b7a69b280aefe2f1b3b0f32193494fd765f2bd (diff) |
loplugin:unocast (sfx2::sidebar::SidebarController)
(See the upcoming commit introducing that loplugin:unocast on why such
dynamic_casts from UNO types are dangerous.)
Change-Id: Ib681b4eaa44c65b9da5988c74c03f1829e3a1507
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144334
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'chart2/source')
-rw-r--r-- | chart2/source/controller/main/ChartController.cxx | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/chart2/source/controller/main/ChartController.cxx b/chart2/source/controller/main/ChartController.cxx index 1a59bb161ec3..2ba57aa45d33 100644 --- a/chart2/source/controller/main/ChartController.cxx +++ b/chart2/source/controller/main/ChartController.cxx @@ -377,7 +377,7 @@ void SAL_CALL ChartController::attachFrame( uno::Reference<ui::XSidebar> xSidebar = getSidebarFromModel(getChartModel()); if (xSidebar.is()) { - auto pSidebar = dynamic_cast<sfx2::sidebar::SidebarController*>(xSidebar.get()); + auto pSidebar = comphelper::getFromUnoTunnel<sfx2::sidebar::SidebarController>(xSidebar); assert(pSidebar); pSidebar->registerSidebarForFrame(this); pSidebar->updateModel(getChartModel()); @@ -761,7 +761,7 @@ void SAL_CALL ChartController::dispose() if (getModel().is()) { uno::Reference<ui::XSidebar> xSidebar = getSidebarFromModel(getChartModel()); - if (sfx2::sidebar::SidebarController* pSidebar = dynamic_cast<sfx2::sidebar::SidebarController*>(xSidebar.get())) + if (sfx2::sidebar::SidebarController* pSidebar = comphelper::getFromUnoTunnel<sfx2::sidebar::SidebarController>(xSidebar)) { pSidebar->unregisterSidebarForFrame(this); } |