summaryrefslogtreecommitdiff
path: root/svx/source/svdraw/svdview.cxx
diff options
context:
space:
mode:
authormerttumer <mert.tumer@collabora.com>2021-04-02 16:18:05 +0300
committerMert Tumer <mert.tumer@collabora.com>2021-04-20 06:52:26 +0200
commitb18bff18785cc194f9918f6bdf000069523827ef (patch)
treeff3fcbb5b90a5af07f4549006d80cdf3d072705b /svx/source/svdraw/svdview.cxx
parent7f26b1b47819754ed5461517300346961a5bbbe4 (diff)
lok: Pass object ord num in the uno command
When multiple objects' glue points collide the ordnum will be used to decide which glue point to connect to for the connectors. Without that the default logic chooses the lowest ordered object which is searched and found in the object list Change-Id: I64579d28bbe6cbd92bab745838fe2995585b6a3f Signed-off-by: merttumer <mert.tumer@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113517 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114032 Tested-by: Jenkins
Diffstat (limited to 'svx/source/svdraw/svdview.cxx')
-rw-r--r--svx/source/svdraw/svdview.cxx17
1 files changed, 12 insertions, 5 deletions
diff --git a/svx/source/svdraw/svdview.cxx b/svx/source/svdraw/svdview.cxx
index c07eee69cee3..2cbed57bb1c2 100644
--- a/svx/source/svdraw/svdview.cxx
+++ b/svx/source/svdraw/svdview.cxx
@@ -1407,7 +1407,7 @@ bool SdrView::BegMark(const Point& rPnt, bool bAddMark, bool bUnmark)
}
}
-bool SdrView::MoveShapeHandle(const sal_uInt32 handleNum, const Point& aEndPoint)
+bool SdrView::MoveShapeHandle(const sal_uInt32 handleNum, const Point& aEndPoint, const sal_Int32 aObjectOrdNum)
{
if (GetHdlList().IsMoveOutside())
return false;
@@ -1419,7 +1419,7 @@ bool SdrView::MoveShapeHandle(const sal_uInt32 handleNum, const Point& aEndPoint
if (pHdl == nullptr)
return false;
- const SdrDragStat& rDragStat = GetDragStat();
+ SdrDragStat& rDragStat = const_cast<SdrDragStat&>(GetDragStat());
// start dragging
BegDragObj(pHdl->GetPos(), nullptr, pHdl, 0);
if (!IsDragObj())
@@ -1430,15 +1430,22 @@ bool SdrView::MoveShapeHandle(const sal_uInt32 handleNum, const Point& aEndPoint
// switch snapping off
if(!bWasNoSnap)
- const_cast<SdrDragStat&>(rDragStat).SetNoSnap();
+ rDragStat.SetNoSnap();
if(bWasSnapEnabled)
SetSnapEnabled(false);
- MovAction(aEndPoint);
+ if (aObjectOrdNum != -1)
+ {
+ rDragStat.GetGlueOptions().objectOrdNum = aObjectOrdNum;
+ }
+ MovDragObj(aEndPoint);
EndDragObj();
+ // Clear Glue Options
+ rDragStat.GetGlueOptions().objectOrdNum = -1;
+
if (!bWasNoSnap)
- const_cast<SdrDragStat&>(rDragStat).SetNoSnap(bWasNoSnap);
+ rDragStat.SetNoSnap(bWasNoSnap);
if (bWasSnapEnabled)
SetSnapEnabled(bWasSnapEnabled);