sd/source/ui/view/drviewsg.cxx |   10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

New commits:
commit 3504cb5364c77849b63c1228a164e537380ea62b
Author:     Xisco Fauli <xiscofa...@libreoffice.org>
AuthorDate: Tue Dec 17 12:22:27 2024 +0100
Commit:     Xisco Fauli <xiscofa...@libreoffice.org>
CommitDate: Tue Dec 17 13:18:10 2024 +0100

    sd: Dereference after null check
    
    C: 
/cygwin64/home/tdf/jenkins/workspace/gerrit_windows/sd/source/ui/view/drviewsg.cxx(247):
 error C2220: the following warning is treated as an error
    C:     
    Since
    commit 9d9c24328cef503f999bf3a5475743e87a3aff5a
    Author: Gökay Şatır <gokaysa...@collabora.com>
    Date:   Tue Sep 24 13:30:22 2024 +0300
    
        cool#7406 Inform lokit side about the grid state.
    
    Change-Id: Ic06e765386330cf344380ddf61757298210f921e
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178655
    Tested-by: Jenkins
    Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org>

diff --git a/sd/source/ui/view/drviewsg.cxx b/sd/source/ui/view/drviewsg.cxx
index 149894fcd0e2..64fa49a94e78 100644
--- a/sd/source/ui/view/drviewsg.cxx
+++ b/sd/source/ui/view/drviewsg.cxx
@@ -124,10 +124,11 @@ void DrawViewShell::ExecOptionsBar( SfxRequest& rReq )
         {
             pOptions->SetGridVisible( !mpDrawView->IsGridVisible() );
 
-            if (comphelper::LibreOfficeKit::isActive())
+            SfxViewShell* pViewShell = SfxViewShell::Current();
+            if (pViewShell && comphelper::LibreOfficeKit::isActive())
             {
                 OString state = !mpDrawView->IsGridVisible() ? 
".uno:GridVisible=true"_ostr: ".uno:GridVisible=false"_ostr;
-                
SfxViewShell::Current()->libreOfficeKitViewCallback(LOK_CALLBACK_STATE_CHANGED, 
state);
+                
pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_STATE_CHANGED, state);
             }
         }
         break;
@@ -136,10 +137,11 @@ void DrawViewShell::ExecOptionsBar( SfxRequest& rReq )
         {
             pOptions->SetUseGridSnap( !mpDrawView->IsGridSnap() );
 
-            if (comphelper::LibreOfficeKit::isActive())
+            SfxViewShell* pViewShell = SfxViewShell::Current();
+            if (pViewShell && comphelper::LibreOfficeKit::isActive())
             {
                 OString state = !mpDrawView->IsGridSnap() ? 
".uno:GridUse=true"_ostr: ".uno:GridUse=false"_ostr;
-                
SfxViewShell::Current()->libreOfficeKitViewCallback(LOK_CALLBACK_STATE_CHANGED, 
state);
+                
pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_STATE_CHANGED, state);
             }
         }
         break;

Reply via email to