[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.2' - chart2/source

Szymon KÅ‚os (via logerrit) logerrit at kemper.freedesktop.org
Mon Sep 21 14:32:30 UTC 2020


 chart2/source/controller/inc/ChartController.hxx        |    1 
 chart2/source/controller/main/ChartController.cxx       |    9 +++++++
 chart2/source/controller/main/ChartController_Tools.cxx |   20 ++++++++++++++++
 3 files changed, 30 insertions(+)

New commits:
commit 5b7d841f062de8872457369da4d4e8e35be9bf60
Author:     Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Thu Sep 17 13:27:53 2020 +0200
Commit:     Andras Timar <andras.timar at collabora.com>
CommitDate: Mon Sep 21 16:31:58 2020 +0200

    lok: Add posibility to change chart fill color
    
    Change-Id: I519a0fe15c4983803109aed7eef840d36a5e7b21
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102920
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Andras Timar <andras.timar at collabora.com>

diff --git a/chart2/source/controller/inc/ChartController.hxx b/chart2/source/controller/inc/ChartController.hxx
index 22469e396480..270f5743e0c7 100644
--- a/chart2/source/controller/inc/ChartController.hxx
+++ b/chart2/source/controller/inc/ChartController.hxx
@@ -501,6 +501,7 @@ private:
 
     void executeDispatch_LOKSetTextSelection(int nType, int nX, int nY);
     void executeDispatch_LOKPieSegmentDragging(int nOffset);
+    void executeDispatch_FillColor(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 27cb93cabdd7..5ee520362c0b 100644
--- a/chart2/source/controller/main/ChartController.cxx
+++ b/chart2/source/controller/main/ChartController.cxx
@@ -1113,6 +1113,15 @@ void SAL_CALL ChartController::dispatch(
             this->executeDispatch_PositionAndSize(&rArgs);
         }
     }
+    else if(aCommand == "FillColor")
+    {
+        if (rArgs.getLength() > 0)
+        {
+            sal_uInt32 nColor = -1;
+            rArgs[0].Value >>= nColor;
+            this->executeDispatch_FillColor(nColor);
+        }
+    }
     else if(aCommand == "Paste")
         this->executeDispatch_Paste();
     else if(aCommand == "Copy" )
diff --git a/chart2/source/controller/main/ChartController_Tools.cxx b/chart2/source/controller/main/ChartController_Tools.cxx
index b1d26f3425ab..ff1c83ae7e7f 100644
--- a/chart2/source/controller/main/ChartController_Tools.cxx
+++ b/chart2/source/controller/main/ChartController_Tools.cxx
@@ -937,6 +937,26 @@ void ChartController::executeDispatch_ToggleGridVertical()
     }
 }
 
+void ChartController::executeDispatch_FillColor(sal_uInt32 nColor)
+{
+    try
+    {
+        OUString aCID( m_aSelection.getSelectedCID() );
+        const uno::Reference< frame::XModel >& xChartModel = getModel();
+        if( xChartModel.is() )
+        {
+            Reference< beans::XPropertySet > xPointProperties(
+                ObjectIdentifier::getObjectPropertySet( aCID, xChartModel ) );
+            if( xPointProperties.is() )
+                xPointProperties->setPropertyValue( "FillColor", uno::Any( nColor ) );
+        }
+    }
+    catch( const uno::Exception & ex )
+    {
+        SAL_WARN( "chart2", "Exception caught. " << ex );
+    }
+}
+
 void ChartController::executeDispatch_LOKSetTextSelection(int nType, int nX, int nY)
 {
     if (m_pDrawViewWrapper)


More information about the Libreoffice-commits mailing list