summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorCaolán McNamara <caolan.mcnamara@collabora.com>2024-01-26 14:05:12 +0000
committerCaolán McNamara <caolan.mcnamara@collabora.com>2024-01-26 16:19:53 +0100
commit2822b41dfcd26c6eb9f9ffa89672053663bb26f2 (patch)
tree8a448d10d69153612436dc440a206720b1c5be3f /svx
parent45763a761bdbe8ef0b3a4f81225d262b64b9c4b0 (diff)
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.mcnamara@collabora.com>
Diffstat (limited to 'svx')
-rw-r--r--svx/source/sdr/contact/objectcontactofpageview.cxx4
-rw-r--r--svx/source/tbxctrls/grafctrl.cxx4
-rw-r--r--svx/source/tbxctrls/itemwin.cxx4
3 files changed, 6 insertions, 6 deletions
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();
}