summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormert <mert.tumer@collabora.com>2021-02-19 11:15:02 +0300
committerMert Tumer <mert.tumer@collabora.com>2021-03-02 08:28:12 +0100
commit62c2e238fba7d926f4a05f52c185f9e727dd903f (patch)
tree512b6848f7027af68648a78bcf888c2609278131
parent275377505f474ef54c50ec86b06c9b9435756913 (diff)
Implemented MoveShapeHandle uno command for sc
Change-Id: I5f81348cd778d7fbcb3b4e721fbf0412c4f5753d Signed-off-by: mert <mert.tumer@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111195 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111514 Tested-by: Jenkins
-rw-r--r--sc/sdi/drawsh.sdi2
-rw-r--r--sc/source/ui/drawfunc/drawsh.cxx17
2 files changed, 18 insertions, 1 deletions
diff --git a/sc/sdi/drawsh.sdi b/sc/sdi/drawsh.sdi
index 21e25f35623c..b1d5ecec44a8 100644
--- a/sc/sdi/drawsh.sdi
+++ b/sc/sdi/drawsh.sdi
@@ -230,7 +230,7 @@ interface TableDraw
SID_ATTR_GLOW_TRANSPARENCY [ ExecMethod = ExecDrawAttr; StateMethod = GetDrawAttrState; ]
SID_ATTR_SOFTEDGE_RADIUS [ ExecMethod = ExecDrawAttr; StateMethod = GetDrawAttrState; ]
-
+ SID_MOVE_SHAPE_HANDLE [ ExecMethod = ExecDrawAttr; ]
}
diff --git a/sc/source/ui/drawfunc/drawsh.cxx b/sc/source/ui/drawfunc/drawsh.cxx
index 60d3b2114e29..90bf9f8e51cd 100644
--- a/sc/source/ui/drawfunc/drawsh.cxx
+++ b/sc/source/ui/drawfunc/drawsh.cxx
@@ -58,6 +58,7 @@
#include <svx/xlnclit.hxx>
#include <svx/xflclit.hxx>
#include <svx/xflgrit.hxx>
+#include <tools/UnitConversion.hxx>
SFX_IMPL_INTERFACE(ScDrawShell, SfxShell)
@@ -201,6 +202,22 @@ void ScDrawShell::ExecDrawAttr( SfxRequest& rReq )
pView->SetAttributes(aEmptyAttr, true);
}
break;
+ case SID_MOVE_SHAPE_HANDLE:
+ {
+ const SfxItemSet *pArgs = rReq.GetArgs ();
+ if (pArgs && pArgs->Count () == 3)
+ {
+ const SfxUInt32Item* handleNumItem = rReq.GetArg<SfxUInt32Item>(FN_PARAM_1);
+ const SfxUInt32Item* newPosXTwips = rReq.GetArg<SfxUInt32Item>(FN_PARAM_2);
+ const SfxUInt32Item* newPosYTwips = rReq.GetArg<SfxUInt32Item>(FN_PARAM_3);
+
+ const sal_uLong handleNum = handleNumItem->GetValue();
+ const sal_uLong newPosX = convertTwipToMm100(newPosXTwips->GetValue());
+ const sal_uLong newPosY = convertTwipToMm100(newPosYTwips->GetValue());
+ pView->MoveShapeHandle(handleNum, Point(newPosX, newPosY));
+ }
+ }
+ break;
case SID_ATTR_LINE_STYLE:
case SID_ATTR_LINEEND_STYLE: