[Libreoffice-commits] core.git: sw/sdi sw/source
mert (via logerrit)
logerrit at kemper.freedesktop.org
Tue Mar 2 07:28:17 UTC 2021
sw/sdi/_viewsh.sdi | 5 +++++
sw/sdi/drawsh.sdi | 5 +++++
sw/source/uibase/shells/drawsh.cxx | 16 +++++++++++++++-
sw/source/uibase/uiview/view2.cxx | 18 ++++++++++++++++++
4 files changed, 43 insertions(+), 1 deletion(-)
New commits:
commit 9e7e616a9c3363cf06801a1974711c4dcef97476
Author: mert <mert.tumer at collabora.com>
AuthorDate: Fri Feb 19 09:37:19 2021 +0300
Commit: Mert Tumer <mert.tumer at collabora.com>
CommitDate: Tue Mar 2 08:27:34 2021 +0100
Implemented MoveShapeHandle uno command for sw
Change-Id: I9feccc4fa1a4d7426609afa474f87ab12c769090
Signed-off-by: mert <mert.tumer at collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111192
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111512
Tested-by: Jenkins
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");
More information about the Libreoffice-commits
mailing list