summaryrefslogtreecommitdiffstats
path: root/desktop
diff options
context:
space:
mode:
authorMarco Cecchetti <mrcekets@gmail.com>2019-03-26 13:17:08 +0100
committerMarco Cecchetti <mrcekets@gmail.com>2019-05-20 10:35:49 +0200
commit4a7a37f942b932eb14cd0c5e9e72669f3a04e6a4 (patch)
treeac8a23d703f20583a2c3ef3db1f39c08db40ed64 /desktop
parentlok: chart: informing the client about selection handling properties (diff)
downloadcore-4a7a37f942b932eb14cd0c5e9e72669f3a04e6a4.tar.gz
core-4a7a37f942b932eb14cd0c5e9e72669f3a04e6a4.zip
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 Reviewed-on: https://gerrit.libreoffice.org/70568 Reviewed-by: Marco Cecchetti <mrcekets@gmail.com> Tested-by: Marco Cecchetti <mrcekets@gmail.com>
Diffstat (limited to 'desktop')
-rw-r--r--desktop/source/lib/init.cxx32
1 files changed, 17 insertions, 15 deletions
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 5710c268fec9..22a646ef934a 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -3080,25 +3080,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();