diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2023-03-16 09:04:28 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2023-03-20 10:50:47 +0000 |
commit | 514d2c7d20b3d63fc753918e4013eec71d2b342e (patch) | |
tree | 0462005846ef625e64c58e1e65080cae46640cf1 /chart2/source/tools/DiagramHelper.cxx | |
parent | a44c9d023041c881f7858ddd9d93809dc1861313 (diff) |
move attachSeriesToAxis inside chart2::Diagram
Change-Id: I3559fe9b9f0830c32a44c23b0b4d1a3683bafbd8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149135
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'chart2/source/tools/DiagramHelper.cxx')
-rw-r--r-- | chart2/source/tools/DiagramHelper.cxx | 43 |
1 files changed, 0 insertions, 43 deletions
diff --git a/chart2/source/tools/DiagramHelper.cxx b/chart2/source/tools/DiagramHelper.cxx index 6eff3ba0a8b4..b43afae2aac5 100644 --- a/chart2/source/tools/DiagramHelper.cxx +++ b/chart2/source/tools/DiagramHelper.cxx @@ -506,49 +506,6 @@ bool DiagramHelper::isSeriesAttachedToMainAxis( return (nAxisIndex==0); } -bool DiagramHelper::attachSeriesToAxis( bool bAttachToMainAxis - , const uno::Reference< chart2::XDataSeries >& xDataSeries - , const rtl::Reference< Diagram >& xDiagram - , const uno::Reference< uno::XComponentContext > & xContext - , bool bAdaptAxes ) -{ - bool bChanged = false; - - //set property at axis - Reference< beans::XPropertySet > xProp( xDataSeries, uno::UNO_QUERY_THROW ); - - sal_Int32 nNewAxisIndex = bAttachToMainAxis ? 0 : 1; - sal_Int32 nOldAxisIndex = DataSeriesHelper::getAttachedAxisIndex(xDataSeries); - rtl::Reference< Axis > xOldAxis = xDiagram->getAttachedAxis( xDataSeries ); - - if( nOldAxisIndex != nNewAxisIndex ) - { - try - { - xProp->setPropertyValue( "AttachedAxisIndex", uno::Any( nNewAxisIndex ) ); - bChanged = true; - } - catch( const uno::Exception & ) - { - DBG_UNHANDLED_EXCEPTION("chart2"); - } - } - - if( bChanged && xDiagram.is() ) - { - rtl::Reference< Axis > xAxis = AxisHelper::getAxis( 1, bAttachToMainAxis, xDiagram ); - if(!xAxis.is()) //create an axis if necessary - xAxis = AxisHelper::createAxis( 1, bAttachToMainAxis, xDiagram, xContext ); - if( bAdaptAxes ) - { - AxisHelper::makeAxisVisible( xAxis ); - AxisHelper::hideAxisIfNoDataIsAttached( xOldAxis, xDiagram ); - } - } - - return bChanged; -} - static void lcl_generateAutomaticCategoriesFromChartType( Sequence< OUString >& rRet, const rtl::Reference< ChartType >& xChartType ) |