summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sw/source/core/inc/flowfrm.hxx1
-rw-r--r--sw/source/core/layout/flowfrm.cxx21
-rw-r--r--sw/source/core/layout/sectfrm.cxx2
-rw-r--r--sw/source/core/text/frmform.cxx2
4 files changed, 24 insertions, 2 deletions
diff --git a/sw/source/core/inc/flowfrm.hxx b/sw/source/core/inc/flowfrm.hxx
index 25a7502ea7a3..32542e8b7ce9 100644
--- a/sw/source/core/inc/flowfrm.hxx
+++ b/sw/source/core/inc/flowfrm.hxx
@@ -145,6 +145,7 @@ protected:
public:
SwFlowFrm( SwFrm &rFrm );
+ virtual ~SwFlowFrm();
const SwFrm *GetFrm() const { return &rThis; }
SwFrm *GetFrm() { return &rThis; }
diff --git a/sw/source/core/layout/flowfrm.cxx b/sw/source/core/layout/flowfrm.cxx
index 24f1b518e912..15c678e4fe5a 100644
--- a/sw/source/core/layout/flowfrm.cxx
+++ b/sw/source/core/layout/flowfrm.cxx
@@ -87,12 +87,33 @@ SwFlowFrm::SwFlowFrm( SwFrm &rFrm ) :
bFlyLock( false )
{}
+SwFlowFrm::~SwFlowFrm()
+{
+ if (m_pFollow)
+ {
+ m_pFollow->m_pPrecede = 0;
+ }
+ if (m_pPrecede)
+ {
+ m_pPrecede->m_pFollow = 0;
+ }
+}
void SwFlowFrm::SetFollow(SwFlowFrm *const pFollow)
{
+ if (m_pFollow)
+ {
+ assert(this == m_pFollow->m_pPrecede);
+ m_pFollow->m_pPrecede = 0;
+ }
m_pFollow = pFollow;
if (m_pFollow != NULL)
{
+ if (m_pFollow->m_pPrecede) // re-chaining pFollow?
+ {
+ assert(m_pFollow == m_pFollow->m_pPrecede->m_pFollow);
+ m_pFollow->m_pPrecede->m_pFollow = 0;
+ }
m_pFollow->m_pPrecede = this;
}
}
diff --git a/sw/source/core/layout/sectfrm.cxx b/sw/source/core/layout/sectfrm.cxx
index 581c1239732f..4ff80e14fc93 100644
--- a/sw/source/core/layout/sectfrm.cxx
+++ b/sw/source/core/layout/sectfrm.cxx
@@ -222,7 +222,7 @@ void SwSectionFrm::DelEmpty( sal_Bool bRemove )
}
else if( HasFollow() )
GetFollow()->bIsFollow = sal_False;
- m_pFollow = NULL;
+ SetFollow(0);
if( pUp )
{
Frm().Height( 0 );
diff --git a/sw/source/core/text/frmform.cxx b/sw/source/core/text/frmform.cxx
index 1b3418725d37..0731b1021abf 100644
--- a/sw/source/core/text/frmform.cxx
+++ b/sw/source/core/text/frmform.cxx
@@ -680,8 +680,8 @@ SwCntntFrm *SwTxtFrm::JoinFrm()
}
}
pFoll->Cut();
+ SetFollow(pNxt);
delete pFoll;
- m_pFollow = pNxt;
return pNxt;
}