diff --git a/sw/inc/fmthdft.hxx b/sw/inc/fmthdft.hxx index 00feefb3dedc..08158487d318 100644 --- a/sw/inc/fmthdft.hxx +++ b/sw/inc/fmthdft.hxx @@ -36,6 +36,7 @@ class SW_DLLPUBLIC SwFormatHeader final : public SfxPoolItem, public sw::FrameFo { bool m_bActive; ///< Only for controlling (creation of content). + void ImplDestroy(); public: DECLARE_ITEM_TYPE_FUNCTION(SwFormatHeader) SwFormatHeader( bool bOn = false ); @@ -69,6 +70,7 @@ class SW_DLLPUBLIC SwFormatFooter final : public SfxPoolItem, public sw::FrameFo { bool m_bActive; // Only for controlling (creation of content). + void ImplDestroy(); public: DECLARE_ITEM_TYPE_FUNCTION(SwFormatFooter) SwFormatFooter( bool bOn = false ); diff --git a/sw/source/core/layout/atrfrm.cxx b/sw/source/core/layout/atrfrm.cxx index 3fd54049de1b..1d80a2918c9f 100644 --- a/sw/source/core/layout/atrfrm.cxx +++ b/sw/source/core/layout/atrfrm.cxx @@ -516,12 +516,17 @@ SwFormatHeader::SwFormatHeader( bool bOn ) { } - SwFormatHeader::~SwFormatHeader() +void SwFormatHeader::ImplDestroy() { if ( GetHeaderFormat() ) lcl_DelHFFormat( this, GetHeaderFormat() ); } +SwFormatHeader::~SwFormatHeader() +{ + suppress_fun_call_w_exception(ImplDestroy()); +} + bool SwFormatHeader::operator==( const SfxPoolItem& rAttr ) const { assert(SfxPoolItem::operator==(rAttr)); @@ -575,12 +580,17 @@ SwFormatFooter::SwFormatFooter( bool bOn ) { } - SwFormatFooter::~SwFormatFooter() +void SwFormatFooter::ImplDestroy() { if ( GetFooterFormat() ) lcl_DelHFFormat( this, GetFooterFormat() ); } +SwFormatFooter::~SwFormatFooter() +{ + suppress_fun_call_w_exception(ImplDestroy()); +} + void SwFormatFooter::RegisterToFormat( SwFormat& rFormat ) { rFormat.Add(*this);