diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2019-04-04 23:45:11 +0300 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2019-04-05 08:33:33 +0200 |
commit | 7327260de3c0c627e62f7c3fddbe3d71ea88e88f (patch) | |
tree | 363e7e71702b0f13d4c9b1b4c89d4533ede74619 /chart2 | |
parent | 5d0700bd3afef6d39b63fe813aaa0ac856ff5785 (diff) |
tdf#120703: partially revert commit 85456fae54029edd26df2277a9eec5e2fe3d9739
... to take into account possible differences of results of dynamic_cast
vs static_cast; the change casts dynamically, as before the commit, and
only adds asserts on the result of the cast.
Thanks to sberg for pointing my mistake out!
Change-Id: Ib77d443e5a858e744f369f58542de603f948fd1c
Reviewed-on: https://gerrit.libreoffice.org/70274
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'chart2')
-rw-r--r-- | chart2/source/controller/main/ChartController.cxx | 4 | ||||
-rw-r--r-- | chart2/source/controller/main/ChartController_Window.cxx | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/chart2/source/controller/main/ChartController.cxx b/chart2/source/controller/main/ChartController.cxx index 533029f3024a..b92d9bb7e265 100644 --- a/chart2/source/controller/main/ChartController.cxx +++ b/chart2/source/controller/main/ChartController.cxx @@ -396,8 +396,8 @@ void SAL_CALL ChartController::attachFrame( uno::Reference<ui::XSidebar> xSidebar = getSidebarFromModel(getModel()); if (xSidebar.is()) { - assert(dynamic_cast<sfx2::sidebar::SidebarController*>(xSidebar.get())); - auto pSidebar = static_cast<sfx2::sidebar::SidebarController*>(xSidebar.get()); + auto pSidebar = dynamic_cast<sfx2::sidebar::SidebarController*>(xSidebar.get()); + assert(pSidebar); sfx2::sidebar::SidebarController::registerSidebarForFrame(pSidebar, this); pSidebar->updateModel(getModel()); css::lang::EventObject aEvent; diff --git a/chart2/source/controller/main/ChartController_Window.cxx b/chart2/source/controller/main/ChartController_Window.cxx index 06e870dc05ae..acfb1233e772 100644 --- a/chart2/source/controller/main/ChartController_Window.cxx +++ b/chart2/source/controller/main/ChartController_Window.cxx @@ -852,8 +852,8 @@ void ChartController::execute_MouseButtonUp( const MouseEvent& rMEvt ) m_xUndoManager ); bool bChanged = false; - assert(dynamic_cast<ChartModel*>(getModel().get())); - ChartModel* pModel = static_cast<ChartModel*>(getModel().get()); + ChartModel* pModel = dynamic_cast<ChartModel*>(getModel().get()); + assert(pModel); if ( eObjectType == OBJECTTYPE_LEGEND ) bChanged = DiagramHelper::switchDiagramPositioningToExcludingPositioning( *pModel, false , true ); |