diff options
author | Siqi Liu <me@siqi.fr> | 2015-03-10 20:32:00 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2015-03-16 09:38:05 +0100 |
commit | e3b517ee6d985bc3d2f8750643ae4672575d5b8e (patch) | |
tree | f6ad000586ea64516a2928b2676c637c19b9e64c /sc | |
parent | fdcd5a509c483a0460919a227d273332f4b1d6e8 (diff) |
tdf#89705: make hyperlinks clickable on impress/calc
Change-Id: I3d35918a43dff789fad703cfc6b594a6dd3df47b
Diffstat (limited to 'sc')
-rw-r--r-- | sc/inc/global.hxx | 2 | ||||
-rw-r--r-- | sc/source/core/data/global.cxx | 14 | ||||
-rw-r--r-- | sc/source/ui/view/gridwin.cxx | 5 |
3 files changed, 18 insertions, 3 deletions
diff --git a/sc/inc/global.hxx b/sc/inc/global.hxx index 2c6c61253317..6b03dc4be746 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 6a0aaf0ca61b..81b28d53dbe4 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 290c649358fe..4c225e83c8a5 100644 --- a/sc/source/ui/view/gridwin.cxx +++ b/sc/source/ui/view/gridwin.cxx @@ -2295,8 +2295,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; |