diff options
author | Armin Le Grand <Armin.Le.Grand@cib.de> | 2018-05-04 11:21:15 +0200 |
---|---|---|
committer | Armin Le Grand <Armin.Le.Grand@cib.de> | 2018-05-04 14:48:38 +0200 |
commit | 0fe7bda233da3c1f95a82c0050c8f917dc39c22e (patch) | |
tree | dbead2885836e74023813cd2b99760155f5e403d /include | |
parent | b72a31b37f9bdcfd3f59b3256b465bf0fb5a50ca (diff) |
tdf#116879 Separate SdrObjList::Clear() as needed
SdrObjList::Clear() does broadcast the SdrObject
removals and deletions and a SetChanged() to SdrModel.
The old version avoided this in the destructor (with
a comment to not call virtual methods in destructor,
but the problem is more that the ::Notify triggered
works on the SdrPage already in destruction). To allow
calls to Clear() without broadcasting I splitted this
to a impClearSdrObjList(bool bBrodacast) and rename
of ::Clear to ::ClearSdrObjList to get all places.
Adapted all places in the code as needed, already pre-
checked on Linux that this fixes the problem.
Change-Id: Iea46758fb6b57f2b3d9896959a35260c6f6d52d5
Reviewed-on: https://gerrit.libreoffice.org/53839
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Armin Le Grand <Armin.Le.Grand@cib.de>
Diffstat (limited to 'include')
-rw-r--r-- | include/svx/svdpage.hxx | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/include/svx/svdpage.hxx b/include/svx/svdpage.hxx index a4cc40feebd4..fa5364bae022 100644 --- a/include/svx/svdpage.hxx +++ b/include/svx/svdpage.hxx @@ -88,13 +88,24 @@ protected: private: /// simple ActionChildInserted forwarder to have it on a central place static void impChildInserted(SdrObject const & rChild); + + // tdf#116879 Clear SdrObjList, no Undo done. Used from destructor, but also + // from other places. When used from destructor, suppress broadcasts + // to not get callbacks to evtl. derived objects already in destruction + // (e.g. SdrPage) + void impClearSdrObjList(bool bBroadcast); + public: SdrObjList(SdrPage* pNewPage = nullptr); virtual ~SdrObjList(); void CopyObjects(const SdrObjList& rSrcList, SdrModel* pNewModel = nullptr); - /// clean up everything (without Undo) - void Clear(); + + // tdf#116879 clean up everything (without Undo), plus broadcasting + // changes. Split to this call and a private one (impClearSdrObjList) + // that allows cleanup without broadcasting in the destructor + void ClearSdrObjList(); + SdrObjListKind GetListKind() const { return eListKind; } void SetListKind(SdrObjListKind eNewKind) { eListKind=eNewKind; } SdrObjList* GetUpList() const { return pUpList; } |