[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - sc/source
Miklos Vajna (via logerrit)
logerrit at kemper.freedesktop.org
Wed Jun 30 08:12:25 UTC 2021
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 5e5628c2acb3ce02adb091f56aa6b7b89427c621
Author: Miklos Vajna <vmiklos at collabora.com>
AuthorDate: Tue Jun 29 13:54:00 2021 +0200
Commit: Michael Meeks <michael.meeks at collabora.com>
CommitDate: Wed Jun 30 10:11:50 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.
(cherry picked from commit 1b7fc505bdd6c3c44986221c6bbe33af1a0e3ac6)
Change-Id: If2fbec533f5c2a57268a22cf96464e724922ff7f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118120
Tested-by: Michael Meeks <michael.meeks at collabora.com>
Reviewed-by: Michael Meeks <michael.meeks at collabora.com>
diff --git a/sc/source/core/data/global.cxx b/sc/source/core/data/global.cxx
index 050fd823b4ee..ec9cebf3e66d 100644
--- a/sc/source/core/data/global.cxx
+++ b/sc/source/core/data/global.cxx
@@ -780,7 +780,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 e3c306574a73..8f4badd28ecb 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 b940ffe200b1..40746907fafc 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());
More information about the Libreoffice-commits
mailing list