sc/source/ui/inc/gridwin.hxx  |    2 ++
 sc/source/ui/view/gridwin.cxx |   22 +++++++++++++++++++++-
 2 files changed, 23 insertions(+), 1 deletion(-)

New commits:
commit 5279aff5588941e1e131a703059e8148713d24ef
Author:     Henry Castro <hcas...@collabora.com>
AuthorDate: Wed Aug 2 16:54:12 2023 -0400
Commit:     Henry Castro <hcas...@collabora.com>
CommitDate: Fri Aug 4 16:07:47 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

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;
 }
 

Reply via email to