diff options
author | Akash Shetye <shetyeakash@gmail.com> | 2013-03-24 00:59:26 +0530 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@gmail.com> | 2013-03-25 17:37:13 +0000 |
commit | 2902a8369fc6033c74ebbb46408ccb29f279a5a8 (patch) | |
tree | 45e5071e7d04617b25d8e8e931bf9ca55e5e5c36 | |
parent | 0224cbfebdfc3f73bc870e0d039908aba879474e (diff) |
fdo#51296 Patch accounts security setting requiring ctrl+click for hyperlinks.
Have used a boolean variable that acts as an entry condition to OpenURL
methods main body/code and is set on qualification of security check.
Change-Id: I1280e7cf7e8923282fda17088fd7c61fbf503b9d
(cherry picked from commit 99932fa89be0e041abf5ce5da3271600c841ff19)
Reviewed-on: https://gerrit.libreoffice.org/3032
Reviewed-by: Kohei Yoshida <kohei.yoshida@gmail.com>
Tested-by: Kohei Yoshida <kohei.yoshida@gmail.com>
-rw-r--r-- | sc/source/core/data/global.cxx | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/sc/source/core/data/global.cxx b/sc/source/core/data/global.cxx index e18d241ba54b..74ba29bb6331 100644 --- a/sc/source/core/data/global.cxx +++ b/sc/source/core/data/global.cxx @@ -38,6 +38,7 @@ #include <sal/macros.h> #include <tools/rcid.h> #include <unotools/charclass.hxx> +#include <unotools/securityoptions.hxx> #include <stdlib.h> #include <time.h> #include <ctype.h> @@ -925,13 +926,25 @@ void ScGlobal::OpenURL( const String& rURL, const String& rTarget ) { // OpenURL wird immer ueber irgendwelche Umwege durch Mausklicks im GridWindow // aufgerufen, darum stimmen pScActiveViewShell und nScClickMouseModifier. + //SvtSecurityOptions to access Libreoffice global security parameters + SvtSecurityOptions aSecOpt; + bool bProceedHyperlink = false; + if ( (nScClickMouseModifier & KEY_MOD1) && aSecOpt.IsOptionSet( SvtSecurityOptions::E_CTRLCLICK_HYPERLINK )) // control-click -> into new window + { + //Ctrl key is pressed and ctrl+click hyperlink security control is set + bProceedHyperlink = true; + } + else if( !aSecOpt.IsOptionSet( SvtSecurityOptions::E_CTRLCLICK_HYPERLINK ) ) + { + //ctrl+click hyperlink security control is disabled just click will do + bProceedHyperlink = true; + } + if ( !bProceedHyperlink ) + return; SfxStringItem aUrl( SID_FILE_NAME, rURL ); SfxStringItem aTarget( SID_TARGETNAME, rTarget ); - - if ( nScClickMouseModifier & KEY_MOD1 ) // control-click -> into new window - aTarget.SetValue(rtl::OUString("_blank")); - + aTarget.SetValue(rtl::OUString("_blank")); SfxViewFrame* pFrame = NULL; String aReferName; if ( pScActiveViewShell ) |