elide SetParentAtSdrObjectFromSdrObjList

the indirection just makes the code harder to follow

Change-Id: I4046a822972d729ecfc9a9897bfdac146519dbd2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112678
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
diff --git a/include/svx/svdobj.hxx b/include/svx/svdobj.hxx
index 88c0056..38bdc98 100644
--- a/include/svx/svdobj.hxx
+++ b/include/svx/svdobj.hxx
@@ -261,6 +261,7 @@ class SVXCORE_DLLPUBLIC SdrObject : public SfxListener, public tools::WeakBase
{
private:
    friend class                SdrObjListIter;
    friend class                SdrObjList;
    friend class                SdrVirtObj;
    friend class                SdrRectObj;

@@ -306,8 +307,6 @@ public:
    SdrObject* getParentSdrObjectFromSdrObject() const;

private:
    // only allow SetParentAtSdrObjectFromSdrObjList to call setParentOfSdrObject
    friend void SetParentAtSdrObjectFromSdrObjList(SdrObject& rSdrObject, SdrObjList* pNew);
    SVX_DLLPRIVATE void setParentOfSdrObject(SdrObjList* pNew);

public:
diff --git a/svx/source/svdraw/svdpage.cxx b/svx/source/svdraw/svdpage.cxx
index d07f40e..c614928f 100644
--- a/svx/source/svdraw/svdpage.cxx
+++ b/svx/source/svdraw/svdpage.cxx
@@ -60,14 +60,6 @@ using namespace ::com::sun::star;

const sal_Int32 InitialObjectContainerCapacity (64);

////////////////////////////////////////////////////////////////////////////////////////////////////
// helper to allow changing parent at SdrObject, but only from SdrObjList

void SetParentAtSdrObjectFromSdrObjList(SdrObject& rSdrObject, SdrObjList* pNew)
{
    rSdrObject.setParentOfSdrObject(pNew);
}

//////////////////////////////////////////////////////////////////////////////

SdrObjList::SdrObjList()
@@ -305,7 +297,7 @@ void SdrObjList::NbcInsertObject(SdrObject* pObj, size_t nPos)

    if (nPos<nCount) mbObjOrdNumsDirty=true;
    pObj->SetOrdNum(nPos);
    SetParentAtSdrObjectFromSdrObjList(*pObj, this);
    pObj->setParentOfSdrObject(this);

    // Inform the parent about change to allow invalidations at
    // evtl. existing parent visualisations
@@ -404,7 +396,7 @@ SdrObject* SdrObjList::NbcRemoveObject(size_t nObjNum)

        // tdf#121022 Do first remove from SdrObjList - InsertedStateChange
        // relies now on IsInserted which uses getParentSdrObjListFromSdrObject
        SetParentAtSdrObjectFromSdrObjList(*pObj, nullptr);
        pObj->setParentOfSdrObject(nullptr);

        // calls UserCall, among other
        pObj->InsertedStateChange();
@@ -451,7 +443,7 @@ SdrObject* SdrObjList::RemoveObject(size_t nObjNum)

        // tdf#121022 Do first remove from SdrObjList - InsertedStateChange
        // relies now on IsInserted which uses getParentSdrObjListFromSdrObject
        SetParentAtSdrObjectFromSdrObjList(*pObj, nullptr);
        pObj->setParentOfSdrObject(nullptr);

        // calls, among other things, the UserCall
        pObj->InsertedStateChange();
@@ -503,7 +495,7 @@ SdrObject* SdrObjList::ReplaceObject(SdrObject* pNewObj, size_t nObjNum)
        }

        // Change parent and replace in SdrObjList
        SetParentAtSdrObjectFromSdrObjList(*pObj, nullptr);
        pObj->setParentOfSdrObject(nullptr);
        ReplaceObjectInContainer(*pNewObj,nObjNum);

        // tdf#121022 InsertedStateChange uses the parent
@@ -519,7 +511,7 @@ SdrObject* SdrObjList::ReplaceObject(SdrObject* pNewObj, size_t nObjNum)
        // Setup data at new SdrObject - it already *is* inserted to
        // the SdrObjList due to 'ReplaceObjectInContainer' above
        pNewObj->SetOrdNum(nObjNum);
        SetParentAtSdrObjectFromSdrObjList(*pNewObj, this);
        pNewObj->setParentOfSdrObject(this);

        // Inform the parent about change to allow invalidations at
        // evtl. existing parent visualisations, but also react on