[Libreoffice-commits] core.git: include/svx svx/source
Noel Grandin (via logerrit)
logerrit at kemper.freedesktop.org
Thu Mar 18 19:44:59 UTC 2021
include/svx/svdobj.hxx | 3 +--
svx/source/svdraw/svdpage.cxx | 18 +++++-------------
2 files changed, 6 insertions(+), 15 deletions(-)
New commits:
commit 7385ce6ac788335f15744c104c2b4e095ce90ce8
Author: Noel Grandin <noel at peralex.com>
AuthorDate: Thu Mar 18 16:24:49 2021 +0200
Commit: Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Thu Mar 18 20:44:12 2021 +0100
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 at collabora.co.uk>
diff --git a/include/svx/svdobj.hxx b/include/svx/svdobj.hxx
index 88c00569ab67..38bdc98eea5d 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 d07f40e4f701..c614928f2537 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
More information about the Libreoffice-commits
mailing list