[Libreoffice-commits] core.git: sc/source

Miklos Vajna vmiklos at collabora.co.uk
Tue Jun 14 15:04:38 UTC 2016


 sc/source/core/data/global.cxx |   17 ++++++++++++++---
 1 file changed, 14 insertions(+), 3 deletions(-)

New commits:
commit 19822c8a2d35570593bf2f39f16cbc40a30b09db
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Tue Jun 14 15:10:02 2016 +0200

    sc: implement per-view LOK_CALLBACK_HYPERLINK_CLICKED
    
    The last place that crashed when clicking on hyperlinks.
    
    Change-Id: Ia114d98ada6cf8a3be56a25e48f3e84471c37e66
    Reviewed-on: https://gerrit.libreoffice.org/26265
    Reviewed-by: Miklos Vajna <vmiklos at collabora.co.uk>
    Tested-by: Jenkins <ci at libreoffice.org>

diff --git a/sc/source/core/data/global.cxx b/sc/source/core/data/global.cxx
index cab3b70..72fac57 100644
--- a/sc/source/core/data/global.cxx
+++ b/sc/source/core/data/global.cxx
@@ -880,10 +880,21 @@ bool ScGlobal::EETextObjEqual( const EditTextObject* pObj1,
 
 void ScGlobal::OpenURL(const OUString& rURL, const OUString& rTarget, const SdrModel* pDrawLayer)
 {
-    if (pDrawLayer && comphelper::LibreOfficeKit::isActive())
+    if (comphelper::LibreOfficeKit::isActive())
     {
-        pDrawLayer->libreOfficeKitCallback(LOK_CALLBACK_HYPERLINK_CLICKED, rURL.toUtf8().getStr());
-        return;
+        if (comphelper::LibreOfficeKit::isViewCallback())
+        {
+            if(SfxViewShell* pViewShell = SfxViewShell::Current())
+                pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_HYPERLINK_CLICKED, rURL.toUtf8().getStr());
+        }
+        else
+        {
+            if (pDrawLayer)
+            {
+                pDrawLayer->libreOfficeKitCallback(LOK_CALLBACK_HYPERLINK_CLICKED, rURL.toUtf8().getStr());
+                return;
+            }
+        }
     }
 
     // OpenURL is always called in the GridWindow by mouse clicks in some way or another.


More information about the Libreoffice-commits mailing list