sc/source/ui/view/editsh.cxx |   15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

New commits:
commit 7c9a40f7cf996ab2ad15d595a262698435be42e0
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Fri Oct 9 15:34:27 2020 +0100
Commit:     Caolán McNamara <caol...@redhat.com>
CommitDate: Fri Oct 9 18:08:30 2020 +0200

    EditView may not have a Window
    
    Change-Id: I0b1a87bab8fbabd24962efd6d42e12a2c922de54
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104124
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caol...@redhat.com>

diff --git a/sc/source/ui/view/editsh.cxx b/sc/source/ui/view/editsh.cxx
index 83e4adaf815f..e076c762be1d 100644
--- a/sc/source/ui/view/editsh.cxx
+++ b/sc/source/ui/view/editsh.cxx
@@ -298,8 +298,8 @@ void ScEditShell::Execute( SfxRequest& rReq )
                         pTopView->Paste();
                 }
 
-                if (pTopView)
-                    pTopView->GetWindow()->GrabFocus();
+                if (vcl::Window* pViewWindow = pTopView ? 
pTopView->GetWindow() : nullptr)
+                    pViewWindow->GrabFocus();
             }
             break;
 
@@ -310,7 +310,8 @@ void ScEditShell::Execute( SfxRequest& rReq )
                 if (pTopView)
                 {
                     pTopView->Paste();
-                    pTopView->GetWindow()->GrabFocus();
+                    if (vcl::Window* pViewWindow = pTopView ? 
pTopView->GetWindow() : nullptr)
+                        pViewWindow->GrabFocus();
                 }
             }
             break;
@@ -458,8 +459,8 @@ void ScEditShell::Execute( SfxRequest& rReq )
 
                 }
 
-                if (pTopView)
-                    pTopView->GetWindow()->GrabFocus();
+                if (vcl::Window* pViewWindow = pTopView ? 
pTopView->GetWindow() : nullptr)
+                    pViewWindow->GrabFocus();
             }
             break;
 
@@ -492,8 +493,8 @@ void ScEditShell::Execute( SfxRequest& rReq )
                 }
                 pDlg.disposeAndClear();
 
-                if (pTopView)
-                    pTopView->GetWindow()->GrabFocus();
+                if (vcl::Window* pViewWindow = pTopView ? 
pTopView->GetWindow() : nullptr)
+                    pViewWindow->GrabFocus();
             }
             break;
 
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to