diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2021-10-21 08:25:55 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2021-10-22 09:23:18 +0200 |
commit | 7f35374f1da04b1d6416396dcf63ddb0c7872fd0 (patch) | |
tree | 43f9a0f2f970383d0160037abae01832afdad2ed /sw/source | |
parent | e467baad666142efa251da814f5223b9d7898d76 (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/+/123947
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124044
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Diffstat (limited to 'sw/source')
-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 eba39194a7e0..4e459bfa2e45 100644 --- a/sw/source/uibase/uno/unotxdoc.cxx +++ b/sw/source/uibase/uno/unotxdoc.cxx @@ -3547,6 +3547,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); |