diff options
author | Marco Cecchetti <mrcekets@gmail.com> | 2019-03-26 13:17:08 +0100 |
---|---|---|
committer | Jan Holesovsky <kendy@collabora.com> | 2019-04-30 12:06:15 +0200 |
commit | 6d63cb8749811ff407c3b3f523a329bcaab05542 (patch) | |
tree | 359ce7a16cd3021926318f0c635fe46ec67519d4 /desktop/source/lib | |
parent | 9287a4178cd5f09309467eaede1a68021636af93 (diff) |
lok: chart: constrained dragging of pie segments
The extra information for the graphic selection is now formatted
according to JSON syntax so that is easier to parse.
Information for allowing the client to performa constrained dragging
of a pie segment is appended when needed to the graphic selection
message.
A polygon approximation of the pie segment in svg format is attached
too to the graphic selection message.
Core now is able to handle a specific msg from the client with data
about the new pie segment offset computed by the client on drag end.
This information is dispatched by the chart controller to a specific
method: executeDispatch_LOKPieSegmentDragging.
Change-Id: I42e7742508fa3a453383bf7b95e47df169f24834
Diffstat (limited to 'desktop/source/lib')
-rw-r--r-- | desktop/source/lib/init.cxx | 32 |
1 files changed, 17 insertions, 15 deletions
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index 3443fe4d4b9c..853b0a7882dd 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -3101,25 +3101,27 @@ static void doc_postUnoCommand(LibreOfficeKitDocument* pThis, const char* pComma if (aChartHelper.GetWindow()) { - tools::Rectangle aChartBB = aChartHelper.GetChartBoundingBox(); - int nLeft = OutputDevice::LogicToLogic(aChartBB.Left(), MapUnit::MapTwip, MapUnit::Map100thMM); - int nTop = OutputDevice::LogicToLogic(aChartBB.Top(), MapUnit::MapTwip, MapUnit::Map100thMM); - - sal_Int32 value; - for (beans::PropertyValue& rPropValue: aPropertyValuesVector) + if (aPropertyValuesVector[0].Name != "Action") { - if (rPropValue.Name == "TransformPosX" || rPropValue.Name == "TransformRotationX") - { - rPropValue.Value >>= value; - rPropValue.Value <<= value - nLeft; - } - else if (rPropValue.Name == "TransformPosY" || rPropValue.Name == "TransformRotationY") + tools::Rectangle aChartBB = aChartHelper.GetChartBoundingBox(); + int nLeft = OutputDevice::LogicToLogic(aChartBB.Left(), MapUnit::MapTwip, MapUnit::Map100thMM); + int nTop = OutputDevice::LogicToLogic(aChartBB.Top(), MapUnit::MapTwip, MapUnit::Map100thMM); + + sal_Int32 value; + for (beans::PropertyValue& rPropValue: aPropertyValuesVector) { - rPropValue.Value >>= value; - rPropValue.Value <<= value - nTop; + if (rPropValue.Name == "TransformPosX" || rPropValue.Name == "TransformRotationX") + { + rPropValue.Value >>= value; + rPropValue.Value <<= value - nLeft; + } + else if (rPropValue.Name == "TransformPosY" || rPropValue.Name == "TransformRotationY") + { + rPropValue.Value >>= value; + rPropValue.Value <<= value - nTop; + } } } - util::URL aCommandURL; aCommandURL.Path = "LOKTransform"; css::uno::Reference<css::frame::XDispatch>& aChartDispatcher = aChartHelper.GetXDispatcher(); |