diff options
author | Michael Meeks <michael.meeks@collabora.com> | 2019-12-18 13:31:58 +0000 |
---|---|---|
committer | Michael Meeks <michael.meeks@collabora.com> | 2019-12-18 15:29:11 +0100 |
commit | 46fbc12dac86579708695fddeaf4a3a2f8098955 (patch) | |
tree | 66da4ba31d3eaa211607392d3c0ff4cc814f9bf8 /desktop | |
parent | 30d3862ab40c1527c2579054436ef599df900273 (diff) |
lok: catch and log exceptions during key / mouse event emission.
Change-Id: I2be8219f6b2648f3f0192caeccf8e8b037634dc2
Reviewed-on: https://gerrit.libreoffice.org/85387
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Diffstat (limited to 'desktop')
-rw-r--r-- | desktop/source/lib/init.cxx | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index f97cd6707187..c779682e1d71 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -3071,7 +3071,15 @@ static void doc_postKeyEvent(LibreOfficeKitDocument* pThis, int nType, int nChar return; } - pDoc->postKeyEvent(nType, nCharCode, nKeyCode); + try + { + pDoc->postKeyEvent(nType, nCharCode, nKeyCode); + } + catch (const uno::Exception& exception) + { + SetLastExceptionMsg(exception.Message); + SAL_INFO("lok", "Failed to postKeyEvent " << exception.Message); + } } static void doc_postWindowExtTextInputEvent(LibreOfficeKitDocument* pThis, unsigned nWindowId, int nType, const char* pText) @@ -3546,8 +3554,15 @@ static void doc_postMouseEvent(LibreOfficeKitDocument* pThis, int nType, int nX, SetLastExceptionMsg("Document doesn't support tiled rendering"); return; } - - pDoc->postMouseEvent(nType, nX, nY, nCount, nButtons, nModifier); + try + { + pDoc->postMouseEvent(nType, nX, nY, nCount, nButtons, nModifier); + } + catch (const uno::Exception& exception) + { + SetLastExceptionMsg(exception.Message); + SAL_INFO("lok", "Failed to postMouseEvent " << exception.Message); + } } static void doc_postWindowMouseEvent(LibreOfficeKitDocument* /*pThis*/, unsigned nLOKWindowId, int nType, int nX, int nY, int nCount, int nButtons, int nModifier) |