From 3c033146b1ef61676de8379c56ea538b1cbdf826 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Sat, 3 Feb 2024 07:38:34 +0000 Subject: cid#1455212 Uncaught exception MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit and cid#1401342 Uncaught exception Change-Id: I77c2303ceb25301d85bfc9f8f6dc9eb8f4c4494a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162945 Tested-by: Jenkins Reviewed-by: Caolán McNamara --- cui/source/inc/treeopt.hxx | 2 ++ cui/source/options/treeopt.cxx | 8 +++++++- sw/source/ui/fldui/fldedt.cxx | 7 ++++++- sw/source/uibase/inc/fldedt.hxx | 3 +++ 4 files changed, 18 insertions(+), 2 deletions(-) diff --git a/cui/source/inc/treeopt.hxx b/cui/source/inc/treeopt.hxx index 307c70f9edd5..6d07d0981d5a 100644 --- a/cui/source/inc/treeopt.hxx +++ b/cui/source/inc/treeopt.hxx @@ -210,6 +210,8 @@ private: int applySearchFilter(const OUString& rSearchTerm); + void ImplDestroy(); + // Common initialization OfaTreeOptionsDialog(weld::Window* pParent, bool fromExtensionManager); diff --git a/cui/source/options/treeopt.cxx b/cui/source/options/treeopt.cxx index 8bfbde910e10..7d0ae590b49b 100644 --- a/cui/source/options/treeopt.cxx +++ b/cui/source/options/treeopt.cxx @@ -86,6 +86,7 @@ #include #include #include +#include #include #include #include @@ -526,7 +527,7 @@ OfaTreeOptionsDialog::OfaTreeOptionsDialog(weld::Window* pParent, std::u16string ActivateLastSelection(); } -OfaTreeOptionsDialog::~OfaTreeOptionsDialog() +void OfaTreeOptionsDialog::ImplDestroy() { xCurrentPageEntry.reset(); @@ -582,6 +583,11 @@ OfaTreeOptionsDialog::~OfaTreeOptionsDialog() deleteGroupNames(); } +OfaTreeOptionsDialog::~OfaTreeOptionsDialog() +{ + suppress_fun_call_w_exception(ImplDestroy()); +} + OptionsPageInfo* OfaTreeOptionsDialog::AddTabPage( sal_uInt16 nId, const OUString& rPageName, sal_uInt16 nGroup ) { diff --git a/sw/source/ui/fldui/fldedt.cxx b/sw/source/ui/fldui/fldedt.cxx index cfa614b712ab..94273c93dcae 100644 --- a/sw/source/ui/fldui/fldedt.cxx +++ b/sw/source/ui/fldui/fldedt.cxx @@ -222,12 +222,17 @@ SfxTabPage* SwFieldEditDlg::CreatePage(sal_uInt16 nGroup) return GetTabPage(); } -SwFieldEditDlg::~SwFieldEditDlg() +void SwFieldEditDlg::ImplDestroy() { SwViewShell::SetCareDialog(nullptr); m_pSh->EnterStdMode(); } +SwFieldEditDlg::~SwFieldEditDlg() +{ + suppress_fun_call_w_exception(ImplDestroy()); +} + void SwFieldEditDlg::EnableInsert(bool bEnable) { if( bEnable && m_pSh->IsReadOnlyAvailable() && m_pSh->HasReadonlySel() ) diff --git a/sw/source/uibase/inc/fldedt.hxx b/sw/source/uibase/inc/fldedt.hxx index 635065580985..2c465aefad0a 100644 --- a/sw/source/uibase/inc/fldedt.hxx +++ b/sw/source/uibase/inc/fldedt.hxx @@ -41,6 +41,9 @@ class SwFieldEditDlg final : public SfxSingleTabDialogController SfxTabPage* CreatePage(sal_uInt16 nGroup); void EnsureSelection(SwField *pCurField, SwFieldMgr &rMgr); + + void ImplDestroy(); + public: SwFieldEditDlg(SwView const & rVw); -- cgit