summaryrefslogtreecommitdiff
path: root/chart2/source
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2023-03-29 11:39:20 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2023-03-29 19:02:47 +0000
commit73629951f68a2958ec77a74a3a4b50bbf0f3ebea (patch)
tree6191781a52cba32fbdae9b92c406d2096c98ed2b /chart2/source
parent67cf6e0463c7538ebdd1ea7ba1b98c5e8cf8b7f9 (diff)
use more concrete types in chart2
Change-Id: I1ba60b690a0402d1a98f792c86ddd033e0c39ed0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149726 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'chart2/source')
-rw-r--r--chart2/source/controller/dialogs/res_LegendPosition.cxx8
-rw-r--r--chart2/source/controller/main/ChartController_Tools.cxx16
-rw-r--r--chart2/source/tools/ReferenceSizeProvider.cxx13
3 files changed, 19 insertions, 18 deletions
diff --git a/chart2/source/controller/dialogs/res_LegendPosition.cxx b/chart2/source/controller/dialogs/res_LegendPosition.cxx
index 49e348f4484a..1562fcc71943 100644
--- a/chart2/source/controller/dialogs/res_LegendPosition.cxx
+++ b/chart2/source/controller/dialogs/res_LegendPosition.cxx
@@ -80,19 +80,19 @@ void LegendPositionResources::writeToResources( const rtl::Reference<::chart::Ch
try
{
rtl::Reference< Diagram > xDiagram = xChartModel->getFirstChartDiagram();
- uno::Reference< beans::XPropertySet > xProp( xDiagram->getLegend(), uno::UNO_QUERY );
- if( xProp.is() )
+ rtl::Reference< Legend > xLegend = xDiagram->getLegend2();
+ if( xLegend.is() )
{
//show
bool bShowLegend = false;
- xProp->getPropertyValue( "Show" ) >>= bShowLegend;
+ xLegend->getPropertyValue( "Show" ) >>= bShowLegend;
if (m_xCbxShow)
m_xCbxShow->set_active( bShowLegend );
PositionEnable();
//position
chart2::LegendPosition ePos;
- xProp->getPropertyValue( "AnchorPosition" ) >>= ePos;
+ xLegend->getPropertyValue( "AnchorPosition" ) >>= ePos;
switch( ePos )
{
case chart2::LegendPosition_LINE_START:
diff --git a/chart2/source/controller/main/ChartController_Tools.cxx b/chart2/source/controller/main/ChartController_Tools.cxx
index e86662dc9beb..acc5dd950391 100644
--- a/chart2/source/controller/main/ChartController_Tools.cxx
+++ b/chart2/source/controller/main/ChartController_Tools.cxx
@@ -202,12 +202,12 @@ void ChartController::executeDispatch_NewArrangement()
xDiagram->set3DSettingsToDefault();
// legend
- Reference< beans::XPropertyState > xLegendState( xDiagram->getLegend(), uno::UNO_QUERY );
- if( xLegendState.is())
+ rtl::Reference< Legend > xLegend = xDiagram->getLegend2();
+ if( xLegend.is())
{
- xLegendState->setPropertyToDefault( "RelativePosition");
- xLegendState->setPropertyToDefault( "RelativeSize");
- xLegendState->setPropertyToDefault( "AnchorPosition");
+ xLegend->setPropertyToDefault( "RelativePosition");
+ xLegend->setPropertyToDefault( "RelativeSize");
+ xLegend->setPropertyToDefault( "AnchorPosition");
}
// titles
@@ -633,14 +633,14 @@ bool ChartController::executeDispatch_Delete()
rtl::Reference< Diagram > xDiagram( xChartDoc->getFirstChartDiagram());
if( xDiagram.is())
{
- uno::Reference< beans::XPropertySet > xLegendProp( xDiagram->getLegend(), uno::UNO_QUERY );
- if( xLegendProp.is())
+ rtl::Reference< Legend > xLegend( xDiagram->getLegend2() );
+ if( xLegend.is())
{
UndoGuard aUndoGuard(
ActionDescriptionProvider::createDescription(
ActionDescriptionProvider::ActionType::Delete, SchResId( STR_OBJECT_LEGEND )),
m_xUndoManager );
- xLegendProp->setPropertyValue( "Show", uno::Any( false ));
+ xLegend->setPropertyValue( "Show", uno::Any( false ));
bReturn = true;
aUndoGuard.commit();
}
diff --git a/chart2/source/tools/ReferenceSizeProvider.cxx b/chart2/source/tools/ReferenceSizeProvider.cxx
index ad71d4e72641..6c99d4e2caeb 100644
--- a/chart2/source/tools/ReferenceSizeProvider.cxx
+++ b/chart2/source/tools/ReferenceSizeProvider.cxx
@@ -27,6 +27,7 @@
#include <Diagram.hxx>
#include <Axis.hxx>
#include <AxisHelper.hxx>
+#include <Legend.hxx>
#include <comphelper/diagnose_ex.hxx>
#include <vector>
@@ -238,9 +239,9 @@ ReferenceSizeProvider::AutoResizeState ReferenceSizeProvider::getAutoResizeState
return eResult;
// Legend
- Reference< beans::XPropertySet > xLegendProp( xDiagram->getLegend(), uno::UNO_QUERY );
- if( xLegendProp.is())
- getAutoResizeFromPropSet( xLegendProp, eResult );
+ rtl::Reference< Legend > xLegend( xDiagram->getLegend2() );
+ if( xLegend.is())
+ getAutoResizeFromPropSet( xLegend, eResult );
if( eResult == AUTO_RESIZE_AMBIGUOUS )
return eResult;
@@ -313,9 +314,9 @@ void ReferenceSizeProvider::setAutoResizeState( ReferenceSizeProvider::AutoResiz
impl_setValuesAtTitled( xDiagram );
// Legend
- Reference< beans::XPropertySet > xLegendProp( xDiagram->getLegend(), uno::UNO_QUERY );
- if( xLegendProp.is())
- setValuesAtPropertySet( xLegendProp );
+ rtl::Reference< Legend > xLegend( xDiagram->getLegend2() );
+ if( xLegend.is())
+ setValuesAtPropertySet( xLegend );
// Axes (incl. Axis Titles)
const std::vector< rtl::Reference< Axis > > aAxes = AxisHelper::getAllAxesOfDiagram( xDiagram );