From 14aea7538122a69a079f8b6426ac4130ffd8466c Mon Sep 17 00:00:00 2001 From: Sahil Gautam Date: Thu, 31 Jul 2025 08:31:29 +0530 Subject: [PATCH] tdf#123159 code cleanup in ScDocShell::Execute(SID_OPEN_HYPERLINK) Change-Id: I74f39d9774251d93158ebbcffdc8682f72c484a5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/188621 Reviewed-by: Sahil Gautam Tested-by: Jenkins --- sc/source/ui/docshell/docsh4.cxx | 36 +++++++++++++------------------- 1 file changed, 15 insertions(+), 21 deletions(-) diff --git a/sc/source/ui/docshell/docsh4.cxx b/sc/source/ui/docshell/docsh4.cxx index a4f7d23359bb..8fe15acc0299 100644 --- a/sc/source/ui/docshell/docsh4.cxx +++ b/sc/source/ui/docshell/docsh4.cxx @@ -432,30 +432,24 @@ void ScDocShell::Execute( SfxRequest& rReq ) break; } } - rReq.Ignore(); - break; } - - ScGridWindow* pWin = pViewData->GetActiveWin(); - if ( !pWin ) + else { - rReq.Ignore(); - break; + if (ScGridWindow* pWin = pViewData->GetActiveWin()) + { + std::vector vUrls = pWin->GetEditUrls(pViewData->GetCurPos()); + if (!vUrls.empty()) + { + for (UrlData& data : vUrls) + { + ScGlobal::OpenURL(data.aUrl, data.aTarget, true); + } + rReq.Done(); + break; + } + } } - - ScAddress aCell {pViewData->GetCurPos()}; - std::vector vUrls = pWin->GetEditUrls(aCell); - if (vUrls.empty()) - { - rReq.Ignore(); - break; - } - - for (UrlData& data : vUrls) - { - ScGlobal::OpenURL(data.aUrl, data.aTarget, true); - } - rReq.Done(); + rReq.Ignore(); } break; case FID_RECALC: