[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.2' - sc/source sw/source

Mert Tumer (via logerrit) logerrit at kemper.freedesktop.org
Mon Mar 2 22:42:43 UTC 2020


 sc/source/ui/view/gridwin.cxx     |   10 +++++++---
 sw/source/uibase/docvw/edtwin.cxx |    6 ++++++
 2 files changed, 13 insertions(+), 3 deletions(-)

New commits:
commit 3fe9dfca2d44d9e41ee329883f199359c673f382
Author:     Mert Tumer <mert.tumer at collabora.com>
AuthorDate: Wed Feb 26 18:48:46 2020 +0300
Commit:     Andras Timar <andras.timar at collabora.com>
CommitDate: Mon Mar 2 23:42:13 2020 +0100

    fix ToC links give unhelpful url popups
    
    core expects ctrl+click for internal links too and
    it should not expect it if it is tiled rendering
    
    Change-Id: Id841f0e9729e46f00988ea0b4eb29bd65098a740
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89559
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Andras Timar <andras.timar at collabora.com>

diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx
index a5ca02b06aec..2a751f77ac99 100644
--- a/sc/source/ui/view/gridwin.cxx
+++ b/sc/source/ui/view/gridwin.cxx
@@ -2185,14 +2185,18 @@ void ScGridWindow::MouseButtonUp( const MouseEvent& rMEvt )
         if ( GetEditUrl( rMEvt.GetPosPixel(), &aName, &aUrl, &aTarget ) )
         {
             nMouseStatus = SC_GM_NONE;              // Ignore double-click
-
+            bool isTiledRendering = comphelper::LibreOfficeKit::isActive();
             // ScGlobal::OpenURL() only understands Calc A1 style syntax.
             // Convert it to Calc A1 before calling OpenURL().
             if (pDoc->GetAddressConvention() == formula::FormulaGrammar::CONV_OOO)
             {
+                if (aUrl.startsWith("#")) {
+                        ScGlobal::OpenURL(aUrl, aTarget, isTiledRendering);
+                        return;
+                }
                 // in mobile view there is no ctrl+click and for hyperlink popup
                 // the cell coordinates must be sent along with click position for elegance
-                if (comphelper::LibreOfficeKit::isActive() &&
+                if (isTiledRendering &&
                      comphelper::LibreOfficeKit::isMobile(SfxLokHelper::getView()))
                 {
                     ScTabViewShell* pViewShell = pViewData->GetViewShell();
@@ -2243,7 +2247,7 @@ void ScGridWindow::MouseButtonUp( const MouseEvent& rMEvt )
                     aBuf.append('#');
                     OUString aUrlCalcA1(aTempAddr.Format(ScRefFlags::ADDR_ABS_3D, pDoc, formula::FormulaGrammar::CONV_OOO));
                     aBuf.append(aUrlCalcA1);
-                    ScGlobal::OpenURL(aBuf.makeStringAndClear(), aTarget);
+                    ScGlobal::OpenURL(aBuf.makeStringAndClear(), aTarget, isTiledRendering);
                 }
             }
 
diff --git a/sw/source/uibase/docvw/edtwin.cxx b/sw/source/uibase/docvw/edtwin.cxx
index d48a5a4199c0..06d98b1c6dac 100644
--- a/sw/source/uibase/docvw/edtwin.cxx
+++ b/sw/source/uibase/docvw/edtwin.cxx
@@ -4650,6 +4650,12 @@ void SwEditWin::MouseButtonUp(const MouseEvent& rMEvt)
                             }
                             else if ( IsAttrAtPos::InetAttr == aContentAtPos.eContentAtPos )
                             {
+                                if (comphelper::LibreOfficeKit::isActive())
+                                {
+                                    OUString val((*static_cast<const SwFormatINetFormat*>(aContentAtPos.aFnd.pAttr)).GetValue());
+                                    if (val.startsWith("#"))
+                                        bExecHyperlinks = true;
+                                }
                                 if ( bExecHyperlinks && aContentAtPos.aFnd.pAttr )
                                     rSh.ClickToINetAttr( *static_cast<const SwFormatINetFormat*>(aContentAtPos.aFnd.pAttr), nFilter );
                             }


More information about the Libreoffice-commits mailing list