diff options
Diffstat (limited to 'chart2')
-rw-r--r-- | chart2/source/controller/inc/ChartController.hxx | 1 | ||||
-rw-r--r-- | chart2/source/controller/main/ChartController.cxx | 20 | ||||
-rw-r--r-- | chart2/source/controller/main/ChartController_Tools.cxx | 20 | ||||
-rw-r--r-- | chart2/source/tools/ObjectIdentifier.cxx | 2 |
4 files changed, 41 insertions, 2 deletions
diff --git a/chart2/source/controller/inc/ChartController.hxx b/chart2/source/controller/inc/ChartController.hxx index 98225c96dd49..2b21e171d949 100644 --- a/chart2/source/controller/inc/ChartController.hxx +++ b/chart2/source/controller/inc/ChartController.hxx @@ -501,6 +501,7 @@ private: void executeDispatch_ToggleGridVertical(); void executeDispatch_LOKSetTextSelection(int nType, int nX, int nY); + void executeDispatch_LOKPieSegmentDragging(int nOffset); 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 5540d67a0e90..6b8746603797 100644 --- a/chart2/source/controller/main/ChartController.cxx +++ b/chart2/source/controller/main/ChartController.cxx @@ -1087,7 +1087,25 @@ void SAL_CALL ChartController::dispatch( } else if (aCommand == "LOKTransform") { - this->executeDispatch_PositionAndSize(&rArgs); + if (rArgs[0].Name == "Action") + { + OUString sAction; + if ((rArgs[0].Value >>= sAction) && sAction == "PieSegmentDragging") + { + if (rArgs[1].Name == "Offset") + { + sal_Int32 nOffset; + if (rArgs[1].Value >>= nOffset) + { + this->executeDispatch_LOKPieSegmentDragging(nOffset); + } + } + } + } + else + { + this->executeDispatch_PositionAndSize(&rArgs); + } } else if(aCommand == "Paste") this->executeDispatch_Paste(); diff --git a/chart2/source/controller/main/ChartController_Tools.cxx b/chart2/source/controller/main/ChartController_Tools.cxx index 799b4b6b48f7..938c4a777f97 100644 --- a/chart2/source/controller/main/ChartController_Tools.cxx +++ b/chart2/source/controller/main/ChartController_Tools.cxx @@ -962,6 +962,26 @@ void ChartController::executeDispatch_LOKSetTextSelection(int nType, int nX, int } } +void ChartController::executeDispatch_LOKPieSegmentDragging( int nOffset ) +{ + 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( "Offset", uno::Any( nOffset / 100.0 ) ); + } + } + catch( const uno::Exception & ex ) + { + SAL_WARN( "chart2", "Exception caught. " << ex ); + } +} + void ChartController::impl_ShapeControllerDispatch( const util::URL& rURL, const Sequence< beans::PropertyValue >& rArgs ) { Reference< frame::XDispatch > xDispatch( m_aDispatchContainer.getShapeController() ); diff --git a/chart2/source/tools/ObjectIdentifier.cxx b/chart2/source/tools/ObjectIdentifier.cxx index 0b29437546dd..7e0064e411cd 100644 --- a/chart2/source/tools/ObjectIdentifier.cxx +++ b/chart2/source/tools/ObjectIdentifier.cxx @@ -56,7 +56,7 @@ static const char m_aMultiClick[] = "MultiClick"; static const char m_aDragMethodEquals[] = "DragMethod="; static const char m_aDragParameterEquals[] = "DragParameter="; static const char m_aProtocol[] = "CID/"; -static const OUString m_aPieSegmentDragMethodServiceName("PieSegmentDraging"); +static const OUString m_aPieSegmentDragMethodServiceName("PieSegmentDragging"); namespace { |