[Libreoffice-commits] core.git: Branch 'libreoffice-4-0' - sc/source
Akash Shetye
shetyeakash at gmail.com
Mon Mar 25 10:37:34 PDT 2013
sc/source/core/data/global.cxx | 21 +++++++++++++++++----
1 file changed, 17 insertions(+), 4 deletions(-)
New commits:
commit 2902a8369fc6033c74ebbb46408ccb29f279a5a8
Author: Akash Shetye <shetyeakash at gmail.com>
Date: Sun Mar 24 00:59:26 2013 +0530
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 at gmail.com>
Tested-by: Kohei Yoshida <kohei.yoshida at gmail.com>
diff --git a/sc/source/core/data/global.cxx b/sc/source/core/data/global.cxx
index e18d241..74ba29b 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 )
More information about the Libreoffice-commits
mailing list