summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2014-08-05 18:33:56 +0200
committerStephan Bergmann <sbergman@redhat.com>2014-08-05 18:33:56 +0200
commit32de046e05a5907a85d85cee0b293cab858a0400 (patch)
treed7d564ed1595e72cb87a3c330917452b299cadd4 /sw
parent58069f3676ab98b7383c11ff2fd1f17fa4522d77 (diff)
Move SwTxtFrm specific code from ~SwCntntFrm down to ~SwTxtFrm
...to be executed while this is still a SwTxtFrm, not merely a SwCntntFrm. Change-Id: Ia2ce9fff7d7e2562deb4bd099975976312cad6c4
Diffstat (limited to 'sw')
-rw-r--r--sw/source/core/layout/ssfrm.cxx24
-rw-r--r--sw/source/core/text/txtfrm.cxx28
2 files changed, 28 insertions, 24 deletions
diff --git a/sw/source/core/layout/ssfrm.cxx b/sw/source/core/layout/ssfrm.cxx
index 23dcc2bfd60a..e1cb41803a5e 100644
--- a/sw/source/core/layout/ssfrm.cxx
+++ b/sw/source/core/layout/ssfrm.cxx
@@ -432,30 +432,6 @@ SwCntntFrm::~SwCntntFrm()
pRoot->DisallowTurbo();
pRoot->ResetTurbo();
}
- if( IsTxtFrm() && ((SwTxtFrm*)this)->HasFtn() )
- {
- SwTxtNode *pTxtNd = ((SwTxtFrm*)this)->GetTxtNode();
- const SwFtnIdxs &rFtnIdxs = pCNd->GetDoc()->GetFtnIdxs();
- sal_uInt16 nPos;
- sal_uLong nIndex = pCNd->GetIndex();
- rFtnIdxs.SeekEntry( *pTxtNd, &nPos );
- SwTxtFtn* pTxtFtn;
- if( nPos < rFtnIdxs.size() )
- {
- while( nPos && pTxtNd == &(rFtnIdxs[ nPos ]->GetTxtNode()) )
- --nPos;
- if( nPos || pTxtNd != &(rFtnIdxs[ nPos ]->GetTxtNode()) )
- ++nPos;
- }
- while( nPos < rFtnIdxs.size() )
- {
- pTxtFtn = rFtnIdxs[ nPos ];
- if( pTxtFtn->GetTxtNode().GetIndex() > nIndex )
- break;
- pTxtFtn->DelFrms( this );
- ++nPos;
- }
- }
}
}
diff --git a/sw/source/core/text/txtfrm.cxx b/sw/source/core/text/txtfrm.cxx
index 42c27be2a5c5..9da12567a6a6 100644
--- a/sw/source/core/text/txtfrm.cxx
+++ b/sw/source/core/text/txtfrm.cxx
@@ -74,6 +74,7 @@
#include <fldupde.hxx>
#include <IGrammarContact.hxx>
#include <switerator.hxx>
+#include <ftnidx.hxx>
TYPEINIT1( SwTxtFrm, SwCntntFrm );
@@ -368,6 +369,33 @@ SwTxtFrm::~SwTxtFrm()
{
// Remove associated SwParaPortion from pTxtCache
ClearPara();
+
+ SwCntntNode* pCNd;
+ if( 0 != ( pCNd = PTR_CAST( SwCntntNode, GetRegisteredIn() )) &&
+ !pCNd->GetDoc()->IsInDtor() && HasFtn() )
+ {
+ SwTxtNode *pTxtNd = ((SwTxtFrm*)this)->GetTxtNode();
+ const SwFtnIdxs &rFtnIdxs = pCNd->GetDoc()->GetFtnIdxs();
+ sal_uInt16 nPos;
+ sal_uLong nIndex = pCNd->GetIndex();
+ rFtnIdxs.SeekEntry( *pTxtNd, &nPos );
+ SwTxtFtn* pTxtFtn;
+ if( nPos < rFtnIdxs.size() )
+ {
+ while( nPos && pTxtNd == &(rFtnIdxs[ nPos ]->GetTxtNode()) )
+ --nPos;
+ if( nPos || pTxtNd != &(rFtnIdxs[ nPos ]->GetTxtNode()) )
+ ++nPos;
+ }
+ while( nPos < rFtnIdxs.size() )
+ {
+ pTxtFtn = rFtnIdxs[ nPos ];
+ if( pTxtFtn->GetTxtNode().GetIndex() > nIndex )
+ break;
+ pTxtFtn->DelFrms( this );
+ ++nPos;
+ }
+ }
}
const OUString& SwTxtFrm::GetTxt() const