diff options
author | Szymon Kłos <szymon.klos@collabora.com> | 2021-01-05 18:11:41 +0100 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2021-01-06 20:20:46 +0100 |
commit | f3debb8bee45fd7788592e5a1da4ed9920765eda (patch) | |
tree | 8d88f4cfc3d5ad26bed3eb95740e98917eaf1912 /chart2 | |
parent | f459a2f13912e6b8117c046414bc80f5e3fa77b7 (diff) |
lok: Apply chart line width
Change-Id: I94a6406eeb929498592ca5430cf7248cfd3e9f77
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108815
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Andras Timar <andras.timar@collabora.com>
Diffstat (limited to 'chart2')
-rw-r--r-- | chart2/source/controller/inc/ChartController.hxx | 1 | ||||
-rw-r--r-- | chart2/source/controller/main/ChartController.cxx | 9 | ||||
-rw-r--r-- | chart2/source/controller/main/ChartController_Tools.cxx | 30 |
3 files changed, 40 insertions, 0 deletions
diff --git a/chart2/source/controller/inc/ChartController.hxx b/chart2/source/controller/inc/ChartController.hxx index f4df2236bab6..3a5eedf2f4d4 100644 --- a/chart2/source/controller/inc/ChartController.hxx +++ b/chart2/source/controller/inc/ChartController.hxx @@ -505,6 +505,7 @@ private: void executeDispatch_FillColor(sal_uInt32 nColor); void executeDispatch_FillGradient(OUString sJSONGradient); void executeDispatch_LineColor(sal_uInt32 nColor); + void executeDispatch_LineWidth(sal_uInt32 nWidth); 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 a6b7e2d370f3..0aa6214e4776 100644 --- a/chart2/source/controller/main/ChartController.cxx +++ b/chart2/source/controller/main/ChartController.cxx @@ -1123,6 +1123,15 @@ void SAL_CALL ChartController::dispatch( this->executeDispatch_LineColor(nColor); } } + else if(aCommand == "LineWidth") + { + if (rArgs.getLength() > 0) + { + sal_uInt32 nWidth = -1; + rArgs[0].Value >>= nWidth; + this->executeDispatch_LineWidth(nWidth); + } + } 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 db222340da38..e84731edc8ee 100644 --- a/chart2/source/controller/main/ChartController_Tools.cxx +++ b/chart2/source/controller/main/ChartController_Tools.cxx @@ -1020,6 +1020,36 @@ void ChartController::executeDispatch_LineColor(sal_uInt32 nColor) } } +void ChartController::executeDispatch_LineWidth(sal_uInt32 nWidth) +{ + 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( "LineWidth", css::uno::makeAny( nWidth ) ); + } + } + catch( const uno::Exception& ) + { + DBG_UNHANDLED_EXCEPTION( "chart2" ); + } +} + void ChartController::executeDispatch_LOKSetTextSelection(int nType, int nX, int nY) { if (m_pDrawViewWrapper) |