summaryrefslogtreecommitdiff
path: root/sw/source/core/layout/pagechg.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sw/source/core/layout/pagechg.cxx')
-rw-r--r--sw/source/core/layout/pagechg.cxx13
1 files changed, 12 insertions, 1 deletions
diff --git a/sw/source/core/layout/pagechg.cxx b/sw/source/core/layout/pagechg.cxx
index 38ed77b112b0..263facb9c8c2 100644
--- a/sw/source/core/layout/pagechg.cxx
+++ b/sw/source/core/layout/pagechg.cxx
@@ -45,6 +45,9 @@
#include <tgrditem.hxx>
#include <viewopt.hxx>
#include <docsh.hxx>
+#include <wrtsh.hxx>
+#include <view.hxx>
+#include <edtwin.hxx>
#include "viewimp.hxx"
#include "viewopt.hxx"
@@ -277,6 +280,15 @@ SwPageFrm::SwPageFrm( SwFrmFmt *pFmt, SwFrm* pSib, SwPageDesc *pPgDsc ) :
SwPageFrm::~SwPageFrm()
{
+ // Cleanup the header-footer controls in the SwEditWin
+ ViewShell* pSh = getRootFrm()->GetCurrShell();
+ SwWrtShell* pWrtSh = dynamic_cast< SwWrtShell* >( pSh );
+ if ( pWrtSh )
+ {
+ SwEditWin& rEditWin = pWrtSh->GetView().GetEditWin();
+ rEditWin.RemoveHeaderFooterControls( this );
+ }
+
//FlyContainer entleeren, delete der Flys uebernimmt der Anchor
//(Basisklasse SwFrm)
if ( pSortedObjs )
@@ -299,7 +311,6 @@ SwPageFrm::~SwPageFrm()
SwDoc *pDoc = GetFmt() ? GetFmt()->GetDoc() : NULL;
if( pDoc && !pDoc->IsInDtor() )
{
- ViewShell *pSh = getRootFrm()->GetCurrShell();
if ( pSh )
{
SwViewImp *pImp = pSh->Imp();