sc/source/ui/docshell/docsh4.cxx |   36 +++++++++++++++---------------------
 1 file changed, 15 insertions(+), 21 deletions(-)

New commits:
commit 14aea7538122a69a079f8b6426ac4130ffd8466c
Author:     Sahil Gautam <sahil.gau...@collabora.com>
AuthorDate: Thu Jul 31 08:31:29 2025 +0530
Commit:     Sahil Gautam <sahil.gau...@collabora.com>
CommitDate: Thu Jul 31 22:56:17 2025 +0200

    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 <sahil.gau...@collabora.com>
    Tested-by: Jenkins

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 )
-                {
-                    rReq.Ignore();
-                    break;
-                }
-
-                ScAddress aCell {pViewData->GetCurPos()};
-                std::vector<UrlData> vUrls = pWin->GetEditUrls(aCell);
-                if (vUrls.empty())
-                {
-                    rReq.Ignore();
-                    break;
                 }
-
-                for (UrlData& data : vUrls)
+                else
                 {
-                    ScGlobal::OpenURL(data.aUrl, data.aTarget, true);
+                    if (ScGridWindow* pWin = pViewData->GetActiveWin())
+                    {
+                        std::vector<UrlData> vUrls = 
pWin->GetEditUrls(pViewData->GetCurPos());
+                        if (!vUrls.empty())
+                        {
+                            for (UrlData& data : vUrls)
+                            {
+                                ScGlobal::OpenURL(data.aUrl, data.aTarget, 
true);
+                            }
+                            rReq.Done();
+                            break;
+                        }
+                    }
                 }
-                rReq.Done();
+                rReq.Ignore();
             }
             break;
         case FID_RECALC:

Reply via email to