summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAkash Shetye <shetyeakash@gmail.com>2013-03-24 00:59:26 +0530
committerKohei Yoshida <kohei.yoshida@gmail.com>2013-03-25 13:22:27 -0400
commit99932fa89be0e041abf5ce5da3271600c841ff19 (patch)
tree19676eea30bfa1bf134d9efe58259a499c515f3d
parent40dcf2d713e67ef4d8c68a6df98954f1f0b783db (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
-rw-r--r--sc/source/core/data/global.cxx21
1 files changed, 17 insertions, 4 deletions
diff --git a/sc/source/core/data/global.cxx b/sc/source/core/data/global.cxx
index c4fb19fb3b39..be9b38eb8353 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>
@@ -924,13 +925,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 )