diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2023-03-28 12:15:39 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2023-03-28 13:28:10 +0000 |
commit | b17a441912da448ca0c731a015f4221ae264d959 (patch) | |
tree | 40655b8f9fcc832b20925e5b33a1f2f61da1c809 /chart2/source/controller | |
parent | 7fcfc39232d2fea7078c15552ee092b973e9175b (diff) |
move get/setScheme from ThreeDHelper to Diagram
so we can use the get/setFastPropertyValue methods
Change-Id: I2b57212a1d3933cd2825e647f692e2ae3cb8b484
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149647
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'chart2/source/controller')
6 files changed, 16 insertions, 17 deletions
diff --git a/chart2/source/controller/chartapiwrapper/ChartDocumentWrapper.cxx b/chart2/source/controller/chartapiwrapper/ChartDocumentWrapper.cxx index a2385ba897b7..d3fb9cdec6ce 100644 --- a/chart2/source/controller/chartapiwrapper/ChartDocumentWrapper.cxx +++ b/chart2/source/controller/chartapiwrapper/ChartDocumentWrapper.cxx @@ -1180,7 +1180,7 @@ uno::Reference< uno::XInterface > SAL_CALL ChartDocumentWrapper::createInstance( // locked controllers ControllerLockGuardUNO aCtrlLockGuard( xChartDoc ); rtl::Reference< Diagram > xDiagram = ChartModelHelper::findDiagram( xChartDoc ); - ThreeDLookScheme e3DScheme = ThreeDHelper::detectScheme( xDiagram ); + ThreeDLookScheme e3DScheme = xDiagram->detectScheme(); rtl::Reference< ::chart::ChartTypeManager > xTemplateManager = xChartDoc->getTypeManager(); Diagram::tTemplateWithServiceName aTemplateWithService( xDiagram->getTemplate( xTemplateManager )); @@ -1189,7 +1189,7 @@ uno::Reference< uno::XInterface > SAL_CALL ChartDocumentWrapper::createInstance( xTemplate->changeDiagram( xDiagram ); if( AllSettings::GetMathLayoutRTL() ) AxisHelper::setRTLAxisLayout( AxisHelper::getCoordinateSystemByIndex( xDiagram, 0 ) ); - ThreeDHelper::setScheme( xDiagram, e3DScheme ); + xDiagram->setScheme( e3DScheme ); } else { diff --git a/chart2/source/controller/dialogs/ChartTypeDialogController.cxx b/chart2/source/controller/dialogs/ChartTypeDialogController.cxx index d1c6a725decb..c3da09945ac3 100644 --- a/chart2/source/controller/dialogs/ChartTypeDialogController.cxx +++ b/chart2/source/controller/dialogs/ChartTypeDialogController.cxx @@ -323,7 +323,7 @@ void ChartTypeDialogController::commitToModel( const ChartTypeParameter& rParame if( AllSettings::GetMathLayoutRTL() ) AxisHelper::setRTLAxisLayout( AxisHelper::getCoordinateSystemByIndex( xDiagram, 0 ) ); if( rParameter.b3DLook ) - ThreeDHelper::setScheme( xDiagram, rParameter.eThreeDLookScheme ); + xDiagram->setScheme( rParameter.eThreeDLookScheme ); if (xDiagram.is()) { diff --git a/chart2/source/controller/dialogs/DialogModel.cxx b/chart2/source/controller/dialogs/DialogModel.cxx index c9084ca8f518..032ec26dc912 100644 --- a/chart2/source/controller/dialogs/DialogModel.cxx +++ b/chart2/source/controller/dialogs/DialogModel.cxx @@ -548,7 +548,7 @@ rtl::Reference< ::chart::DataSeries > DialogModel::insertSeriesAfter( try { rtl::Reference< Diagram > xDiagram( m_xChartDocument->getFirstChartDiagram() ); - ThreeDLookScheme e3DScheme = ThreeDHelper::detectScheme( xDiagram ); + ThreeDLookScheme e3DScheme = xDiagram->detectScheme(); sal_Int32 nSeriesInChartType = 0; const sal_Int32 nTotalSeries = countSeries(); @@ -571,7 +571,7 @@ rtl::Reference< ::chart::DataSeries > DialogModel::insertSeriesAfter( if( xNewSeries.is()) addNewSeriesToContainer(xChartType, xSeries, xNewSeries); - ThreeDHelper::setScheme( xDiagram, e3DScheme ); + xDiagram->setScheme( e3DScheme ); } catch( const uno::Exception & ) { @@ -715,7 +715,7 @@ void DialogModel::setData( if( xInterpreter.is()) { rtl::Reference< Diagram > xDiagram( m_xChartDocument->getFirstChartDiagram() ); - ThreeDLookScheme e3DScheme = ThreeDHelper::detectScheme( xDiagram ); + ThreeDLookScheme e3DScheme = xDiagram->detectScheme(); std::vector< rtl::Reference< DataSeries > > aSeriesToReUse = xDiagram->getDataSeries(); @@ -725,7 +725,7 @@ void DialogModel::setData( aSeriesToReUse ), aSeriesToReUse); - ThreeDHelper::setScheme( xDiagram, e3DScheme ); + xDiagram->setScheme( e3DScheme ); } } catch( const uno::Exception & ) diff --git a/chart2/source/controller/dialogs/tp_3D_SceneAppearance.cxx b/chart2/source/controller/dialogs/tp_3D_SceneAppearance.cxx index cd5e9f63db97..53838614c8a9 100644 --- a/chart2/source/controller/dialogs/tp_3D_SceneAppearance.cxx +++ b/chart2/source/controller/dialogs/tp_3D_SceneAppearance.cxx @@ -56,7 +56,7 @@ lcl_ModelProperties lcl_getPropertiesFromModel( rtl::Reference<::chart::ChartMod rtl::Reference< ::chart::Diagram > xDiagram( ::chart::ChartModelHelper::findDiagram( xModel ) ); xDiagram->getPropertyValue( "D3DSceneShadeMode" ) >>= aProps.m_aShadeMode; ::chart::ThreeDHelper::getRoundedEdgesAndObjectLines( xDiagram, aProps.m_nRoundedEdges, aProps.m_nObjectLines ); - aProps.m_eScheme = ::chart::ThreeDHelper::detectScheme( xDiagram ); + aProps.m_eScheme = xDiagram->detectScheme(); } catch( const uno::Exception & ) { @@ -273,9 +273,9 @@ IMPL_LINK_NOARG(ThreeD_SceneAppearance_TabPage, SelectSchemeHdl, weld::ComboBox& rtl::Reference< Diagram > xDiagram = ::chart::ChartModelHelper::findDiagram( m_xChartModel ); if( m_xLB_Scheme->get_active() == POS_3DSCHEME_REALISTIC ) - ThreeDHelper::setScheme( xDiagram, ThreeDLookScheme::ThreeDLookScheme_Realistic ); + xDiagram->setScheme( ThreeDLookScheme::ThreeDLookScheme_Realistic ); else if( m_xLB_Scheme->get_active() == POS_3DSCHEME_SIMPLE ) - ThreeDHelper::setScheme( xDiagram, ThreeDLookScheme::ThreeDLookScheme_Simple ); + xDiagram->setScheme( ThreeDLookScheme::ThreeDLookScheme_Simple ); else { OSL_FAIL( "Invalid Entry selected" ); diff --git a/chart2/source/controller/dialogs/tp_ChartType.cxx b/chart2/source/controller/dialogs/tp_ChartType.cxx index 0e523eb03d65..e34f918e79b0 100644 --- a/chart2/source/controller/dialogs/tp_ChartType.cxx +++ b/chart2/source/controller/dialogs/tp_ChartType.cxx @@ -182,7 +182,7 @@ void ChartTypeTabPage::stateChanged() //detect the new ThreeDLookScheme rtl::Reference< Diagram > xDiagram = ChartModelHelper::findDiagram(m_xChartModel); // tdf#124295 - select always a 3D scheme - if (ThreeDLookScheme aThreeDLookScheme = ThreeDHelper::detectScheme(xDiagram); + if (ThreeDLookScheme aThreeDLookScheme = xDiagram->detectScheme(); aThreeDLookScheme != ThreeDLookScheme::ThreeDLookScheme_Unknown) aParameter.eThreeDLookScheme = aThreeDLookScheme; @@ -245,7 +245,7 @@ void ChartTypeTabPage::selectMainType() m_pCurrentMainType->adjustParameterToMainType( aParameter ); commitToModel( aParameter ); //detect the new ThreeDLookScheme - aParameter.eThreeDLookScheme = ThreeDHelper::detectScheme( ChartModelHelper::findDiagram( m_xChartModel ) ); + aParameter.eThreeDLookScheme = ChartModelHelper::findDiagram( m_xChartModel )->detectScheme(); if (!aParameter.b3DLook && aParameter.eThreeDLookScheme != ThreeDLookScheme::ThreeDLookScheme_Realistic) aParameter.eThreeDLookScheme = ThreeDLookScheme::ThreeDLookScheme_Realistic; @@ -325,7 +325,7 @@ void ChartTypeTabPage::initializePage() m_pCurrentMainType = getSelectedMainType(); //set ThreeDLookScheme - aParameter.eThreeDLookScheme = ThreeDHelper::detectScheme( xDiagram ); + aParameter.eThreeDLookScheme = xDiagram->detectScheme(); if (!aParameter.b3DLook && aParameter.eThreeDLookScheme != ThreeDLookScheme::ThreeDLookScheme_Realistic) aParameter.eThreeDLookScheme = ThreeDLookScheme::ThreeDLookScheme_Realistic; diff --git a/chart2/source/controller/sidebar/ChartTypePanel.cxx b/chart2/source/controller/sidebar/ChartTypePanel.cxx index 42aac80f9152..fa17c4866751 100644 --- a/chart2/source/controller/sidebar/ChartTypePanel.cxx +++ b/chart2/source/controller/sidebar/ChartTypePanel.cxx @@ -182,7 +182,7 @@ void ChartTypePanel::Initialize() m_pCurrentMainType = getSelectedMainType(); //set ThreeDLookScheme - aParameter.eThreeDLookScheme = ThreeDHelper::detectScheme(xDiagram); + aParameter.eThreeDLookScheme = xDiagram->detectScheme(); if (!aParameter.b3DLook && aParameter.eThreeDLookScheme != ThreeDLookScheme::ThreeDLookScheme_Realistic) aParameter.eThreeDLookScheme = ThreeDLookScheme::ThreeDLookScheme_Realistic; @@ -370,7 +370,7 @@ void ChartTypePanel::stateChanged() //detect the new ThreeDLookScheme rtl::Reference<Diagram> xDiagram = ChartModelHelper::findDiagram(m_xChartModel); - aParameter.eThreeDLookScheme = ThreeDHelper::detectScheme(xDiagram); + aParameter.eThreeDLookScheme = xDiagram->detectScheme(); try { xDiagram->getPropertyValue(CHART_UNONAME_SORT_BY_XVALUES) >>= aParameter.bSortByXValues; @@ -413,8 +413,7 @@ void ChartTypePanel::selectMainType() m_pCurrentMainType->adjustParameterToMainType(aParameter); commitToModel(aParameter); //detect the new ThreeDLookScheme - aParameter.eThreeDLookScheme - = ThreeDHelper::detectScheme(ChartModelHelper::findDiagram(m_xChartModel)); + aParameter.eThreeDLookScheme = ChartModelHelper::findDiagram(m_xChartModel)->detectScheme(); if (!aParameter.b3DLook && aParameter.eThreeDLookScheme != ThreeDLookScheme::ThreeDLookScheme_Realistic) aParameter.eThreeDLookScheme = ThreeDLookScheme::ThreeDLookScheme_Realistic; |