sc/source/ui/inc/gridwin.hxx | 2 ++ sc/source/ui/view/gridwin.cxx | 22 +++++++++++++++++++++- 2 files changed, 23 insertions(+), 1 deletion(-)
New commits: commit 2709d6bcf248a072abdc6e219466727f52dc159b Author: Henry Castro <hcas...@collabora.com> AuthorDate: Wed Aug 2 16:54:12 2023 -0400 Commit: Caolán McNamara <caolan.mcnam...@collabora.com> CommitDate: Wed Oct 11 09:29:46 2023 +0200 lok: sc: fire "hyperlink clicked" event The client side has changed the behaviour when the HYPERLINK formula is clicked, usually in desktop is fired with Ctrl + Mouse Click, now it is fired with Mouse Click. Signed-off-by: Henry Castro <hcas...@collabora.com> Change-Id: I08d41170714588d9ee84475991757d8be9b01f07 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155270 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> Tested-by: Caolán McNamara <caolan.mcnam...@collabora.com> Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155352 (cherry picked from commit 5279aff5588941e1e131a703059e8148713d24ef) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157726 Tested-by: Jenkins diff --git a/sc/source/ui/inc/gridwin.hxx b/sc/source/ui/inc/gridwin.hxx index deb3264c7759..8334e5fd0d51 100644 --- a/sc/source/ui/inc/gridwin.hxx +++ b/sc/source/ui/inc/gridwin.hxx @@ -510,6 +510,8 @@ protected: void ImpDestroyOverlayObjects(); private: + SCCOL m_nDownPosX; + SCROW m_nDownPosY; #ifdef DBG_UTIL void dumpCellProperties(); diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx index 56a7cc00f436..7ae933b1cf65 100644 --- a/sc/source/ui/view/gridwin.cxx +++ b/sc/source/ui/view/gridwin.cxx @@ -400,7 +400,9 @@ ScGridWindow::ScGridWindow( vcl::Window* pParent, ScViewData& rData, ScSplitPos bIsInPaint( false ), bNeedsRepaint( false ), bAutoMarkVisible( false ), - bListValButton( false ) + bListValButton( false ), + m_nDownPosX( -1 ), + m_nDownPosY( -1 ) { set_id("grid_window"); switch(eWhich) @@ -2045,6 +2047,8 @@ void ScGridWindow::HandleMouseButtonDown( const MouseEvent& rMEvt, MouseEventSta SCROW nPosY; mrViewData.GetPosFromPixel( aPos.X(), aPos.Y(), eWhich, nPosX, nPosY ); SCTAB nTab = mrViewData.GetTabNo(); + m_nDownPosX = nPosX; + m_nDownPosY = nPosY; // FIXME: this is to limit the number of rows handled in the Online // to 1000; this will be removed again when the performance @@ -2695,6 +2699,22 @@ void ScGridWindow::MouseButtonUp( const MouseEvent& rMEvt ) } mrViewData.GetViewShell()->SelectionChanged(); + if (bIsTiledRendering && !bRefMode && !bDouble) + { + OUString aName, aUrl, aTarget; + ScTabViewShell* pViewShell = mrViewData.GetViewShell(); + if (pViewShell && nPosX == m_nDownPosX && nPosY == m_nDownPosY + && GetEditUrl(aPos, &aName, &aUrl, &aTarget)) + { + OString aMsg(aUrl.toUtf8() + " coordinates: " + + pViewShell->GetViewData().describeCellCursorAt(nPosX, nPosY) + ", " + + OString::number(aPos.X() / pViewShell->GetViewData().GetPPTX())); + pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_HYPERLINK_CLICKED, aMsg); + } + } + + m_nDownPosX = m_nDownPosY = -1; + return; }