diff options
author | Henry Castro <hcastro@collabora.com> | 2023-08-02 16:54:12 -0400 |
---|---|---|
committer | Caolán McNamara <caolan.mcnamara@collabora.com> | 2023-10-11 09:29:46 +0200 |
commit | 2709d6bcf248a072abdc6e219466727f52dc159b (patch) | |
tree | f85f3bc47b83999715ec94039ea99026a2fa6009 | |
parent | f99bee8103ad82dac2e53e114527399c4af5485c (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
(cherry picked from commit 5279aff5588941e1e131a703059e8148713d24ef)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157726
Tested-by: Jenkins
-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 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; } |