diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2024-08-13 16:58:50 +0500 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2024-08-13 17:26:50 +0200 |
commit | 97fa167baa062ef4d26053924527d114e0394fff (patch) | |
tree | efe333dd949bfa7fbe941ad30de958fa15a2f00a /sw | |
parent | 2c2097a826f907cc5c70600c6c71f1d0a9eaeded (diff) |
Handle possible exceptions in SwView::ImpSetVerb
This reportedly may crash on unhandled exception, with the following stack:
KernelBase.dll!00007ffaa227fabc()
[External Code]
emboleobj.dll!OleComponent::GetVerbList() Line 1013
at D:\lo\embeddedobj\source\msole\olecomponent.cxx(1013)
emboleobj.dll!OleEmbeddedObject::getSupportedVerbs() Line 1000
at D:\lo\embeddedobj\source\msole\oleembed.cxx(1000)
swlo.dll!SwView::ImpSetVerb(SelectionType nSelType) Line 162
at D:\lo\sw\source\uibase\uiview\view.cxx(162)
swlo.dll!SwView::SelectShell() Line 309
at D:\lo\sw\source\uibase\uiview\view.cxx(309)
swlo.dll!SwView::AttrChangedNotify(LinkParamNone * __formal) Line 574
at D:\lo\sw\source\uibase\uiview\view.cxx(574)
[Inline Frame] swlo.dll!Link<LinkParamNone *,void>::Call(LinkParamNone *) Line 111
at D:\lo\include\tools\link.hxx(111)
swlo.dll!SwCursorShell::CallChgLnk() Line 2903
at D:\lo\sw\source\core\crsr\crsrsh.cxx(2903)
swlo.dll!SwRootFrame::EndAllAction() Line 1941
at D:\lo\sw\source\core\layout\pagechg.cxx(1941)
swlo.dll!UnoActionContext::~UnoActionContext() Line 212
at D:\lo\sw\source\core\unocore\unoobj2.cxx(212)
swlo.dll!SwXFrame::setPropertyValue(const rtl::OUString & rPropertyName, const com::sun::star::uno::Any & _rValue) Line 1605
at D:\lo\sw\source\core\unocore\unoframe.cxx(1605)
mscx_uno.dll!`anonymous namespace'::cpp_call(bridges::cpp_uno::shared::UnoInterfaceProxy * pThis, bridges::cpp_uno::shared::VtableSlot aVtableSlot, _typelib_TypeDescriptionReference * pReturnTypeRef, long nParams, _typelib_MethodParameter * pParams, void * pUnoReturn, void * * pUnoArgs, _uno_Any * * ppUnoExc) Line 214
at D:\lo\bridges\source\cpp_uno\msvc_win32_x86-64\uno2cpp.cxx(214)
mscx_uno.dll!unoInterfaceProxyDispatch(_uno_Interface * pUnoI, const _typelib_TypeDescription * pMemberTD, void * pReturn, void * * pArgs, _uno_Any * * ppException) Line 430
at D:\lo\bridges\source\cpp_uno\msvc_win32_x86-64\uno2cpp.cxx(430)
binaryurplo.dll!binaryurp::IncomingRequest::execute_throw(binaryurp::BinaryAny * returnValue, std::vector<binaryurp::BinaryAny,std::allocator<binaryurp::BinaryAny> > * outArguments) Line 239
at D:\lo\binaryurp\source\incomingrequest.cxx(239)
binaryurplo.dll!binaryurp::IncomingRequest::execute() Line 79
at D:\lo\binaryurp\source\incomingrequest.cxx(79)
binaryurplo.dll!request(void * pThreadSpecificData) Line 84
at D:\lo\binaryurp\source\reader.cxx(84)
cppu3.dll!cppu_threadpool::JobQueue::enter(const void * nDisposeId, bool bReturnWhenNoJob) Line 101
at D:\lo\cppu\source\threadpool\jobqueue.cxx(101)
cppu3.dll!cppu_threadpool::ORequestThread::run() Line 169
at D:\lo\cppu\source\threadpool\thread.cxx(169)
cppu3.dll!threadFunc(void * param) Line 190
at D:\lo\include\osl\thread.hxx(190)
sal3.dll!oslWorkerWrapperFunction(void * pData) Line 67
at D:\lo\sal\osl\w32\thread.cxx(67)
Change-Id: Ifef15938c7986c4179d61cfa07973ad9b13d4ad4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171823
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Tested-by: Jenkins
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/uibase/uiview/view.cxx | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/sw/source/uibase/uiview/view.cxx b/sw/source/uibase/uiview/view.cxx index 1bd82e27f0dd..046ef7c41490 100644 --- a/sw/source/uibase/uiview/view.cxx +++ b/sw/source/uibase/uiview/view.cxx @@ -26,6 +26,7 @@ #include <stdlib.h> #include <hintids.hxx> +#include <comphelper/diagnose_ex.hxx> #include <comphelper/string.hxx> #include <comphelper/lok.hxx> #include <o3tl/any.hxx> @@ -149,7 +150,7 @@ SfxDispatcher &SwView::GetDispatcher() void SwView::ImpSetVerb( SelectionType nSelType ) { - bool bResetVerbs = m_bVerbsActive; + Sequence<embed::VerbDescriptor> newVerbs; if ( !GetViewFrame().GetFrame().IsInPlace() && (SelectionType::Ole|SelectionType::Graphic) & nSelType ) { @@ -158,16 +159,21 @@ void SwView::ImpSetVerb( SelectionType nSelType ) { if ( nSelType & SelectionType::Ole ) { - SetVerbs( GetWrtShell().GetOLEObject()->getSupportedVerbs() ); - m_bVerbsActive = true; - bResetVerbs = false; + try + { + newVerbs = GetWrtShell().GetOLEObject()->getSupportedVerbs(); + } + catch (css::uno::Exception&) + { + DBG_UNHANDLED_EXCEPTION("sw.ui", "Failed to retrieve supported verbs"); + } } } } - if ( bResetVerbs ) + if (m_bVerbsActive || newVerbs.hasElements()) { - SetVerbs( Sequence< embed::VerbDescriptor >() ); - m_bVerbsActive = false; + SetVerbs(newVerbs); + m_bVerbsActive = newVerbs.hasElements(); } } |