diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2022-01-16 12:25:49 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-01-16 12:55:26 +0100 |
commit | c592574948b0a28bac965b508bc260aaa6c365d3 (patch) | |
tree | 8f6c610e235f581ec58ee0db77b049294c864ad0 /chart2/source/controller/chartapiwrapper | |
parent | 5a4b75dcb5abc2e925870614a28e1c2876df8ed9 (diff) |
use more concrete types in chart2, ChartView
Change-Id: I51d503cd71ef2adc0e590ef836dabf9906495bbc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128475
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'chart2/source/controller/chartapiwrapper')
3 files changed, 9 insertions, 7 deletions
diff --git a/chart2/source/controller/chartapiwrapper/Chart2ModelContact.cxx b/chart2/source/controller/chartapiwrapper/Chart2ModelContact.cxx index 9ce03b9cc8a7..88f362070795 100644 --- a/chart2/source/controller/chartapiwrapper/Chart2ModelContact.cxx +++ b/chart2/source/controller/chartapiwrapper/Chart2ModelContact.cxx @@ -26,6 +26,7 @@ #include <chartview/ExplicitValueProvider.hxx> #include <chartview/DrawModelWrapper.hxx> #include <AxisHelper.hxx> +#include <ChartView.hxx> #include <DiagramHelper.hxx> #include <ChartModel.hxx> @@ -98,14 +99,14 @@ rtl::Reference< ::chart::Diagram > Chart2ModelContact::getDiagram() const return nullptr; } -uno::Reference< lang::XUnoTunnel > const & Chart2ModelContact::getChartView() const +rtl::Reference< ::chart::ChartView > const & Chart2ModelContact::getChartView() const { if(!m_xChartView.is()) { // get the chart view rtl::Reference<ChartModel> xChartModel( m_xChartModel ); if( xChartModel ) - m_xChartView.set( xChartModel->createInstance( CHART_VIEW_SERVICE_NAME ), uno::UNO_QUERY ); + m_xChartView = xChartModel->getChartView(); // will create if necessary } return m_xChartView; } @@ -115,7 +116,7 @@ ExplicitValueProvider* Chart2ModelContact::getExplicitValueProvider() const getChartView(); //obtain the ExplicitValueProvider from the chart view - return comphelper::getFromUnoTunnel<ExplicitValueProvider>(m_xChartView); + return m_xChartView.get(); } rtl::Reference<SvxDrawPage> Chart2ModelContact::getDrawPage() const @@ -168,7 +169,7 @@ awt::Size Chart2ModelContact::GetPageSize() const awt::Rectangle Chart2ModelContact::SubstractAxisTitleSizes( const awt::Rectangle& rPositionRect ) { awt::Rectangle aRect = ExplicitValueProvider::AddSubtractAxisTitleSizes( - *m_xChartModel.get(), getChartView(), rPositionRect, true ); + *m_xChartModel.get(), getChartView().get(), rPositionRect, true ); return aRect; } @@ -178,7 +179,7 @@ awt::Rectangle Chart2ModelContact::GetDiagramRectangleIncludingTitle() const //add axis title sizes to the diagram size aRect = ExplicitValueProvider::AddSubtractAxisTitleSizes( - *m_xChartModel.get(), getChartView(), aRect, false ); + *m_xChartModel.get(), getChartView().get(), aRect, false ); return aRect; } diff --git a/chart2/source/controller/chartapiwrapper/Chart2ModelContact.hxx b/chart2/source/controller/chartapiwrapper/Chart2ModelContact.hxx index c0f7185fe4ed..837c09341fd3 100644 --- a/chart2/source/controller/chartapiwrapper/Chart2ModelContact.hxx +++ b/chart2/source/controller/chartapiwrapper/Chart2ModelContact.hxx @@ -131,7 +131,7 @@ public: private: //methods ExplicitValueProvider* getExplicitValueProvider() const; - css::uno::Reference< css::lang::XUnoTunnel > const & getChartView() const; + rtl::Reference< ChartView > const & getChartView() const; public: //member css::uno::Reference< css::uno::XComponentContext > m_xContext; @@ -139,7 +139,7 @@ public: //member private: //member unotools::WeakReference< ChartModel > m_xChartModel; - mutable css::uno::Reference< css::lang::XUnoTunnel > m_xChartView; + mutable rtl::Reference< ChartView > m_xChartView; std::map< OUString, css::uno::Reference< css::container::XNameContainer > > m_aTableMap; }; diff --git a/chart2/source/controller/chartapiwrapper/WrappedAxisAndGridExistenceProperties.cxx b/chart2/source/controller/chartapiwrapper/WrappedAxisAndGridExistenceProperties.cxx index a02ff69f2cc8..4895e1c40b9d 100644 --- a/chart2/source/controller/chartapiwrapper/WrappedAxisAndGridExistenceProperties.cxx +++ b/chart2/source/controller/chartapiwrapper/WrappedAxisAndGridExistenceProperties.cxx @@ -29,6 +29,7 @@ #include <WrappedProperty.hxx> #include "Chart2ModelContact.hxx" #include <TitleHelper.hxx> +#include <ChartView.hxx> #include <osl/diagnose.h> using namespace ::com::sun::star; |