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

New commits:
commit 19822c8a2d35570593bf2f39f16cbc40a30b09db
Author: Miklos Vajna <vmik...@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 <vmik...@collabora.co.uk>
    Tested-by: Jenkins <c...@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.
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to