sc/source/ui/formdlg/formula.cxx | 7 ++++++- sc/source/ui/inc/formula.hxx | 3 ++- sfx2/source/doc/sfxbasemodel.cxx | 16 +++++++++++----- 3 files changed, 19 insertions(+), 7 deletions(-)
New commits: commit da09567b4b741433c8bfc3739f1fcd24b2435058 Author: Caolán McNamara <caolan.mcnam...@collabora.com> AuthorDate: Thu Jul 31 19:11:23 2025 +0100 Commit: Caolán McNamara <caolan.mcnam...@collabora.com> CommitDate: Fri Aug 1 17:14:47 2025 +0200 cid#1401342 silence Uncaught exception and cid#1399049 Uncaught exception Change-Id: I451043e0af61dcb4ef38c947da79de11263b0048 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/188709 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com> diff --git a/sc/source/ui/formdlg/formula.cxx b/sc/source/ui/formdlg/formula.cxx index 826facdf49c7..1fee98e14e46 100644 --- a/sc/source/ui/formdlg/formula.cxx +++ b/sc/source/ui/formdlg/formula.cxx @@ -229,7 +229,12 @@ void ScFormulaDlg::fill() pScMod->SetRefInputHdl(nullptr); } -ScFormulaDlg::~ScFormulaDlg() COVERITY_NOEXCEPT_FALSE +ScFormulaDlg::~ScFormulaDlg() +{ + suppress_fun_call_w_exception(ImplDestroy()); +} + +void ScFormulaDlg::ImplDestroy() { ScFormEditData* pData = m_pViewShell->GetFormEditData(); diff --git a/sc/source/ui/inc/formula.hxx b/sc/source/ui/inc/formula.hxx index cd94f2a26d56..8af7c0f4d18b 100644 --- a/sc/source/ui/inc/formula.hxx +++ b/sc/source/ui/inc/formula.hxx @@ -47,7 +47,7 @@ class ScFormulaDlg final : public formula::FormulaDlg, public: ScFormulaDlg( SfxBindings* pB, SfxChildWindow* pCW, weld::Window* pParent, const ScViewData& rViewData, const formula::IFunctionManager* _pFunctionMgr); - virtual ~ScFormulaDlg() COVERITY_NOEXCEPT_FALSE override; + virtual ~ScFormulaDlg() override; // IFormulaEditorHelper virtual void notifyChange() override; @@ -95,6 +95,7 @@ public: virtual void ViewShellChanged() override; private: + void ImplDestroy(); virtual void RefInputStart( formula::RefEdit* pEdit, formula::RefButton* pButton = nullptr ) override; static void SaveLRUEntry(const ScFuncDesc* pFuncDesc); diff --git a/sfx2/source/doc/sfxbasemodel.cxx b/sfx2/source/doc/sfxbasemodel.cxx index 66a78277b867..26cab54823ca 100644 --- a/sfx2/source/doc/sfxbasemodel.cxx +++ b/sfx2/source/doc/sfxbasemodel.cxx @@ -73,6 +73,7 @@ #include <comphelper/propertyvalue.hxx> #include <comphelper/sequenceashashmap.hxx> #include <comphelper/namedvaluecollection.hxx> +#include <o3tl/deleter.hxx> #include <o3tl/safeint.hxx> #include <o3tl/string_view.hxx> #include <svl/itemset.hxx> @@ -4233,11 +4234,7 @@ namespace sfx::intern { ~ViewCreationGuard() { - if ( !m_bSuccess && m_aWeakFrame && !m_aWeakFrame->GetCurrentDocument() ) - { - m_aWeakFrame->SetFrameInterface_Impl( nullptr ); - m_aWeakFrame->DoClose(); - } + suppress_fun_call_w_exception(ImplDestroy()); } void takeFrameOwnership( SfxFrame* i_pFrame ) @@ -4255,6 +4252,15 @@ namespace sfx::intern { private: bool m_bSuccess; SfxFrameWeakRef m_aWeakFrame; + + void ImplDestroy() + { + if ( !m_bSuccess && m_aWeakFrame && !m_aWeakFrame->GetCurrentDocument() ) + { + m_aWeakFrame->SetFrameInterface_Impl( nullptr ); + m_aWeakFrame->DoClose(); + } + } }; }