diff options
author | Caolán McNamara <caolan.mcnamara@collabora.com> | 2023-11-15 21:01:48 +0000 |
---|---|---|
committer | Thorsten Behrens <thorsten.behrens@allotropia.de> | 2023-12-06 10:41:59 +0100 |
commit | df87d705a49125c5438eba1f14972134acb55960 (patch) | |
tree | 19419e1d98fe6fc1436a944f365aa3743b63b371 | |
parent | d50a5aff79525c81c98863ecc9cbff40bc91fe9a (diff) |
combine these hyperlink dispatchers into one call
Conflicts:
sw/source/uibase/shells/drwtxtex.cxx
sw/source/uibase/wrtsh/wrtsh2.cxx
Change-Id: Icb7822e811013de648ccf2fbb23a5f0be9e29bb0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159489
Tested-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
(cherry picked from commit 0df175ccc6ea542bc5801f631ff72bed187042eb)
-rw-r--r-- | sw/inc/swurl.hxx | 5 | ||||
-rw-r--r-- | sw/source/uibase/shells/drwtxtex.cxx | 2 | ||||
-rw-r--r-- | sw/source/uibase/wrtsh/wrtsh2.cxx | 4 |
3 files changed, 8 insertions, 3 deletions
diff --git a/sw/inc/swurl.hxx b/sw/inc/swurl.hxx index 87375f30c8b7..ec88a639a4e9 100644 --- a/sw/inc/swurl.hxx +++ b/sw/inc/swurl.hxx @@ -23,6 +23,7 @@ #include <o3tl/typed_flags_set.hxx> class SwViewShell; +class SwView; enum class LoadUrlFlags { NONE = 0x00, @@ -35,6 +36,10 @@ namespace o3tl { void LoadURL( SwViewShell& rSh, const OUString& rName, LoadUrlFlags nFilter, const OUString& rTargetFrameName ); +void LoadURL( SwView& rView, const OUString& rName, + LoadUrlFlags nFilter, const OUString& rTargetFrameName ); + + #endif /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/uibase/shells/drwtxtex.cxx b/sw/source/uibase/shells/drwtxtex.cxx index 0e3ba07c3973..820b131e60b6 100644 --- a/sw/source/uibase/shells/drwtxtex.cxx +++ b/sw/source/uibase/shells/drwtxtex.cxx @@ -545,7 +545,7 @@ void SwDrawTextShell::Execute( SfxRequest &rReq ) const SvxFieldData* pField = pOLV->GetFieldAtCursor(); if (const SvxURLField* pURLField = dynamic_cast<const SvxURLField*>(pField)) { - ::LoadURL(GetShell(), pURLField->GetURL(), LoadUrlFlags::NONE, + ::LoadURL(GetView(), pURLField->GetURL(), LoadUrlFlags::NONE, pURLField->GetTargetFrame()); } } diff --git a/sw/source/uibase/wrtsh/wrtsh2.cxx b/sw/source/uibase/wrtsh/wrtsh2.cxx index 4b98417ac788..1cb9e1b46861 100644 --- a/sw/source/uibase/wrtsh/wrtsh2.cxx +++ b/sw/source/uibase/wrtsh/wrtsh2.cxx @@ -491,9 +491,9 @@ bool SwWrtShell::ClickToINetGrf( const Point& rDocPt, LoadUrlFlags nFilter ) static void LoadURL(SwView& rView, const OUString& rURL, LoadUrlFlags nFilter, const OUString& rTargetFrameName) { - SwDocShell* pDShell = rSh.GetView().GetDocShell(); + SwDocShell* pDShell = rView.GetDocShell(); OSL_ENSURE( pDShell, "No DocShell?!"); - SfxViewFrame& rViewFrame = *rSh.GetView().GetViewFrame(); + SfxViewFrame& rViewFrame = *rView.GetViewFrame(); if (!SfxObjectShell::AllowedLinkProtocolFromDocument(rURL, pDShell, rViewFrame.GetFrameWeld())) return; |