sc/source/core/data/global.cxx | 3 ++- sc/source/ui/drawfunc/fusel.cxx | 3 ++- sc/source/ui/view/gridwin5.cxx | 4 +++- 3 files changed, 7 insertions(+), 3 deletions(-)
New commits: commit 8d762c21571118f64a966a631cfe8dca152ac202 Author: Miklos Vajna <vmik...@collabora.com> AuthorDate: Tue Jun 29 13:54:00 2021 +0200 Commit: Miklos Vajna <vmik...@collabora.com> CommitDate: Thu Jul 1 08:29:10 2021 +0200 sc: don't require ctrl-click when clicking on internal links of shapes Excel doesn't require such additional actions, and Writer doesn't require ctrl-click for internal links (e.g. cross-references), either. Also suppress the tooltip hinting ctrl-click in this case. Change-Id: If2fbec533f5c2a57268a22cf96464e724922ff7f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118113 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> Reviewed-by: Luboš Luňák <l.lu...@collabora.com> diff --git a/sc/source/core/data/global.cxx b/sc/source/core/data/global.cxx index 221e1d31eb50..c7b34d27b7a5 100644 --- a/sc/source/core/data/global.cxx +++ b/sc/source/core/data/global.cxx @@ -763,7 +763,8 @@ void ScGlobal::OpenURL(const OUString& rURL, const OUString& rTarget, bool bIgno // OpenURL is always called in the GridWindow by mouse clicks in some way or another. // That's why pScActiveViewShell and nScClickMouseModifier are correct. - if (!bIgnoreSettings && !ShouldOpenURL()) + // Fragments pointing into the current document should be always opened. + if (!bIgnoreSettings && !(ShouldOpenURL() || rURL.startsWith("#"))) return; SfxViewFrame* pViewFrm = SfxViewFrame::Current(); diff --git a/sc/source/ui/drawfunc/fusel.cxx b/sc/source/ui/drawfunc/fusel.cxx index dca0beaa1ef1..164332f060d6 100644 --- a/sc/source/ui/drawfunc/fusel.cxx +++ b/sc/source/ui/drawfunc/fusel.cxx @@ -222,7 +222,8 @@ bool FuSelection::MouseButtonDown(const MouseEvent& rMEvt) } // open hyperlink, if found at object or in object's text - if ( !sURL.isEmpty() && ScGlobal::ShouldOpenURL() ) + // Fragments pointing into the current document should be always opened. + if ( !sURL.isEmpty() && (ScGlobal::ShouldOpenURL() || sURL.startsWith("#")) ) { ScGlobal::OpenURL( sURL, sTarget ); rViewShell.FakeButtonUp( rViewShell.GetViewData().GetActivePart() ); diff --git a/sc/source/ui/view/gridwin5.cxx b/sc/source/ui/view/gridwin5.cxx index b0f1e92ca679..3a3d73cc067b 100644 --- a/sc/source/ui/view/gridwin5.cxx +++ b/sc/source/ui/view/gridwin5.cxx @@ -292,7 +292,9 @@ void ScGridWindow::RequestHelp(const HelpEvent& rHEvt) pObj = pHit; } ScMacroInfo* pInfo = ScDrawLayer::GetMacroInfo( pObj ); - if ( pInfo && (pInfo->GetHlink().getLength() > 0) ) + // Fragments pointing into the current document need no tooltip + // describing the ctrl-click functionality. + if ( pInfo && (pInfo->GetHlink().getLength() > 0) && !pInfo->GetHlink().startsWith("#") ) { aPixRect = LogicToPixel(aVEvt.pObj->GetLogicRect()); aHelpText = SfxHelp::GetURLHelpText(pInfo->GetHlink()); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits