diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2021-10-21 08:25:55 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2021-10-22 16:31:55 +0200 |
commit | 42865108702f80a829513aef8f45965c508d0a74 (patch) | |
tree | ba5045246f8bc32b22a29a04fdedda54a3136f1c /sw | |
parent | 62f47c26ad096cf088b545f10e14f9d81e2f2cc1 (diff) |
sw: fix crash in SwXTextDocument::postMouseEvent()
From crashreport:
SIG Fatal signal received: SIGSEGV
SwXTextDocument::postMouseEvent(int, int, int, int, int, int)
sw/source/uibase/uno/unotxdoc.cxx:3559
doc_postMouseEvent
desktop/source/lib/init.cxx:4245
Make sure we don't crash when a mouse event is posted on a disposed
document.
Change-Id: I3fb123460b21bf8fe21406d1745f43270102af33
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124060
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/uibase/uno/unotxdoc.cxx | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/sw/source/uibase/uno/unotxdoc.cxx b/sw/source/uibase/uno/unotxdoc.cxx index 6fa6e6a6bd85..a3eeca0341f9 100644 --- a/sw/source/uibase/uno/unotxdoc.cxx +++ b/sw/source/uibase/uno/unotxdoc.cxx @@ -3483,6 +3483,11 @@ void SwXTextDocument::postMouseEvent(int nType, int nX, int nY, int nCount, int SolarMutexGuard aGuard; SwViewShell* pWrtViewShell = m_pDocShell->GetWrtShell(); + if (!pWrtViewShell) + { + return; + } + SwViewOption aOption(*(pWrtViewShell->GetViewOptions())); double fScale = aOption.GetZoom() / (TWIPS_PER_PIXEL * 100.0); |