svx/source/sdr/contact/objectcontactofpageview.cxx |    4 ++--
 svx/source/tbxctrls/grafctrl.cxx                   |    4 ++--
 svx/source/tbxctrls/itemwin.cxx                    |    4 ++--
 3 files changed, 6 insertions(+), 6 deletions(-)

New commits:
commit 2822b41dfcd26c6eb9f9ffa89672053663bb26f2
Author:     Caolán McNamara <caolan.mcnam...@collabora.com>
AuthorDate: Fri Jan 26 14:05:12 2024 +0000
Commit:     Caolán McNamara <caolan.mcnam...@collabora.com>
CommitDate: Fri Jan 26 16:19:53 2024 +0100

    just fetch SfxViewShell::Current() once, and as const
    
    Change-Id: I3c95622b6de8ff35e53d9879f3de8cf9041887c1
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162604
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com>

diff --git a/svx/source/sdr/contact/objectcontactofpageview.cxx 
b/svx/source/sdr/contact/objectcontactofpageview.cxx
index 89b6325cf492..79842eb761b0 100644
--- a/svx/source/sdr/contact/objectcontactofpageview.cxx
+++ b/svx/source/sdr/contact/objectcontactofpageview.cxx
@@ -219,8 +219,8 @@ namespace sdr::contact
             aNewViewInformation2D.setViewport(aViewRange);
             
aNewViewInformation2D.setVisualizedPage(GetXDrawPageForSdrPage(GetSdrPage()));
             aNewViewInformation2D.setViewTime(fCurrentTime);
-            if (SfxViewShell::Current())
-                
aNewViewInformation2D.setAutoColor(SfxViewShell::Current()->GetColorConfigColor(svtools::DOCCOLOR));
+            if (const SfxViewShell* pViewShell = SfxViewShell::Current())
+                
aNewViewInformation2D.setAutoColor(pViewShell->GetColorConfigColor(svtools::DOCCOLOR));
             updateViewInformation2D(aNewViewInformation2D);
 
             drawinglayer::primitive2d::Primitive2DContainer xPrimitiveSequence;
diff --git a/svx/source/tbxctrls/grafctrl.cxx b/svx/source/tbxctrls/grafctrl.cxx
index b2daea684b87..6076c7548197 100644
--- a/svx/source/tbxctrls/grafctrl.cxx
+++ b/svx/source/tbxctrls/grafctrl.cxx
@@ -355,9 +355,9 @@ IMPL_LINK_NOARG(ImplGrafModeControl, FocusInHdl, 
weld::Widget&, void)
 
 void ImplGrafModeControl::ImplReleaseFocus()
 {
-    if( SfxViewShell::Current() )
+    if (const SfxViewShell* pViewShell = SfxViewShell::Current())
     {
-        vcl::Window* pShellWnd = SfxViewShell::Current()->GetWindow();
+        vcl::Window* pShellWnd = pViewShell->GetWindow();
 
         if( pShellWnd )
             pShellWnd->GrabFocus();
diff --git a/svx/source/tbxctrls/itemwin.cxx b/svx/source/tbxctrls/itemwin.cxx
index 1a9b6d3bcf53..54004f3da511 100644
--- a/svx/source/tbxctrls/itemwin.cxx
+++ b/svx/source/tbxctrls/itemwin.cxx
@@ -114,9 +114,9 @@ IMPL_LINK_NOARG(SvxMetricField, ModifyHdl, 
weld::MetricSpinButton&, void)
 
 void SvxMetricField::ReleaseFocus_Impl()
 {
-    if( SfxViewShell::Current() )
+    if (const SfxViewShell* pViewShell = SfxViewShell::Current())
     {
-        vcl::Window* pShellWnd = SfxViewShell::Current()->GetWindow();
+        vcl::Window* pShellWnd = pViewShell->GetWindow();
         if ( pShellWnd )
             pShellWnd->GrabFocus();
     }

Reply via email to