diff options
author | merttumer <mert.tumer@collabora.com> | 2021-04-02 16:18:05 +0300 |
---|---|---|
committer | Mert Tumer <mert.tumer@collabora.com> | 2021-04-09 08:15:07 +0200 |
commit | a33f16fd4127030a25b4ef0e4e965b8aa07afcb7 (patch) | |
tree | 7ac6ee964d7d82c53a827682eef390eaaa6dd7b7 /svx | |
parent | 47f5876b94d6c2d12df4fd08a92ba21320ca4fba (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>
Diffstat (limited to 'svx')
-rw-r--r-- | svx/sdi/svx.sdi | 2 | ||||
-rw-r--r-- | svx/source/svdraw/svdoedge.cxx | 22 | ||||
-rw-r--r-- | svx/source/svdraw/svdview.cxx | 13 |
3 files changed, 31 insertions, 6 deletions
diff --git a/svx/sdi/svx.sdi b/svx/sdi/svx.sdi index e5107db90048..039c43171a45 100644 --- a/svx/sdi/svx.sdi +++ b/svx/sdi/svx.sdi @@ -12279,7 +12279,7 @@ SfxVoidItem SpellCheckApplySuggestion SID_SPELLCHECK_APPLY_SUGGESTION ] 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 99dee49aa2d2..d767a92bbbf6 100644 --- a/svx/source/svdraw/svdoedge.cxx +++ b/svx/source/svdraw/svdoedge.cxx @@ -1909,7 +1909,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) { @@ -2130,7 +2130,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(); @@ -2153,11 +2153,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_uInt32 requestedOrdNum = -1; + + if (bTiledRendering && pDragStat) + { + auto& glueOptions = pDragStat->GetGlueOptions(); + if (glueOptions.objectOrdNum != -1) + { + requestedOrdNum = static_cast<sal_uInt32>(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() != 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 394b3af6bd06..36fd070e1205 100644 --- a/svx/source/svdraw/svdview.cxx +++ b/svx/source/svdraw/svdview.cxx @@ -1426,7 +1426,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; @@ -1438,7 +1438,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()) @@ -1453,9 +1453,16 @@ bool SdrView::MoveShapeHandle(const sal_uInt32 handleNum, const Point& aEndPoint 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); if (bWasSnapEnabled) |