[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - sw/sdi sw/source

mert (via logerrit) logerrit at kemper.freedesktop.org
Wed Feb 24 07:38:05 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 e9908474d66d71d8186dd0c21c5bb756ab4b72d2
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: Wed Feb 24 08:37:31 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>

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


More information about the Libreoffice-commits mailing list