From 5279aff5588941e1e131a703059e8148713d24ef Mon Sep 17 00:00:00 2001 From: Henry Castro Date: Wed, 2 Aug 2023 16:54:12 -0400 Subject: lok: sc: fire "hyperlink clicked" event MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Change-Id: I08d41170714588d9ee84475991757d8be9b01f07 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155270 Tested-by: Jenkins CollaboraOffice Tested-by: Caolán McNamara Reviewed-by: Caolán McNamara Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155352 --- sc/source/ui/view/gridwin.cxx | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) (limited to 'sc/source/ui/view/gridwin.cxx') diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx index 266790951ded..7fb7c959ffba 100644 --- a/sc/source/ui/view/gridwin.cxx +++ b/sc/source/ui/view/gridwin.cxx @@ -398,7 +398,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) @@ -1982,6 +1984,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 @@ -2629,6 +2633,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.getStr()); + } + } + + m_nDownPosX = m_nDownPosY = -1; + return; } -- cgit