diff options
-rw-r--r-- | chart2/source/controller/dialogs/res_LegendPosition.cxx | 8 | ||||
-rw-r--r-- | chart2/source/controller/main/ChartController_Tools.cxx | 16 | ||||
-rw-r--r-- | chart2/source/tools/ReferenceSizeProvider.cxx | 13 |
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 ); |