From b0788d530f4c35f683a80ee9070cd8935de4ef95 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= Date: Fri, 5 Dec 2025 08:51:11 +0000 Subject: [PATCH] cid#1399305 Uncaught exception MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit and cid#1399345 Uncaught exception Change-Id: Ibbd255a4aa1ebdc360f94b3030371da7b6a6602f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/195068 Tested-by: Jenkins Reviewed-by: Caolán McNamara --- sw/inc/fmthdft.hxx | 2 ++ sw/source/core/layout/atrfrm.cxx | 14 ++++++++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) 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);