diff options
author | Caolán McNamara <caolan.mcnamara@collabora.com> | 2024-02-03 07:38:34 +0000 |
---|---|---|
committer | Caolán McNamara <caolan.mcnamara@collabora.com> | 2024-02-04 08:50:56 +0100 |
commit | 3c033146b1ef61676de8379c56ea538b1cbdf826 (patch) | |
tree | 59dcd5fce88bdffda71f6019c2c4b0b2954c1147 | |
parent | cid#1591493 Unchecked return value (diff) | |
download | core-3c033146b1ef61676de8379c56ea538b1cbdf826.tar.gz core-3c033146b1ef61676de8379c56ea538b1cbdf826.zip |
cid#1455212 Uncaught exception
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 <caolan.mcnamara@collabora.com>
-rw-r--r-- | cui/source/inc/treeopt.hxx | 2 | ||||
-rw-r--r-- | cui/source/options/treeopt.cxx | 8 | ||||
-rw-r--r-- | sw/source/ui/fldui/fldedt.cxx | 7 | ||||
-rw-r--r-- | 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 <editeng/optitems.hxx> #include <editeng/unolingu.hxx> #include <linguistic/misc.hxx> +#include <o3tl/deleter.hxx> #include <officecfg/Office/OptionsDialog.hxx> #include <sfx2/app.hxx> #include <sfx2/dispatch.hxx> @@ -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); |