diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2023-01-13 18:59:38 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2023-01-14 07:28:02 +0000 |
commit | fd6df89dbc26cda08c54e76644b43219d8b75236 (patch) | |
tree | 452dac9ee7129b45b3c5c821efc54a1c15e3a5ac /chart2 | |
parent | b0e0a74d72af09c01e0c6e1324b42fcc2ef55451 (diff) |
use more concrete types in chart
Change-Id: I23888f636e36f6163405603a542a2f2f12eefa1d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145488
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'chart2')
-rw-r--r-- | chart2/source/controller/accessibility/AccessibleChartView.cxx | 13 | ||||
-rw-r--r-- | chart2/source/controller/inc/AccessibleChartView.hxx | 3 |
2 files changed, 10 insertions, 6 deletions
diff --git a/chart2/source/controller/accessibility/AccessibleChartView.cxx b/chart2/source/controller/accessibility/AccessibleChartView.cxx index 2b96c684ff43..8e35e05706ac 100644 --- a/chart2/source/controller/accessibility/AccessibleChartView.cxx +++ b/chart2/source/controller/accessibility/AccessibleChartView.cxx @@ -25,6 +25,7 @@ #include <strings.hrc> #include "AccessibleViewForwarder.hxx" #include <ChartModel.hxx> +#include <ChartView.hxx> #include <com/sun/star/accessibility/AccessibleStateType.hpp> #include <com/sun/star/accessibility/AccessibleRole.hpp> @@ -172,14 +173,14 @@ void SAL_CALL AccessibleChartView::initialize( const Sequence< Any >& rArguments Reference< view::XSelectionSupplier > xSelectionSupplier; rtl::Reference<::chart::ChartModel> xChartModel; - Reference< uno::XInterface > xChartView; + rtl::Reference<::chart::ChartView> xChartView; Reference< XAccessible > xParent; Reference< awt::XWindow > xWindow; { MutexGuard aGuard( m_aMutex); xSelectionSupplier.set( m_xSelectionSupplier ); xChartModel = m_xChartModel; - xChartView.set( m_xChartView ); + xChartView = m_xChartView; xParent.set( m_xParent ); xWindow.set( m_xWindow ); } @@ -209,8 +210,10 @@ void SAL_CALL AccessibleChartView::initialize( const Sequence< Any >& rArguments if( rArguments.getLength() > 2 ) { - Reference< uno::XInterface > xNewChartView; - rArguments[2] >>= xNewChartView; + Reference< uno::XInterface > xTmp; + rArguments[2] >>= xTmp; + rtl::Reference<::chart::ChartView> xNewChartView = dynamic_cast<::chart::ChartView*>(xTmp.get()); + assert(bool(xTmp)==bool(xNewChartView) && "we only support ChartView"); if( xNewChartView != xChartView ) { xChartView = xNewChartView; @@ -283,7 +286,7 @@ void SAL_CALL AccessibleChartView::initialize( const Sequence< Any >& rArguments MutexGuard aGuard( m_aMutex); m_xSelectionSupplier = WeakReference< view::XSelectionSupplier >(xSelectionSupplier); m_xChartModel = xChartModel.get(); - m_xChartView = WeakReference< uno::XInterface >(xChartView); + m_xChartView = xChartView.get(); m_xParent = WeakReference< XAccessible >(xParent); m_xWindow = WeakReference< awt::XWindow >(xWindow); } diff --git a/chart2/source/controller/inc/AccessibleChartView.hxx b/chart2/source/controller/inc/AccessibleChartView.hxx index 3e1217d67233..c66578c0c09e 100644 --- a/chart2/source/controller/inc/AccessibleChartView.hxx +++ b/chart2/source/controller/inc/AccessibleChartView.hxx @@ -38,6 +38,7 @@ class IAccessibleViewForwarder; namespace chart { +class ChartView; namespace impl { @@ -103,7 +104,7 @@ private: // methods private: // members css::uno::WeakReference< css::view::XSelectionSupplier > m_xSelectionSupplier; unotools::WeakReference<::chart::ChartModel> m_xChartModel; - css::uno::WeakReference< css::uno::XInterface > m_xChartView; + unotools::WeakReference< ChartView > m_xChartView; css::uno::WeakReference< css::awt::XWindow > m_xWindow; css::uno::WeakReference< css::accessibility::XAccessible > m_xParent; |