[Libreoffice-commits] core.git: Branch 'feature/tiled-editing' - 2 commits - sc/inc sc/source sd/source

Siqi Liu me at siqi.fr
Tue Mar 10 14:03:53 PDT 2015


 sc/inc/global.hxx              |    2 ++
 sc/source/core/data/global.cxx |   14 +++++++++++++-
 sc/source/ui/view/gridwin.cxx  |    3 +--
 sd/source/ui/func/fusel.cxx    |    9 +++++++++
 4 files changed, 25 insertions(+), 3 deletions(-)

New commits:
commit bcce230b1035e0409368f34c93a7562458719001
Author: Siqi Liu <me at siqi.fr>
Date:   Tue Mar 10 20:38:04 2015 +0100

    make format consistent with the rest of the file...

diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx
index 6c4904a..c90ac59 100644
--- a/sc/source/ui/view/gridwin.cxx
+++ b/sc/source/ui/view/gridwin.cxx
@@ -2291,10 +2291,8 @@ void ScGridWindow::MouseButtonUp( const MouseEvent& rMEvt )
 
             // ScGlobal::OpenURL() only understands Calc A1 style syntax.
             // Convert it to Calc A1 before calling OpenURL().
-
-            if (pDoc->GetAddressConvention() == formula::FormulaGrammar::CONV_OOO) {
+            if (pDoc->GetAddressConvention() == formula::FormulaGrammar::CONV_OOO)
                 ScGlobal::OpenURL(pViewData->GetDocument()->GetDrawLayer(), aUrl, aTarget);
-            }
             else
             {
                 ScAddress aTempAddr;
commit 6e85234a6e15f6a2f809a246ac2d36ad249a3256
Author: Siqi Liu <me at siqi.fr>
Date:   Tue Mar 10 20:32:00 2015 +0100

    tdf#89705: make hyperlinks clickable on impress/calc
    
    Change-Id: I3d35918a43dff789fad703cfc6b594a6dd3df47b

diff --git a/sc/inc/global.hxx b/sc/inc/global.hxx
index 2c6c612..6b03dc4b 100644
--- a/sc/inc/global.hxx
+++ b/sc/inc/global.hxx
@@ -576,6 +576,8 @@ public:
     static void                 SetUserList( const ScUserList* pNewList );
     SC_DLLPUBLIC static const OUString&       GetRscString( sal_uInt16 nIndex );
     static void                 OpenURL( const OUString& rURL, const OUString& rTarget );
+    // Check if tiled-rendering, and leave clients to handle the openURL action if that's the case, OpenURL otherwise.
+    static void                 OpenURL( const SdrModel* pDrawLayer, const OUString& rURL, const OUString& rTarget );
     SC_DLLPUBLIC static OUString            GetAbsDocName( const OUString& rFileName,
                                                 SfxObjectShell* pShell );
     SC_DLLPUBLIC static OUString            GetDocTabName( const OUString& rFileName,
diff --git a/sc/source/core/data/global.cxx b/sc/source/core/data/global.cxx
index 6a0aaf0..81b28d5 100644
--- a/sc/source/core/data/global.cxx
+++ b/sc/source/core/data/global.cxx
@@ -44,6 +44,7 @@
 #include <time.h>
 #include <ctype.h>
 #include <numeric>
+#include <svx/svdmodel.hxx>
 
 #include <i18nlangtag/mslangid.hxx>
 #include <com/sun/star/lang/Locale.hpp>
@@ -57,6 +58,8 @@
 #include <unotools/syslocale.hxx>
 #include <unotools/transliterationwrapper.hxx>
 
+#include <LibreOfficeKit/LibreOfficeKitEnums.h>
+
 #include "global.hxx"
 #include "scresid.hxx"
 #include "autoform.hxx"
@@ -127,7 +130,6 @@ long            ScGlobal::nLastColWidthExtra    = STD_EXTRA_WIDTH;
 
 static sal_uInt16 nPPTZoom = 0; // ScreenZoom used to determine nScreenPPTX/Y
 
-class SfxViewShell;
 SfxViewShell* pScActiveViewShell = NULL; //FIXME: Make this a member
 sal_uInt16 nScClickMouseModifier = 0;    //FIXME: This too
 sal_uInt16 nScFillModeMouseModifier = 0; //FIXME: And this
@@ -865,6 +867,16 @@ bool ScGlobal::EETextObjEqual( const EditTextObject* pObj1,
     return false;
 }
 
+
+void ScGlobal::OpenURL( const SdrModel* pDrawLayer, const OUString& rURL, const OUString& rTarget ) {
+    if (pDrawLayer && pDrawLayer->isTiledRendering()) {
+            pDrawLayer->libreOfficeKitCallback(LOK_CALLBACK_HYPERLINK_CLICKED, rURL.toUtf8().getStr());
+            return;
+    }
+    // Proceed to openURL if not tiled rendering.
+    OpenURL(rURL, rTarget);
+}
+
 void ScGlobal::OpenURL( const OUString& rURL, const OUString& rTarget )
 {
     // OpenURL is always called in the GridWindow by mouse clicks in some way or another.
diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx
index d980dfc..6c4904a 100644
--- a/sc/source/ui/view/gridwin.cxx
+++ b/sc/source/ui/view/gridwin.cxx
@@ -2292,8 +2292,9 @@ void ScGridWindow::MouseButtonUp( const MouseEvent& rMEvt )
             // ScGlobal::OpenURL() only understands Calc A1 style syntax.
             // Convert it to Calc A1 before calling OpenURL().
 
-            if (pDoc->GetAddressConvention() == formula::FormulaGrammar::CONV_OOO)
-                ScGlobal::OpenURL(aUrl, aTarget);
+            if (pDoc->GetAddressConvention() == formula::FormulaGrammar::CONV_OOO) {
+                ScGlobal::OpenURL(pViewData->GetDocument()->GetDrawLayer(), aUrl, aTarget);
+            }
             else
             {
                 ScAddress aTempAddr;
diff --git a/sd/source/ui/func/fusel.cxx b/sd/source/ui/func/fusel.cxx
index cba2104..1ace237 100644
--- a/sd/source/ui/func/fusel.cxx
+++ b/sd/source/ui/func/fusel.cxx
@@ -71,6 +71,8 @@
 
 #include <svx/sdrhittesthelper.hxx>
 
+#include <LibreOfficeKit/LibreOfficeKitEnums.h>
+
 using namespace ::com::sun::star;
 
 namespace sd {
@@ -266,6 +268,13 @@ bool FuSelection::MouseButtonDown(const MouseEvent& rMEvt)
                 SfxViewFrame* pFrame = mpViewShell->GetViewFrame();
                 mpWindow->ReleaseMouse();
 
+                // If tiled rendering, let client handles URL execution and early returns.
+                if (mpDoc->isTiledRendering()) {
+                    mpDoc->libreOfficeKitCallback(LOK_CALLBACK_HYPERLINK_CLICKED,
+                            aVEvt.pURLField->GetURL().toUtf8().getStr());
+                    return true;
+                }
+
                 if (rMEvt.IsMod1())
                 {
                     // Open in new frame


More information about the Libreoffice-commits mailing list