editeng/source/editeng/editview.cxx |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

New commits:
commit 3aad3955650edb543d74a4c1e3ebdb1f4d3940b7
Author:     Julien Nabet <[email protected]>
AuthorDate: Sun Feb 14 21:17:10 2021 +0100
Commit:     Caolán McNamara <[email protected]>
CommitDate: Mon Feb 15 10:13:04 2021 +0100

    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 <[email protected]>

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 );
 }
_______________________________________________
Libreoffice-commits mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to