summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authormert <mert.tumer@collabora.com>2021-02-19 09:37:19 +0300
committerMert Tumer <mert.tumer@collabora.com>2021-02-24 08:37:31 +0100
commite9908474d66d71d8186dd0c21c5bb756ab4b72d2 (patch)
tree0d4ae964cbf89f15e81698ab30ed14ef409028b2 /sw
parent4f12603d84b46eaae30a67274983d3a49ecc2ece (diff)
Implemented MoveShapeHandle uno command for sw
Change-Id: I9feccc4fa1a4d7426609afa474f87ab12c769090 Signed-off-by: mert <mert.tumer@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111192 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Diffstat (limited to 'sw')
-rw-r--r--sw/sdi/_viewsh.sdi5
-rw-r--r--sw/sdi/drawsh.sdi5
-rw-r--r--sw/source/uibase/shells/drawsh.cxx16
-rw-r--r--sw/source/uibase/uiview/view2.cxx18
4 files changed, 43 insertions, 1 deletions
diff --git a/sw/sdi/_viewsh.sdi b/sw/sdi/_viewsh.sdi
index c84e6f5434eb..b74eb76c3e8f 100644
--- a/sw/sdi/_viewsh.sdi
+++ b/sw/sdi/_viewsh.sdi
@@ -955,5 +955,10 @@ interface BaseTextEditView
MenuConfig , AccelConfig , ToolBoxConfig ;
]
+ SID_MOVE_SHAPE_HANDLE
+ [
+ ExecMethod = Execute ;
+ ]
+
}
diff --git a/sw/sdi/drawsh.sdi b/sw/sdi/drawsh.sdi
index a50df1289a61..45850f6a7ae3 100644
--- a/sw/sdi/drawsh.sdi
+++ b/sw/sdi/drawsh.sdi
@@ -529,5 +529,10 @@ shell SwDrawShell : SwDrawBaseShell
StateMethod = GetState ;
DisableFlags="SfxDisableFlags::SwOnProtectedCursor";
]
+
+ SID_MOVE_SHAPE_HANDLE
+ [
+ ExecMethod = Execute ;
+ ]
}
diff --git a/sw/source/uibase/shells/drawsh.cxx b/sw/source/uibase/shells/drawsh.cxx
index 3bfaf25b958d..e5169e229041 100644
--- a/sw/source/uibase/shells/drawsh.cxx
+++ b/sw/source/uibase/shells/drawsh.cxx
@@ -219,7 +219,21 @@ void SwDrawShell::Execute(SfxRequest &rReq)
GetView().FlipDrawRotate();
}
break;
-
+ case SID_MOVE_SHAPE_HANDLE:
+ {
+ 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 = newPosXTwips->GetValue();
+ const sal_uLong newPosY = newPosYTwips->GetValue();
+ pSdrView->MoveShapeHandle(handleNum, Point(newPosX, newPosY));
+ }
+ }
+ break;
case SID_BEZIER_EDIT:
if (GetView().IsDrawRotate())
{
diff --git a/sw/source/uibase/uiview/view2.cxx b/sw/source/uibase/uiview/view2.cxx
index ce3ea308cedf..760f18fc56df 100644
--- a/sw/source/uibase/uiview/view2.cxx
+++ b/sw/source/uibase/uiview/view2.cxx
@@ -1292,6 +1292,24 @@ void SwView::Execute(SfxRequest &rReq)
rReq.SetReturnValue(SfxBoolItem(nSlot, InsertGraphicDlg( rReq )));
}
break;
+ case SID_MOVE_SHAPE_HANDLE:
+ {
+ if (pArgs && pArgs->Count() == 3)
+ {
+ SdrView *pSdrView = m_pWrtShell->HasDrawView() ? m_pWrtShell->GetDrawView() : nullptr;
+ if (pSdrView == nullptr)
+ break;
+ 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 = newPosXTwips->GetValue();
+ const sal_uLong newPosY = newPosYTwips->GetValue();
+ pSdrView->MoveShapeHandle(handleNum, Point(newPosX, newPosY));
+ }
+ break;
+ }
default:
OSL_ENSURE(false, "wrong dispatcher");