diff options
author | mert <mert.tumer@collabora.com> | 2021-02-19 09:37:19 +0300 |
---|---|---|
committer | Mert Tumer <mert.tumer@collabora.com> | 2021-03-02 08:27:34 +0100 |
commit | 9e7e616a9c3363cf06801a1974711c4dcef97476 (patch) | |
tree | a92405900201ab9c6663a449492f9f4b1ddd480c /sw | |
parent | 3078044653f1e1b0a055c47eeb8d27834c07268a (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>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111512
Tested-by: Jenkins
Diffstat (limited to 'sw')
-rw-r--r-- | sw/sdi/_viewsh.sdi | 5 | ||||
-rw-r--r-- | sw/sdi/drawsh.sdi | 5 | ||||
-rw-r--r-- | sw/source/uibase/shells/drawsh.cxx | 16 | ||||
-rw-r--r-- | sw/source/uibase/uiview/view2.cxx | 18 |
4 files changed, 43 insertions, 1 deletions
diff --git a/sw/sdi/_viewsh.sdi b/sw/sdi/_viewsh.sdi index 7b11d4064d1f..f55496ee26a4 100644 --- a/sw/sdi/_viewsh.sdi +++ b/sw/sdi/_viewsh.sdi @@ -976,5 +976,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 5ea1f46d1ecc..a4e999872e48 100644 --- a/sw/sdi/drawsh.sdi +++ b/sw/sdi/drawsh.sdi @@ -537,5 +537,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 09b6bdbb3a0d..7589507511a9 100644 --- a/sw/source/uibase/shells/drawsh.cxx +++ b/sw/source/uibase/shells/drawsh.cxx @@ -197,7 +197,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 e76fc2f30e41..1946f6a3a02d 100644 --- a/sw/source/uibase/uiview/view2.cxx +++ b/sw/source/uibase/uiview/view2.cxx @@ -1348,6 +1348,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"); |