[Libreoffice-commits] core.git: cui/source include/unotools sc/source sfx2/source sw/source unotools/source xmlsecurity/source

Noel Grandin noel.grandin at collabora.co.uk
Fri Feb 10 06:06:31 UTC 2017


 cui/source/options/optinet2.cxx              |   22 +++++------
 cui/source/options/securityoptions.cxx       |   16 ++++----
 include/unotools/securityoptions.hxx         |   33 ++++++++---------
 sc/source/core/data/global.cxx               |    2 -
 sc/source/ui/view/gridwin5.cxx               |    2 -
 sfx2/source/appl/appcfg.cxx                  |   10 ++---
 sfx2/source/dialog/filedlghelper.cxx         |    2 -
 sfx2/source/doc/objcont.cxx                  |    2 -
 sfx2/source/doc/objstor.cxx                  |    8 ++--
 sw/source/core/draw/dpage.cxx                |    2 -
 sw/source/uibase/docvw/SidebarTxtControl.cxx |    4 +-
 sw/source/uibase/docvw/edtwin.cxx            |    6 +--
 sw/source/uibase/docvw/edtwin2.cxx           |    2 -
 unotools/source/config/securityoptions.cxx   |   51 ++++++++++++---------------
 xmlsecurity/source/dialogs/macrosecurity.cxx |    6 +--
 15 files changed, 82 insertions(+), 86 deletions(-)

