summaryrefslogtreecommitdiffstats
path: root/chart2/source/controller/chartapiwrapper/Chart2ModelContact.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2022-01-16 12:25:49 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2022-01-16 12:55:26 +0100
commitc592574948b0a28bac965b508bc260aaa6c365d3 (patch)
tree8f6c610e235f581ec58ee0db77b049294c864ad0 /chart2/source/controller/chartapiwrapper/Chart2ModelContact.cxx
parentuse more concrete types in chart2, Diagram (diff)
downloadcore-c592574948b0a28bac965b508bc260aaa6c365d3.tar.gz
core-c592574948b0a28bac965b508bc260aaa6c365d3.zip
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/Chart2ModelContact.cxx')
-rw-r--r--chart2/source/controller/chartapiwrapper/Chart2ModelContact.cxx11
1 files changed, 6 insertions, 5 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;
}