diff options
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 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"); |