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: