diff options
author | Henry Castro <hcastro@collabora.com> | 2023-08-02 16:54:12 -0400 |
---|---|---|
committer | Henry Castro <hcastro@collabora.com> | 2023-08-04 16:07:47 +0200 |
commit | 5279aff5588941e1e131a703059e8148713d24ef (patch) | |
tree | 6315d7475d3abf0f33e14652a594382deee70ce5 | |
parent | 72cb68b958f4b037a35bc21f6d6338b19b20fa96 (diff) |
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 <hcastro@collabora.com>
Change-Id: I08d41170714588d9ee84475991757d8be9b01f07
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155270
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Tested-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155352
-rw-r--r-- | sc/source/ui/inc/gridwin.hxx | 2 | ||||
-rw-r--r-- | sc/source/ui/view/gridwin.cxx | 22 |
2 files changed, 23 insertions, 1 deletions
diff --git a/sc/source/ui/inc/gridwin.hxx b/sc/source/ui/inc/gridwin.hxx index b9bd9184e18b..c23c236717c2 100644 --- a/sc/source/ui/inc/gridwin.hxx +++ b/sc/source/ui/inc/gridwin.hxx @@ -505,6 +505,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 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; } |