summaryrefslogtreecommitdiff
path: root/editeng/source
diff options
context:
space:
mode:
authorJulien Nabet <serval2412@yahoo.fr>2021-02-14 21:17:10 +0100
committerCaolán McNamara <caolanm@redhat.com>2021-02-15 10:13:04 +0100
commit3aad3955650edb543d74a4c1e3ebdb1f4d3940b7 (patch)
treeed7d25453d9ca071bf4e91401bfaef43c46897cc /editeng/source
parentd3fdab081863f4a3631319b5af0ca74b98665d4c (diff)
tdf#140414: fix Crash pressing Ctrl-K in input line in Calc
3 0x00007ff38b819d73 in vcl::Window::GetPointerPosPixel() (this=0x0) at vcl/source/window/mouse.cxx:552 4 0x00007ff3925fe7c1 in EditView::GetFieldUnderMousePointer(int&, int&) const (this=0x4c37160, nPara=@0x7ffd982b4f44: 0, nPos=@0x7ffd982b4f40: 57752960) at editeng/source/editeng/editview.cxx:1325 5 0x00007ff3925fe74a in EditView::GetFieldUnderMousePointer() const (this=0x4c37160) at editeng/source/editeng/editview.cxx:1315 6 0x00007ff3925fec4c in EditView::GetFieldAtCursor() const (this=0x4c37160) at editeng/source/editeng/editview.cxx:1384 7 0x00007ff377f6aa55 in ScEditShell::GetURLField() (this=0x37a31a0) at sc/source/ui/view/editsh.cxx:833 Change-Id: Ib369644f26eec4f37a34213f0b0113359a653098 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110884 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'editeng/source')
-rw-r--r--editeng/source/editeng/editview.cxx5
1 files changed, 4 insertions, 1 deletions
diff --git a/editeng/source/editeng/editview.cxx b/editeng/source/editeng/editview.cxx
index 0434b06703b2..1a3f17e61d34 100644
--- a/editeng/source/editeng/editview.cxx
+++ b/editeng/source/editeng/editview.cxx
@@ -1322,7 +1322,10 @@ const SvxFieldItem* EditView::GetField( const Point& rPos, sal_Int32* pPara, sal
const SvxFieldItem* EditView::GetFieldUnderMousePointer( sal_Int32& nPara, sal_Int32& nPos ) const
{
- Point aPos = pImpEditView->GetWindow()->GetPointerPosPixel();
+ auto pWin = pImpEditView->GetWindow();
+ if (!pWin)
+ return nullptr;
+ Point aPos = pWin->GetPointerPosPixel();
aPos = pImpEditView->GetWindow()->PixelToLogic( aPos );
return GetField( aPos, &nPara, &nPos );
}