[Libreoffice-commits] core.git: include/svx sd/sdi sd/source svx/sdi

mert (via logerrit) logerrit at kemper.freedesktop.org
Mon Mar 1 12:06:30 UTC 2021


 include/svx/svxids.hrc         |    5 ++++-
 sd/sdi/_drvwsh.sdi             |    5 ++++-
 sd/source/ui/view/drviews2.cxx |   17 +++++++++++++++++
 svx/sdi/svx.sdi                |   17 +++++++++++++++++
 4 files changed, 42 insertions(+), 2 deletions(-)

New commits:
commit 66f18f543316ee718d5ab454b51fae9f301673f5
Author:     mert <mert.tumer at collabora.com>
AuthorDate: Thu Jan 28 07:19:07 2021 +0300
Commit:     Mert Tumer <mert.tumer at collabora.com>
CommitDate: Mon Mar 1 13:05:52 2021 +0100

    Added .uno:MoveShapeHandle uno command
    
    This is now only available for Draw/Presentation
    It will allow interactive dragging/resizing operations
    via the command. Later it will be implemented for other
    modules too.
    
    Change-Id: Iaed7d25cf4035591083e779c13a6f0227a3b564f
    Signed-off-by: mert <mert.tumer at collabora.com>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110041
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111508
    Tested-by: Jenkins

diff --git a/include/svx/svxids.hrc b/include/svx/svxids.hrc
index 844b23db5cf3..7b2b802bf8f1 100644
--- a/include/svx/svxids.hrc
+++ b/include/svx/svxids.hrc
@@ -1027,8 +1027,11 @@ class SdrAngleItem;
 #define SID_ULINE_VAL_DOUBLE                            (SID_SVX_START + 1197) /* double underline */
 #define SID_ULINE_VAL_DOTTED                            (SID_SVX_START + 1198) /* dotted underline */
 
+#define SID_MOVE_SHAPE_HANDLE                           ( SID_SVX_START + 1199 )
+
 // IMPORTANT NOTE: adjust SID_SVX_FIRSTFREE, when adding new slot id
-#define SID_SVX_FIRSTFREE                               ( SID_SVX_START + 1198 + 1 )
+#define SID_SVX_FIRSTFREE                               ( SID_SVX_START + 1199 + 1 )
+
 
 // Overflow check for slot IDs
 #if SID_SVX_FIRSTFREE > SID_SVX_END
diff --git a/sd/sdi/_drvwsh.sdi b/sd/sdi/_drvwsh.sdi
index 683e52888635..90e37f7f52fe 100644
--- a/sd/sdi/_drvwsh.sdi
+++ b/sd/sdi/_drvwsh.sdi
@@ -2918,5 +2918,8 @@ interface DrawView
         ExecMethod = FuTemporary;
         StateMethod = GetAttrState;
     ]
-
+    SID_MOVE_SHAPE_HANDLE
+    [
+        ExecMethod = FuTemporary ;
+    ]
 }
diff --git a/sd/source/ui/view/drviews2.cxx b/sd/source/ui/view/drviews2.cxx
index d60ebb701298..85feaa826954 100644
--- a/sd/source/ui/view/drviews2.cxx
+++ b/sd/source/ui/view/drviews2.cxx
@@ -88,6 +88,7 @@
 #include <svx/xflgrit.hxx>
 
 #include <tools/diagnose_ex.h>
+#include <tools/UnitConversion.hxx>
 
 #include <unotools/useroptions.hxx>
 
@@ -1489,7 +1490,23 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq)
             }
         }
         break;
+        case SID_MOVE_SHAPE_HANDLE:
+        {
+            const SfxItemSet *pArgs = rReq.GetArgs ();
+            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 = convertTwipToMm100(newPosXTwips->GetValue());
+                const sal_uLong newPosY = convertTwipToMm100(newPosYTwips->GetValue());
+                mpDrawView->MoveShapeHandle(handleNum, Point(newPosX, newPosY));
+                Cancel();
+            }
+            break;
+        }
         case SID_CHAR_DLG_EFFECT:
         case SID_CHAR_DLG:  // BASIC
         {
diff --git a/svx/sdi/svx.sdi b/svx/sdi/svx.sdi
index f66c0a193c13..028e9bdee170 100644
--- a/svx/sdi/svx.sdi
+++ b/svx/sdi/svx.sdi
@@ -12513,3 +12513,20 @@ SdrMetricItem SoftEdgeRadius SID_ATTR_SOFTEDGE_RADIUS
     ToolBoxConfig = FALSE,
     GroupId = SfxGroupId::Document;
 ]
+
+SfxVoidItem MoveShapeHandle SID_MOVE_SHAPE_HANDLE
+(SfxUInt32Item HandleNum FN_PARAM_1 SfxUInt32Item NewPosX FN_PARAM_2 SfxUInt32Item NewPosY FN_PARAM_3)
+[
+    AutoUpdate = FALSE,
+    FastCall = TRUE,
+    ReadOnlyDoc = FALSE,
+    Toggle = FALSE,
+    Container = FALSE,
+    RecordAbsolute = FALSE,
+    RecordPerSet;
+
+    AccelConfig = FALSE,
+    MenuConfig = FALSE,
+    ToolBoxConfig = FALSE,
+    GroupId = SfxGroupId::Format;
+]


More information about the Libreoffice-commits mailing list