diff options
author | Szymon Kłos <szymon.klos@collabora.com> | 2021-01-04 13:35:25 +0100 |
---|---|---|
committer | Szymon Kłos <szymon.klos@collabora.com> | 2021-01-08 09:40:50 +0100 |
commit | 1af41f212194b26c0415ec0ad4d9038df3b373bd (patch) | |
tree | 3254ca5452de16db2c71e8f848a80704148fa375 /chart2/source/controller/main | |
parent | bac6c21fb20607db0758210bf9946b46ecbb2a6f (diff) |
lok: Apply chart line color
Change-Id: I21b96485f26439844f19278e0d6340b55012d4ec
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108666
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Andras Timar <andras.timar@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108926
Tested-by: Jenkins
Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
Diffstat (limited to 'chart2/source/controller/main')
-rw-r--r-- | chart2/source/controller/main/ChartController.cxx | 9 | ||||
-rw-r--r-- | chart2/source/controller/main/ChartController_Tools.cxx | 30 |
2 files changed, 39 insertions, 0 deletions
diff --git a/chart2/source/controller/main/ChartController.cxx b/chart2/source/controller/main/ChartController.cxx index ccd9aa68d994..8612b1e20513 100644 --- a/chart2/source/controller/main/ChartController.cxx +++ b/chart2/source/controller/main/ChartController.cxx @@ -1112,6 +1112,15 @@ void SAL_CALL ChartController::dispatch( this->executeDispatch_FillColor(nColor); } } + else if(aCommand == "XLineColor") + { + if (rArgs.getLength() > 0) + { + sal_Int32 nColor = -1; + rArgs[0].Value >>= nColor; + this->executeDispatch_LineColor(nColor); + } + } else if(aCommand.startsWith("FillGradient")) { this->executeDispatch_FillGradient(aCommand.copy(aCommand.indexOf('=') + 1)); diff --git a/chart2/source/controller/main/ChartController_Tools.cxx b/chart2/source/controller/main/ChartController_Tools.cxx index 6a6b7269b893..bc796925b4a8 100644 --- a/chart2/source/controller/main/ChartController_Tools.cxx +++ b/chart2/source/controller/main/ChartController_Tools.cxx @@ -983,6 +983,36 @@ void ChartController::executeDispatch_FillGradient(OUString sJSONGradient) } } +void ChartController::executeDispatch_LineColor(sal_uInt32 nColor) +{ + try + { + OUString aCID( m_aSelection.getSelectedCID() ); + const uno::Reference< frame::XModel >& xChartModel = getModel(); + if( xChartModel.is() ) + { + Reference< beans::XPropertySet > xPropSet( + ObjectIdentifier::getObjectPropertySet( aCID, xChartModel ) ); + + ObjectType eType = ObjectIdentifier::getObjectType(aCID); + if (eType == OBJECTTYPE_DIAGRAM) + { + css::uno::Reference<css::chart2::XDiagram> xDiagram( + xPropSet, css::uno::UNO_QUERY); + if (xDiagram.is()) + xPropSet.set(xDiagram->getWall()); + } + + if( xPropSet.is() ) + xPropSet->setPropertyValue( "LineColor", css::uno::makeAny( Color(nColor) ) ); + } + } + catch( const uno::Exception& ) + { + DBG_UNHANDLED_EXCEPTION( "chart2" ); + } +} + void ChartController::executeDispatch_LOKSetTextSelection(int nType, int nX, int nY) { if (!m_pDrawViewWrapper) |