New commits:
commit a4d0ec84dae49a6c47c38bfc6ee5bba988349721
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Thu Feb 9 10:41:46 2017 +0200

    convert SvtSecurityOptions::EOption to scoped enum
    
    and drop unused E_MACRO_DISABLE enumerator
    
    Change-Id: I0bd706d4d4e1d8b9004e68c9e77c11410c62a64a
    Reviewed-on: https://gerrit.libreoffice.org/34067
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/cui/source/options/optinet2.cxx b/cui/source/options/optinet2.cxx
index 34a5be8..3d45153 100644
--- a/cui/source/options/optinet2.cxx
+++ b/cui/source/options/optinet2.cxx
@@ -798,9 +798,9 @@ void SvxSecurityTabPage::InitControls()
     // @@@ Better would be to query the dialog whether it is 'useful' or not. Exposing
     //     macro security dialog implementations here, which is bad.
     if (    mpSecOptions->IsMacroDisabled()
-         || (    mpSecOptions->IsReadOnly( SvtSecurityOptions::E_MACRO_SECLEVEL )
-              && mpSecOptions->IsReadOnly( SvtSecurityOptions::E_MACRO_TRUSTEDAUTHORS )
-              && mpSecOptions->IsReadOnly( SvtSecurityOptions::E_SECUREURLS ) ) )
+         || (    mpSecOptions->IsReadOnly( SvtSecurityOptions::EOption::MacroSecLevel )
+              && mpSecOptions->IsReadOnly( SvtSecurityOptions::EOption::MacroTrustedAuthors )
+              && mpSecOptions->IsReadOnly( SvtSecurityOptions::EOption::SecureUrls ) ) )
     {
         //Hide these
         m_pMacroSecFrame->Hide();
@@ -885,14 +885,14 @@ bool SvxSecurityTabPage::FillItemSet( SfxItemSet* )
 
     if ( mpSecOptDlg )
     {
-        CheckAndSave( *mpSecOptions, SvtSecurityOptions::E_DOCWARN_SAVEORSEND, mpSecOptDlg->IsSaveOrSendDocsChecked(), bModified );
-        CheckAndSave( *mpSecOptions, SvtSecurityOptions::E_DOCWARN_SIGNING, mpSecOptDlg->IsSignDocsChecked(), bModified );
-        CheckAndSave( *mpSecOptions, SvtSecurityOptions::E_DOCWARN_PRINT, mpSecOptDlg->IsPrintDocsChecked(), bModified );
-        CheckAndSave( *mpSecOptions, SvtSecurityOptions::E_DOCWARN_CREATEPDF, mpSecOptDlg->IsCreatePdfChecked(), bModified );
-        CheckAndSave( *mpSecOptions, SvtSecurityOptions::E_DOCWARN_REMOVEPERSONALINFO, mpSecOptDlg->IsRemovePersInfoChecked(), bModified );
-        CheckAndSave( *mpSecOptions, SvtSecurityOptions::E_DOCWARN_RECOMMENDPASSWORD, mpSecOptDlg->IsRecommPasswdChecked(), bModified );
-        CheckAndSave( *mpSecOptions, SvtSecurityOptions::E_CTRLCLICK_HYPERLINK, mpSecOptDlg->IsCtrlHyperlinkChecked(), bModified );
-        CheckAndSave( *mpSecOptions, SvtSecurityOptions::E_BLOCKUNTRUSTEDREFERERLINKS, mpSecOptDlg->IsBlockUntrustedRefererLinksChecked(), bModified );
+        CheckAndSave( *mpSecOptions, SvtSecurityOptions::EOption::DocWarnSaveOrSend, mpSecOptDlg->IsSaveOrSendDocsChecked(), bModified );
+        CheckAndSave( *mpSecOptions, SvtSecurityOptions::EOption::DocWarnSigning, mpSecOptDlg->IsSignDocsChecked(), bModified );
+        CheckAndSave( *mpSecOptions, SvtSecurityOptions::EOption::DocWarnPrint, mpSecOptDlg->IsPrintDocsChecked(), bModified );
+        CheckAndSave( *mpSecOptions, SvtSecurityOptions::EOption::DocWarnCreatePdf, mpSecOptDlg->IsCreatePdfChecked(), bModified );
+        CheckAndSave( *mpSecOptions, SvtSecurityOptions::EOption::DocWarnRemovePersonalInfo, mpSecOptDlg->IsRemovePersInfoChecked(), bModified );
+        CheckAndSave( *mpSecOptions, SvtSecurityOptions::EOption::DocWarnRecommendPassword, mpSecOptDlg->IsRecommPasswdChecked(), bModified );
+        CheckAndSave( *mpSecOptions, SvtSecurityOptions::EOption::CtrlClickHyperlink, mpSecOptDlg->IsCtrlHyperlinkChecked(), bModified );
+        CheckAndSave( *mpSecOptions, SvtSecurityOptions::EOption::BlockUntrustedRefererLinks, mpSecOptDlg->IsBlockUntrustedRefererLinksChecked(), bModified );
     }
 
     return bModified;
diff --git a/cui/source/options/securityoptions.cxx b/cui/source/options/securityoptions.cxx
index 30452a9..d849d3e 100644
--- a/cui/source/options/securityoptions.cxx
+++ b/cui/source/options/securityoptions.cxx
@@ -46,28 +46,28 @@ SecurityOptionsDialog::SecurityOptionsDialog(vcl::Window* pParent, SvtSecurityOp
 {
     DBG_ASSERT( pOptions, "SecurityOptionsDialog::SecurityOptionsDialog(): invalid SvtSecurityOptions" );
     get(m_pSaveOrSendDocsCB, "savesenddocs");
-    enableAndSet(*pOptions, SvtSecurityOptions::E_DOCWARN_SAVEORSEND, *m_pSaveOrSendDocsCB,
+    enableAndSet(*pOptions, SvtSecurityOptions::EOption::DocWarnSaveOrSend, *m_pSaveOrSendDocsCB,
         *get<FixedImage>("locksavesenddocs"));
     get(m_pSignDocsCB, "whensigning");
-    enableAndSet(*pOptions, SvtSecurityOptions::E_DOCWARN_SIGNING, *m_pSignDocsCB,
+    enableAndSet(*pOptions, SvtSecurityOptions::EOption::DocWarnSigning, *m_pSignDocsCB,
         *get<FixedImage>("lockwhensigning"));
     get(m_pPrintDocsCB, "whenprinting");
-    enableAndSet(*pOptions, SvtSecurityOptions::E_DOCWARN_PRINT, *m_pPrintDocsCB,
+    enableAndSet(*pOptions, SvtSecurityOptions::EOption::DocWarnPrint, *m_pPrintDocsCB,
         *get<FixedImage>("lockwhenprinting"));
     get(m_pCreatePdfCB, "whenpdf");
-    enableAndSet(*pOptions, SvtSecurityOptions::E_DOCWARN_CREATEPDF, *m_pCreatePdfCB,
+    enableAndSet(*pOptions, SvtSecurityOptions::EOption::DocWarnCreatePdf, *m_pCreatePdfCB,
         *get<FixedImage>("lockwhenpdf"));
     get(m_pRemovePersInfoCB, "removepersonal");
-    enableAndSet(*pOptions, SvtSecurityOptions::E_DOCWARN_REMOVEPERSONALINFO, *m_pRemovePersInfoCB,
+    enableAndSet(*pOptions, SvtSecurityOptions::EOption::DocWarnRemovePersonalInfo, *m_pRemovePersInfoCB,
         *get<FixedImage>("lockremovepersonal"));
     get(m_pRecommPasswdCB, "password");
-    enableAndSet(*pOptions, SvtSecurityOptions::E_DOCWARN_RECOMMENDPASSWORD, *m_pRecommPasswdCB,
+    enableAndSet(*pOptions, SvtSecurityOptions::EOption::DocWarnRecommendPassword, *m_pRecommPasswdCB,
         *get<FixedImage>("lockpassword"));
     get(m_pCtrlHyperlinkCB, "ctrlclick");
-    enableAndSet(*pOptions, SvtSecurityOptions::E_CTRLCLICK_HYPERLINK, *m_pCtrlHyperlinkCB,
+    enableAndSet(*pOptions, SvtSecurityOptions::EOption::CtrlClickHyperlink, *m_pCtrlHyperlinkCB,
         *get<FixedImage>("lockctrlclick"));
     get(m_pBlockUntrustedRefererLinksCB, "blockuntrusted");
-    enableAndSet(*pOptions, SvtSecurityOptions::E_BLOCKUNTRUSTEDREFERERLINKS, *m_pBlockUntrustedRefererLinksCB,
+    enableAndSet(*pOptions, SvtSecurityOptions::EOption::BlockUntrustedRefererLinks, *m_pBlockUntrustedRefererLinksCB,
         *get<FixedImage>("lockblockuntrusted"));
 }
 
diff --git a/include/unotools/securityoptions.hxx b/include/unotools/securityoptions.hxx
index f3c6426..405e2fc 100644
--- a/include/unotools/securityoptions.hxx
+++ b/include/unotools/securityoptions.hxx
@@ -59,24 +59,23 @@ class SAL_WARN_UNUSED UNOTOOLS_DLLPUBLIC SvtSecurityOptions : public utl::detail
 {
     public:
 
-        enum EOption
+        enum class EOption
         {
-            E_SECUREURLS,
-            E_BASICMODE,                    // xmlsec05 deprecated
-            E_EXECUTEPLUGINS,               // xmlsec05 deprecated
-            E_WARNING,                      // xmlsec05 deprecated
-            E_CONFIRMATION,                 // xmlsec05 deprecated
-            E_DOCWARN_SAVEORSEND,
-            E_DOCWARN_SIGNING,
-            E_DOCWARN_PRINT,
-            E_DOCWARN_CREATEPDF,
-            E_DOCWARN_REMOVEPERSONALINFO,
-            E_DOCWARN_RECOMMENDPASSWORD,
-            E_MACRO_SECLEVEL,
-            E_MACRO_TRUSTEDAUTHORS,
-            E_MACRO_DISABLE,
-            E_CTRLCLICK_HYPERLINK,
-            E_BLOCKUNTRUSTEDREFERERLINKS
+            SecureUrls,
+            BasicMode,                    // xmlsec05 deprecated
+            ExecutePlugins,               // xmlsec05 deprecated
+            Warning,                      // xmlsec05 deprecated
+            Confirmation,                 // xmlsec05 deprecated
+            DocWarnSaveOrSend,
+            DocWarnSigning,
+            DocWarnPrint,
+            DocWarnCreatePdf,
+            DocWarnRemovePersonalInfo,
+            DocWarnRecommendPassword,
+            MacroSecLevel,
+            MacroTrustedAuthors,
+            CtrlClickHyperlink,
+            BlockUntrustedRefererLinks
         };
 
         typedef css::uno::Sequence< OUString > Certificate;
diff --git a/sc/source/core/data/global.cxx b/sc/source/core/data/global.cxx
index 0e175d1..6963bed 100644
--- a/sc/source/core/data/global.cxx
+++ b/sc/source/core/data/global.cxx
@@ -859,7 +859,7 @@ void ScGlobal::OpenURL(const OUString& rURL, const OUString& rTarget)
     // SvtSecurityOptions to access Libreoffice global security parameters
     SvtSecurityOptions aSecOpt;
     bool bCtrlClickHappened = (nScClickMouseModifier & KEY_MOD1);
-    bool bCtrlClickSecOption = aSecOpt.IsOptionSet( SvtSecurityOptions::E_CTRLCLICK_HYPERLINK );
+    bool bCtrlClickSecOption = aSecOpt.IsOptionSet( SvtSecurityOptions::EOption::CtrlClickHyperlink );
     if( bCtrlClickHappened && !( bCtrlClickSecOption ) )
     {
         // return since ctrl+click happened when the
diff --git a/sc/source/ui/view/gridwin5.cxx b/sc/source/ui/view/gridwin5.cxx
index 00b81b8..928c98d 100644
--- a/sc/source/ui/view/gridwin5.cxx
+++ b/sc/source/ui/view/gridwin5.cxx
@@ -241,7 +241,7 @@ void ScGridWindow::RequestHelp(const HelpEvent& rHEvt)
     //To know whether to prefix STR_CTRLCLICKHYERLINK or STR_CLICKHYPERLINK
     //to hyperlink tooltips/help text
     SvtSecurityOptions aSecOpt;
-    bool bCtrlClickHlink = aSecOpt.IsOptionSet( SvtSecurityOptions::E_CTRLCLICK_HYPERLINK );
+    bool bCtrlClickHlink = aSecOpt.IsOptionSet( SvtSecurityOptions::EOption::CtrlClickHyperlink );
     //Global string STR_CTRLCLICKHYPERLINK i.e,
     // "ctrl-click to follow link:" for not MacOS
     // "⌘-click to follow link:" for MacOs
diff --git a/sfx2/source/appl/appcfg.cxx b/sfx2/source/appl/appcfg.cxx
index e17dcac..61593bb 100644
--- a/sfx2/source/appl/appcfg.cxx
+++ b/sfx2/source/appl/appcfg.cxx
@@ -300,7 +300,7 @@ void SfxApplication::GetOptions( SfxItemSet& rSet )
                 case SID_BASIC_ENABLED :
                     {
                         bRet = true;
-                        if (!aSecurityOptions.IsReadOnly(SvtSecurityOptions::E_BASICMODE))
+                        if (!aSecurityOptions.IsReadOnly(SvtSecurityOptions::EOption::BasicMode))
                         {
                             if ( !rSet.Put( SfxUInt16Item( rPool.GetWhich( SID_BASIC_ENABLED ), sal::static_int_cast< sal_uInt16 >(aSecurityOptions.GetBasicMode()))))
                                 bRet = false;
@@ -310,7 +310,7 @@ void SfxApplication::GetOptions( SfxItemSet& rSet )
                 case SID_INET_EXE_PLUGIN  :
                     {
                         bRet = true;
-                        if (!aSecurityOptions.IsReadOnly(SvtSecurityOptions::E_EXECUTEPLUGINS))
+                        if (!aSecurityOptions.IsReadOnly(SvtSecurityOptions::EOption::ExecutePlugins))
                         {
                             if ( !rSet.Put( SfxBoolItem( SID_INET_EXE_PLUGIN, aSecurityOptions.IsExecutePlugins() ) ) )
                                 bRet = false;
@@ -320,7 +320,7 @@ void SfxApplication::GetOptions( SfxItemSet& rSet )
                 case SID_MACRO_WARNING :
                     {
                         bRet = true;
-                        if (!aSecurityOptions.IsReadOnly(SvtSecurityOptions::E_WARNING))
+                        if (!aSecurityOptions.IsReadOnly(SvtSecurityOptions::EOption::Warning))
                         {
                             if ( !rSet.Put( SfxBoolItem( SID_MACRO_WARNING, aSecurityOptions.IsWarningEnabled() ) ) )
                                 bRet = false;
@@ -330,7 +330,7 @@ void SfxApplication::GetOptions( SfxItemSet& rSet )
                 case SID_MACRO_CONFIRMATION :
                     {
                         bRet = true;
-                        if (!aSecurityOptions.IsReadOnly(SvtSecurityOptions::E_CONFIRMATION))
+                        if (!aSecurityOptions.IsReadOnly(SvtSecurityOptions::EOption::Confirmation))
                         {
                             if ( !rSet.Put( SfxBoolItem( SID_MACRO_CONFIRMATION, aSecurityOptions.IsConfirmationEnabled() ) ) )
                                 bRet = false;
@@ -340,7 +340,7 @@ void SfxApplication::GetOptions( SfxItemSet& rSet )
                 case SID_SECURE_URL :
                     {
                         bRet = true;
-                        if (!aSecurityOptions.IsReadOnly(SvtSecurityOptions::E_SECUREURLS))
+                        if (!aSecurityOptions.IsReadOnly(SvtSecurityOptions::EOption::SecureUrls))
                         {
                             css::uno::Sequence< OUString > seqURLs = aSecurityOptions.GetSecureURLs();
                             std::vector<OUString> aList;
diff --git a/sfx2/source/dialog/filedlghelper.cxx b/sfx2/source/dialog/filedlghelper.cxx
index 8cdbd19..647759c 100644
--- a/sfx2/source/dialog/filedlghelper.cxx
+++ b/sfx2/source/dialog/filedlghelper.cxx
@@ -1409,7 +1409,7 @@ ErrCode FileDialogHelper_Impl::execute( std::vector<OUString>& rpURLList,
     {
         SvtSecurityOptions aSecOpt;
         mbPwdCheckBoxState = (
-            aSecOpt.IsOptionSet( SvtSecurityOptions::E_DOCWARN_RECOMMENDPASSWORD ) );
+            aSecOpt.IsOptionSet( SvtSecurityOptions::EOption::DocWarnRecommendPassword ) );
     }
 
     rpURLList.clear();
diff --git a/sfx2/source/doc/objcont.cxx b/sfx2/source/doc/objcont.cxx
index 859036e..b301545 100644
--- a/sfx2/source/doc/objcont.cxx
+++ b/sfx2/source/doc/objcont.cxx
@@ -181,7 +181,7 @@ void SfxObjectShell::UpdateDocInfoForSave()
 
     // clear user data if recommend (see 'Tools - Options - Open/StarOffice - Security')
     if ( SvtSecurityOptions().IsOptionSet(
-            SvtSecurityOptions::E_DOCWARN_REMOVEPERSONALINFO ) )
+            SvtSecurityOptions::EOption::DocWarnRemovePersonalInfo ) )
     {
         xDocProps->resetUserData( OUString() );
     }
diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx
index 4468b96..92ad923 100644
--- a/sfx2/source/doc/objstor.cxx
+++ b/sfx2/source/doc/objstor.cxx
@@ -2914,25 +2914,25 @@ sal_Int16 SfxObjectShell::QueryHiddenInformation( HiddenWarningFact eFact, vcl::
         case HiddenWarningFact::WhenSaving :
         {
             nResId = STR_HIDDENINFO_CONTINUE_SAVING;
-            eOption = SvtSecurityOptions::E_DOCWARN_SAVEORSEND;
+            eOption = SvtSecurityOptions::EOption::DocWarnSaveOrSend;
             break;
         }
         case HiddenWarningFact::WhenPrinting :
         {
             nResId = STR_HIDDENINFO_CONTINUE_PRINTING;
-            eOption = SvtSecurityOptions::E_DOCWARN_PRINT;
+            eOption = SvtSecurityOptions::EOption::DocWarnPrint;
             break;
         }
         case HiddenWarningFact::WhenSigning :
         {
             nResId = STR_HIDDENINFO_CONTINUE_SIGNING;
-            eOption = SvtSecurityOptions::E_DOCWARN_SIGNING;
+            eOption = SvtSecurityOptions::EOption::DocWarnSigning;
             break;
         }
         case HiddenWarningFact::WhenCreatingPDF :
         {
             nResId = STR_HIDDENINFO_CONTINUE_CREATEPDF;
-            eOption = SvtSecurityOptions::E_DOCWARN_CREATEPDF;
+            eOption = SvtSecurityOptions::EOption::DocWarnCreatePdf;
             break;
         }
         default:
diff --git a/sw/source/core/draw/dpage.cxx b/sw/source/core/draw/dpage.cxx
index 8163b26..b1a2190 100644
--- a/sw/source/core/draw/dpage.cxx
+++ b/sw/source/core/draw/dpage.cxx
@@ -227,7 +227,7 @@ bool SwDPage::RequestHelp( vcl::Window* pWindow, SdrView* pView,
                 if ( !bExecHyperlinks )
                 {
                     SvtSecurityOptions aSecOpts;
-                    bExecHyperlinks = !aSecOpts.IsOptionSet( SvtSecurityOptions::E_CTRLCLICK_HYPERLINK );
+                    bExecHyperlinks = !aSecOpts.IsOptionSet( SvtSecurityOptions::EOption::CtrlClickHyperlink );
 
                     if ( !bExecHyperlinks )
                         sText = SwViewShell::GetShellRes()->aLinkCtrlClick + ": " + sText;
diff --git a/sw/source/uibase/docvw/SidebarTxtControl.cxx b/sw/source/uibase/docvw/SidebarTxtControl.cxx
index 8609b54..efdd971 100644
--- a/sw/source/uibase/docvw/SidebarTxtControl.cxx
+++ b/sw/source/uibase/docvw/SidebarTxtControl.cxx
@@ -310,7 +310,7 @@ void SidebarTextControl::MouseMove( const MouseEvent& rMEvt )
             {
                 OUString sURL( pURL->GetURL() );
                 SvtSecurityOptions aSecOpts;
-                if ( aSecOpts.IsOptionSet( SvtSecurityOptions::E_CTRLCLICK_HYPERLINK) )
+                if ( aSecOpts.IsOptionSet( SvtSecurityOptions::EOption::CtrlClickHyperlink) )
                     sURL = SwViewShell::GetShellRes()->aLinkCtrlClick + ": " + sURL;
                 else
                     sURL = SwViewShell::GetShellRes()->aLinkClick + ": " + sURL;
@@ -325,7 +325,7 @@ void SidebarTextControl::MouseButtonDown( const MouseEvent& rMEvt )
     if ( GetTextView() )
     {
         SvtSecurityOptions aSecOpts;
-        bool bExecuteMod = aSecOpts.IsOptionSet( SvtSecurityOptions::E_CTRLCLICK_HYPERLINK);
+        bool bExecuteMod = aSecOpts.IsOptionSet( SvtSecurityOptions::EOption::CtrlClickHyperlink);
 
         if ( !bExecuteMod || (rMEvt.GetModifier() == KEY_MOD1))
         {
diff --git a/sw/source/uibase/docvw/edtwin.cxx b/sw/source/uibase/docvw/edtwin.cxx
index 37c1712..eb84680 100644
--- a/sw/source/uibase/docvw/edtwin.cxx
+++ b/sw/source/uibase/docvw/edtwin.cxx
@@ -422,7 +422,7 @@ void SwEditWin::UpdatePointer(const Point &rLPt, sal_uInt16 nModifier )
     if ( !bExecHyperlinks )
     {
         SvtSecurityOptions aSecOpts;
-        const bool bSecureOption = aSecOpts.IsOptionSet( SvtSecurityOptions::E_CTRLCLICK_HYPERLINK );
+        const bool bSecureOption = aSecOpts.IsOptionSet( SvtSecurityOptions::EOption::CtrlClickHyperlink );
         if ( (  bSecureOption && nModifier == KEY_MOD1 ) ||
              ( !bSecureOption && nModifier != KEY_MOD1 ) )
             bExecHyperlinks = true;
@@ -3154,7 +3154,7 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt)
         if ( !bExecHyperlinks )
         {
             SvtSecurityOptions aSecOpts;
-            const bool bSecureOption = aSecOpts.IsOptionSet( SvtSecurityOptions::E_CTRLCLICK_HYPERLINK );
+            const bool bSecureOption = aSecOpts.IsOptionSet( SvtSecurityOptions::EOption::CtrlClickHyperlink );
             if ( (  bSecureOption && rMEvt.GetModifier() == KEY_MOD1 ) ||
                  ( !bSecureOption && rMEvt.GetModifier() != KEY_MOD1 ) )
                 bExecHyperlinks = true;
@@ -4612,7 +4612,7 @@ void SwEditWin::MouseButtonUp(const MouseEvent& rMEvt)
                         if ( !bExecHyperlinks )
                         {
                             SvtSecurityOptions aSecOpts;
-                            const bool bSecureOption = aSecOpts.IsOptionSet( SvtSecurityOptions::E_CTRLCLICK_HYPERLINK );
+                            const bool bSecureOption = aSecOpts.IsOptionSet( SvtSecurityOptions::EOption::CtrlClickHyperlink );
                             if ( (  bSecureOption && rMEvt.GetModifier() == KEY_MOD1 ) ||
                                  ( !bSecureOption && rMEvt.GetModifier() != KEY_MOD1 ) )
                                 bExecHyperlinks = true;
diff --git a/sw/source/uibase/docvw/edtwin2.cxx b/sw/source/uibase/docvw/edtwin2.cxx
index ea84cdd..14e031b 100644
--- a/sw/source/uibase/docvw/edtwin2.cxx
+++ b/sw/source/uibase/docvw/edtwin2.cxx
@@ -220,7 +220,7 @@ void SwEditWin::RequestHelp(const HelpEvent &rEvt)
                 if ( !bExecHyperlinks )
                 {
                     SvtSecurityOptions aSecOpts;
-                    bExecHyperlinks = !aSecOpts.IsOptionSet( SvtSecurityOptions::E_CTRLCLICK_HYPERLINK );
+                    bExecHyperlinks = !aSecOpts.IsOptionSet( SvtSecurityOptions::EOption::CtrlClickHyperlink );
 
                     sText = ": " + sText;
                     if ( !bExecHyperlinks )
diff --git a/unotools/source/config/securityoptions.cxx b/unotools/source/config/securityoptions.cxx
index 43cbebe..f2b57ed 100644
--- a/unotools/source/config/securityoptions.cxx
+++ b/unotools/source/config/securityoptions.cxx
@@ -506,35 +506,35 @@ bool SvtSecurityOptions_Impl::GetOption( SvtSecurityOptions::EOption eOption, bo
 {
     switch( eOption )
     {
-        case SvtSecurityOptions::E_DOCWARN_SAVEORSEND:
+        case SvtSecurityOptions::EOption::DocWarnSaveOrSend:
             rpValue = &m_bSaveOrSend;
             rpRO = &m_bROSaveOrSend;
             break;
-        case SvtSecurityOptions::E_DOCWARN_SIGNING:
+        case SvtSecurityOptions::EOption::DocWarnSigning:
             rpValue = &m_bSigning;
             rpRO = &m_bROSigning;
             break;
-        case SvtSecurityOptions::E_DOCWARN_PRINT:
+        case SvtSecurityOptions::EOption::DocWarnPrint:
             rpValue = &m_bPrint;
             rpRO = &m_bROPrint;
             break;
-        case SvtSecurityOptions::E_DOCWARN_CREATEPDF:
+        case SvtSecurityOptions::EOption::DocWarnCreatePdf:
             rpValue = &m_bCreatePDF;
             rpRO = &m_bROCreatePDF;
             break;
-        case SvtSecurityOptions::E_DOCWARN_REMOVEPERSONALINFO:
+        case SvtSecurityOptions::EOption::DocWarnRemovePersonalInfo:
             rpValue = &m_bRemoveInfo;
             rpRO = &m_bRORemoveInfo;
             break;
-        case SvtSecurityOptions::E_DOCWARN_RECOMMENDPASSWORD:
+        case SvtSecurityOptions::EOption::DocWarnRecommendPassword:
             rpValue = &m_bRecommendPwd;
             rpRO = &m_bRORecommendPwd;
             break;
-        case SvtSecurityOptions::E_CTRLCLICK_HYPERLINK:
+        case SvtSecurityOptions::EOption::CtrlClickHyperlink:
             rpValue = &m_bCtrlClickHyperlink;
             rpRO = &m_bROCtrlClickHyperlink;
             break;
-        case SvtSecurityOptions::E_BLOCKUNTRUSTEDREFERERLINKS:
+        case SvtSecurityOptions::EOption::BlockUntrustedRefererLinks:
             rpValue = &m_bBlockUntrustedRefererLinks;
             rpRO = &m_bROBlockUntrustedRefererLinks;
             break;
@@ -760,54 +760,51 @@ bool SvtSecurityOptions_Impl::IsReadOnly( SvtSecurityOptions::EOption eOption )
     bool    bReadonly;
     switch(eOption)
     {
-        case SvtSecurityOptions::E_SECUREURLS :
+        case SvtSecurityOptions::EOption::SecureUrls :
             bReadonly = m_bROSecureURLs;
             break;
-        case SvtSecurityOptions::E_DOCWARN_SAVEORSEND:
+        case SvtSecurityOptions::EOption::DocWarnSaveOrSend:
             bReadonly = m_bROSaveOrSend;
             break;
-        case SvtSecurityOptions::E_DOCWARN_SIGNING:
+        case SvtSecurityOptions::EOption::DocWarnSigning:
             bReadonly = m_bROSigning;
             break;
-        case SvtSecurityOptions::E_DOCWARN_PRINT:
+        case SvtSecurityOptions::EOption::DocWarnPrint:
             bReadonly = m_bROPrint;
             break;
-        case SvtSecurityOptions::E_DOCWARN_CREATEPDF:
+        case SvtSecurityOptions::EOption::DocWarnCreatePdf:
             bReadonly = m_bROCreatePDF;
             break;
-        case SvtSecurityOptions::E_DOCWARN_REMOVEPERSONALINFO:
+        case SvtSecurityOptions::EOption::DocWarnRemovePersonalInfo:
             bReadonly = m_bRORemoveInfo;
             break;
-        case SvtSecurityOptions::E_DOCWARN_RECOMMENDPASSWORD:
+        case SvtSecurityOptions::EOption::DocWarnRecommendPassword:
             bReadonly = m_bRORecommendPwd;
             break;
-        case SvtSecurityOptions::E_MACRO_SECLEVEL:
+        case SvtSecurityOptions::EOption::MacroSecLevel:
             bReadonly = m_bROSecLevel;
             break;
-        case SvtSecurityOptions::E_MACRO_TRUSTEDAUTHORS:
+        case SvtSecurityOptions::EOption::MacroTrustedAuthors:
             bReadonly = m_bROTrustedAuthors;
             break;
-        case SvtSecurityOptions::E_MACRO_DISABLE:
-            bReadonly = m_bRODisableMacros;
-            break;
-        case SvtSecurityOptions::E_CTRLCLICK_HYPERLINK:
+        case SvtSecurityOptions::EOption::CtrlClickHyperlink:
             bReadonly = m_bROCtrlClickHyperlink;
             break;
-        case SvtSecurityOptions::E_BLOCKUNTRUSTEDREFERERLINKS:
+        case SvtSecurityOptions::EOption::BlockUntrustedRefererLinks:
             bReadonly = m_bROBlockUntrustedRefererLinks;
             break;
 
         // xmlsec05 deprecated
-        case SvtSecurityOptions::E_BASICMODE:
+        case SvtSecurityOptions::EOption::BasicMode:
             bReadonly = m_bROBasicMode;
             break;
-        case SvtSecurityOptions::E_EXECUTEPLUGINS:
+        case SvtSecurityOptions::EOption::ExecutePlugins:
             bReadonly = m_bROExecutePlugins;
             break;
-        case SvtSecurityOptions::E_WARNING:
+        case SvtSecurityOptions::EOption::Warning:
             bReadonly = m_bROWarning;
             break;
-        case SvtSecurityOptions::E_CONFIRMATION:
+        case SvtSecurityOptions::EOption::Confirmation:
             bReadonly = m_bROConfirmation;
             break;
         // xmlsec05 deprecated
@@ -998,7 +995,7 @@ bool SvtSecurityOptions::isSecureMacroUri(
 
 bool SvtSecurityOptions::isUntrustedReferer(OUString const & referer) const {
     MutexGuard g(GetInitMutex());
-    return m_pImpl->IsOptionSet(E_BLOCKUNTRUSTEDREFERERLINKS)
+    return m_pImpl->IsOptionSet(EOption::BlockUntrustedRefererLinks)
         && !(referer.isEmpty() || referer.startsWithIgnoreAsciiCase("private:")
              || isTrustedLocationUri(referer));
 }
diff --git a/xmlsecurity/source/dialogs/macrosecurity.cxx b/xmlsecurity/source/dialogs/macrosecurity.cxx
index 01d1880..c284eba 100644
--- a/xmlsecurity/source/dialogs/macrosecurity.cxx
+++ b/xmlsecurity/source/dialogs/macrosecurity.cxx
@@ -129,7 +129,7 @@ MacroSecurityLevelTP::MacroSecurityLevelTP(vcl::Window* _pParent, MacroSecurity*
     m_pVeryHighRB->SetClickHdl( LINK( this, MacroSecurityLevelTP, RadioButtonHdl ) );
 
     mnCurLevel = (sal_uInt16) mpDlg->maSecOptions.GetMacroSecurityLevel();
-    bool bReadonly = mpDlg->maSecOptions.IsReadOnly( SvtSecurityOptions::E_MACRO_SECLEVEL );
+    bool bReadonly = mpDlg->maSecOptions.IsReadOnly( SvtSecurityOptions::EOption::MacroSecLevel );
 
     RadioButton* pCheck = nullptr;
     FixedImage* pImage = nullptr;
@@ -394,14 +394,14 @@ MacroSecurityTrustedSourcesTP::MacroSecurityTrustedSourcesTP(vcl::Window* _pPare
     m_pRemoveLocPB->Disable();
 
     maTrustedAuthors = mpDlg->maSecOptions.GetTrustedAuthors();
-    mbAuthorsReadonly = mpDlg->maSecOptions.IsReadOnly( SvtSecurityOptions::E_MACRO_TRUSTEDAUTHORS );
+    mbAuthorsReadonly = mpDlg->maSecOptions.IsReadOnly( SvtSecurityOptions::EOption::MacroTrustedAuthors );
     m_pTrustCertROFI->Show( mbAuthorsReadonly );
     mbAuthorsReadonly ? m_pTrustCertLB->DisableTable() : m_pTrustCertLB->EnableTable();
 
     FillCertLB();
 
     css::uno::Sequence< OUString > aSecureURLs = mpDlg->maSecOptions.GetSecureURLs();
-    mbURLsReadonly = mpDlg->maSecOptions.IsReadOnly( SvtSecurityOptions::E_SECUREURLS );
+    mbURLsReadonly = mpDlg->maSecOptions.IsReadOnly( SvtSecurityOptions::EOption::SecureUrls );
     m_pTrustFileROFI->Show( mbURLsReadonly );
     m_pTrustFileLocLB->Enable( !mbURLsReadonly );
     m_pAddLocPB->Enable( !mbURLsReadonly );


More information about the Libreoffice-commits mailing list