chart2/source/controller/inc/ChartController.hxx | 1 chart2/source/controller/main/ChartController.cxx | 9 ++++ chart2/source/controller/main/ChartController_Tools.cxx | 30 ++++++++++++++++ 3 files changed, 40 insertions(+)
New commits: commit a814a3793f65bc0628c5e79d91c184fcdedbf710 Author: Szymon Kłos <szymon.k...@collabora.com> AuthorDate: Mon Jan 4 13:35:25 2021 +0100 Commit: Andras Timar <andras.ti...@collabora.com> CommitDate: Wed Jan 6 19:43:09 2021 +0100 lok: Apply chart line color Change-Id: I21b96485f26439844f19278e0d6340b55012d4ec Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108666 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> Reviewed-by: Andras Timar <andras.ti...@collabora.com> diff --git a/chart2/source/controller/inc/ChartController.hxx b/chart2/source/controller/inc/ChartController.hxx index 5e5c229cd147..f4df2236bab6 100644 --- a/chart2/source/controller/inc/ChartController.hxx +++ b/chart2/source/controller/inc/ChartController.hxx @@ -504,6 +504,7 @@ private: void executeDispatch_LOKPieSegmentDragging(int nOffset); void executeDispatch_FillColor(sal_uInt32 nColor); void executeDispatch_FillGradient(OUString sJSONGradient); + void executeDispatch_LineColor(sal_uInt32 nColor); void sendPopupRequest(OUString const & rCID, tools::Rectangle aRectangle); diff --git a/chart2/source/controller/main/ChartController.cxx b/chart2/source/controller/main/ChartController.cxx index cf45674304a8..a6b7e2d370f3 100644 --- a/chart2/source/controller/main/ChartController.cxx +++ b/chart2/source/controller/main/ChartController.cxx @@ -1114,6 +1114,15 @@ void SAL_CALL ChartController::dispatch( this->executeDispatch_FillColor(nColor); } } + else if(aCommand == "XLineColor") + { + if (rArgs.getLength() > 0) + { + sal_uInt32 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 396ae00807a8..db222340da38 100644 --- a/chart2/source/controller/main/ChartController_Tools.cxx +++ b/chart2/source/controller/main/ChartController_Tools.cxx @@ -990,6 +990,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) _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits