summaryrefslogtreecommitdiff
path: root/sw/source/core/layout/colfrm.cxx
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2015-04-23 22:52:39 +0200
committerMichael Stahl <mstahl@redhat.com>2015-04-24 12:22:01 +0200
commit135e4d5c730b8b252eab3e375580a3a73d8204e6 (patch)
tree963acb55d8d7157e3ee98e9a65e823017591902e /sw/source/core/layout/colfrm.cxx
parent4e353190b68f3a89c43b3861444dd2dd6b02a6e0 (diff)
related: tdf#90820 refactor SwFrm destruction
Move all logic out of destructors, so it cannot happen any more that members of a sub-class are accessed from a superclass destructor, when those members are already dead. Logic is now in virtual DestroyImpl() methods. All SwFrms must be deleted with SwFrm::DestroySwFrm(). Change-Id: Icec5b12e12d5a2d955cb5844d7d4f7ac85ab79cd
Diffstat (limited to 'sw/source/core/layout/colfrm.cxx')
-rw-r--r--sw/source/core/layout/colfrm.cxx10
1 files changed, 8 insertions, 2 deletions
diff --git a/sw/source/core/layout/colfrm.cxx b/sw/source/core/layout/colfrm.cxx
index c012feac54f0..23ef755e299a 100644
--- a/sw/source/core/layout/colfrm.cxx
+++ b/sw/source/core/layout/colfrm.cxx
@@ -41,7 +41,7 @@ SwColumnFrm::SwColumnFrm( SwFrmFmt *pFmt, SwFrm* pSib ):
SetMaxFtnHeight( LONG_MAX );
}
-SwColumnFrm::~SwColumnFrm()
+void SwColumnFrm::DestroyImpl()
{
SwFrmFmt *pFmt = GetFmt();
SwDoc *pDoc;
@@ -52,6 +52,12 @@ SwColumnFrm::~SwColumnFrm()
pDoc->GetDfltFrmFmt()->Add( this );
pDoc->DelFrmFmt( pFmt );
}
+
+ SwFtnBossFrm::DestroyImpl();
+}
+
+SwColumnFrm::~SwColumnFrm()
+{
}
static void lcl_RemoveColumns( SwLayoutFrm *pCont, sal_uInt16 nCnt )
@@ -71,7 +77,7 @@ static void lcl_RemoveColumns( SwLayoutFrm *pCont, sal_uInt16 nCnt )
{
SwColumnFrm *pTmp = static_cast<SwColumnFrm*>(pColumn->GetPrev());
pColumn->Cut();
- delete pColumn; //format is going to be destroyed in the DTor if needed.
+ SwFrm::DestroyFrm(pColumn); //format is going to be destroyed in the DTor if needed.
pColumn = pTmp;
}
}