summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
Diffstat (limited to 'svx')
-rw-r--r--svx/sdi/svx.sdi2
-rw-r--r--svx/source/svdraw/svdoedge.cxx22
-rw-r--r--svx/source/svdraw/svdview.cxx17
3 files changed, 33 insertions, 8 deletions
diff --git a/svx/sdi/svx.sdi b/svx/sdi/svx.sdi
index 8e580d5977c1..a432c7032a7f 100644
--- a/svx/sdi/svx.sdi
+++ b/svx/sdi/svx.sdi
@@ -12515,7 +12515,7 @@ SdrMetricItem SoftEdgeRadius SID_ATTR_SOFTEDGE_RADIUS
]
SfxVoidItem MoveShapeHandle SID_MOVE_SHAPE_HANDLE
-(SfxUInt32Item HandleNum FN_PARAM_1 SfxUInt32Item NewPosX FN_PARAM_2 SfxUInt32Item NewPosY FN_PARAM_3)
+(SfxUInt32Item HandleNum FN_PARAM_1 SfxUInt32Item NewPosX FN_PARAM_2 SfxUInt32Item NewPosY FN_PARAM_3 SfxInt32Item OrdNum FN_PARAM_4)
[
AutoUpdate = FALSE,
FastCall = TRUE,
diff --git a/svx/source/svdraw/svdoedge.cxx b/svx/source/svdraw/svdoedge.cxx
index 4084f1e91dbe..e31e2bf8a85e 100644
--- a/svx/source/svdraw/svdoedge.cxx
+++ b/svx/source/svdraw/svdoedge.cxx
@@ -1911,7 +1911,7 @@ bool SdrEdgeObj::applySpecialDrag(SdrDragStat& rDragStat)
DisconnectFromNode(bDragA);
// look for new connection
- ImpFindConnector(aPointNow, *rDragStat.GetPageView(), *pDraggedOne, pOriginalEdge);
+ ImpFindConnector(aPointNow, *rDragStat.GetPageView(), *pDraggedOne, pOriginalEdge, nullptr, &rDragStat);
if(pDraggedOne->pObj)
{
@@ -2132,7 +2132,7 @@ PointerStyle SdrEdgeObj::GetCreatePointer() const
return PointerStyle::DrawConnect;
}
-bool SdrEdgeObj::ImpFindConnector(const Point& rPt, const SdrPageView& rPV, SdrObjConnection& rCon, const SdrEdgeObj* pThis, OutputDevice* pOut)
+bool SdrEdgeObj::ImpFindConnector(const Point& rPt, const SdrPageView& rPV, SdrObjConnection& rCon, const SdrEdgeObj* pThis, OutputDevice* pOut, SdrDragStat* pDragStat)
{
rCon.ResetVars();
if (pOut==nullptr) pOut=rPV.GetView().GetFirstOutputDevice();
@@ -2155,11 +2155,29 @@ bool SdrEdgeObj::ImpFindConnector(const Point& rPt, const SdrPageView& rPV, SdrO
size_t no=pOL->GetObjCount();
bool bFnd = false;
SdrObjConnection aTestCon;
+ bool bTiledRendering = comphelper::LibreOfficeKit::isActive();
+ bool bHasRequestedOrdNum = false;
+ sal_Int32 requestedOrdNum = -1;
+
+ if (bTiledRendering && pDragStat)
+ {
+ auto& glueOptions = pDragStat->GetGlueOptions();
+ if (glueOptions.objectOrdNum != -1)
+ {
+ requestedOrdNum = glueOptions.objectOrdNum;
+ bHasRequestedOrdNum = true;
+ }
+ }
while (no>0 && !bFnd) {
// issue: group objects on different layers return LayerID=0!
no--;
SdrObject* pObj=pOL->GetObj(no);
+ if (bHasRequestedOrdNum)
+ {
+ if (pObj->GetOrdNumDirect() != static_cast<sal_uInt32>(requestedOrdNum))
+ continue;
+ }
if (rVisLayer.IsSet(pObj->GetLayer()) && pObj->IsVisible() && // only visible objects
(pThis==nullptr || pObj!=static_cast<SdrObject const *>(pThis))) // don't connect it to itself
{
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);