summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Stahl <Michael.Stahl@cib.de>2018-06-01 21:19:07 +0200
committerMichael Stahl <Michael.Stahl@cib.de>2018-06-08 19:40:38 +0200
commit0806206af61e0111d4547bc617f908f8ed4c3c70 (patch)
tree22537f7aa8223140d6853c504f83788264d1cced
parent7c3d347b4fc02e1c057d0e500b4630034b16ca4b (diff)
sw_redlinehide: SwContentFrame::DestroyImpl()
Change-Id: I4539ef0a7dc04de1c87cf6f54ca319dbdc719755
-rw-r--r--sw/source/core/layout/ssfrm.cxx11
1 files changed, 8 insertions, 3 deletions
diff --git a/sw/source/core/layout/ssfrm.cxx b/sw/source/core/layout/ssfrm.cxx
index 5ec16d3509d0..7be4a5615a5d 100644
--- a/sw/source/core/layout/ssfrm.cxx
+++ b/sw/source/core/layout/ssfrm.cxx
@@ -414,9 +414,14 @@ SwContentFrame::SwContentFrame( SwContentNode * const pContent, SwFrame* pSib )
void SwContentFrame::DestroyImpl()
{
- const SwContentNode* pCNd;
- if( nullptr != ( pCNd = dynamic_cast<SwContentNode*>( GetRegisteredIn() ) ) &&
- !pCNd->GetDoc()->IsInDtor() )
+ const SwContentNode* pCNd(dynamic_cast<SwContentNode*>(GetDep()));
+ if (nullptr == pCNd && IsTextFrame())
+ {
+ pCNd = static_cast<SwTextFrame*>(this)->GetTextNodeFirst();
+ }
+ // IsInDtor shouldn't be happening with ViewShell owning layout
+ assert(nullptr == pCNd || !pCNd->GetDoc()->IsInDtor());
+ if (nullptr != pCNd && !pCNd->GetDoc()->IsInDtor())
{
//Unregister from root if I'm still in turbo there.
SwRootFrame *pRoot = getRootFrame();