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

Noel (via logerrit) logerrit at kemper.freedesktop.org
Mon Dec 7 11:28:21 UTC 2020


 cui/source/options/treeopt.cxx             |    2 
 include/sfx2/sfxsids.hrc                   |    1 
 include/unotools/securityoptions.hxx       |    3 -
 sfx2/source/appl/appcfg.cxx                |   17 -----
 unotools/source/config/securityoptions.cxx |   86 +++++------------------------
 5 files changed, 16 insertions(+), 93 deletions(-)

New commits:
commit fbc909364c9c3964c1354169527e68446905c39b
Author:     Noel <noelgrandin at gmail.com>
AuthorDate: Wed Dec 2 10:27:42 2020 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Mon Dec 7 12:27:34 2020 +0100

    remove SID_BASIC_ENABLED and BasicEnabled option
    
    which has never been used since creation in
        commit fd069bee7e57ad529c3c0974559fd2d84ec3151a
        Author: Jens-Heiner Rechtien <hr at openoffice.org>
        Date:   Mon Sep 18 16:07:07 2000 +0000
        initial import
    
    Change-Id: I018b1f734c8263167dab3d5c6f98a400666f01d6
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107047
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/cui/source/options/treeopt.cxx b/cui/source/options/treeopt.cxx
index 968d3f6c14cc..e254153ad4cc 100644
--- a/cui/source/options/treeopt.cxx
+++ b/cui/source/options/treeopt.cxx
@@ -1142,7 +1142,7 @@ std::unique_ptr<SfxItemSet> OfaTreeOptionsDialog::CreateItemSet( sal_uInt16 nId
         break;
         case SID_INET_DLG :
                 pRet = std::make_unique<SfxItemSet>( SfxGetpApp()->GetPool(),
-                                svl::Items<SID_BASIC_ENABLED, SID_BASIC_ENABLED,
+                                svl::Items<
                 //SID_OPTIONS_START - ..END
                                 SID_SAVEREL_INET, SID_SAVEREL_FSYS,
                                 SID_INET_NOPROXY, SID_INET_FTP_PROXY_PORT,
diff --git a/include/sfx2/sfxsids.hrc b/include/sfx2/sfxsids.hrc
index 38b5fe7fe875..0dc8f95b725c 100644
--- a/include/sfx2/sfxsids.hrc
+++ b/include/sfx2/sfxsids.hrc
@@ -469,7 +469,6 @@ class SvxSearchItem;
 #define SID_GALLERY                         (SID_SFX_START + 960)
 #define SID_SEARCH_DLG                      (SID_SFX_START + 961)
 #define SID_SEARCH_QUIET                    (SID_SFX_START + 1684)
-#define SID_BASIC_ENABLED                   (SID_SFX_START + 964)
 #define SID_EXPORT_DIALOG                   (SID_SFX_START + 965)
 #define SID_IMPORT_DIALOG                   (SID_SFX_START + 966)
 
diff --git a/include/unotools/securityoptions.hxx b/include/unotools/securityoptions.hxx
index 44b99fdc9a57..475d1981db50 100644
--- a/include/unotools/securityoptions.hxx
+++ b/include/unotools/securityoptions.hxx
@@ -63,7 +63,6 @@ class SAL_WARN_UNUSED UNOTOOLS_DLLPUBLIC SvtSecurityOptions final : public utl::
         enum class EOption
         {
             SecureUrls,
-            BasicMode,                    // xmlsec05 deprecated
             ExecutePlugins,               // xmlsec05 deprecated
             Warning,                      // xmlsec05 deprecated
             Confirmation,                 // xmlsec05 deprecated
@@ -182,8 +181,6 @@ class SAL_WARN_UNUSED UNOTOOLS_DLLPUBLIC SvtSecurityOptions final : public utl::
         // xmlsec05 deprecated methods
         bool    IsExecutePlugins() const;
         void        SetExecutePlugins( bool bSet );
-        EBasicSecurityMode  GetBasicMode(                           ) const;
-        void                SetBasicMode( EBasicSecurityMode eMode  );
         bool IsWarningEnabled() const;
         void SetWarningEnabled( bool bSet );
         bool IsConfirmationEnabled() const;
diff --git a/sfx2/source/appl/appcfg.cxx b/sfx2/source/appl/appcfg.cxx
index 0edc35c70396..eab3c7c723cc 100644
--- a/sfx2/source/appl/appcfg.cxx
+++ b/sfx2/source/appl/appcfg.cxx
@@ -269,16 +269,6 @@ void SfxApplication::GetOptions( SfxItemSet& rSet )
                                 bRet = false;
                     }
                     break;
-                case SID_BASIC_ENABLED :
-                    {
-                        bRet = true;
-                        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;
-                        }
-                    }
-                    break;
                 case SID_INET_EXE_PLUGIN  :
                     {
                         bRet = true;
@@ -609,13 +599,6 @@ void SfxApplication::SetOptions_Impl( const SfxItemSet& rSet )
         ShutdownIcon::SetAutostart( static_cast<const SfxBoolItem*>( pItem )->GetValue() );
     }
 
-    // StarBasic Enable
-    if ( SfxItemState::SET == rSet.GetItemState(SID_BASIC_ENABLED, true, &pItem))
-    {
-        DBG_ASSERT(dynamic_cast< const SfxUInt16Item *>( pItem ) !=  nullptr, "SfxInt16Item expected");
-        aSecurityOptions.SetBasicMode( static_cast<EBasicSecurityMode>(static_cast<const SfxUInt16Item*>( pItem )->GetValue()) );
-    }
-
     // Execute PlugIns
     if ( SfxItemState::SET == rSet.GetItemState(SID_INET_EXE_PLUGIN, true, &pItem))
     {
diff --git a/unotools/source/config/securityoptions.cxx b/unotools/source/config/securityoptions.cxx
index 5062653413b9..354907dd7864 100644
--- a/unotools/source/config/securityoptions.cxx
+++ b/unotools/source/config/securityoptions.cxx
@@ -43,9 +43,6 @@ using namespace ::com::sun::star::uno;
 #define DEFAULT_SECUREURL               Sequence< OUString >()
 #define DEFAULT_TRUSTEDAUTHORS          Sequence< SvtSecurityOptions::Certificate >()
 
-// xmlsec05 deprecated
-#define DEFAULT_STAROFFICEBASIC         eALWAYS_EXECUTE
-
 #define PROPERTYNAME_SECUREURL                  u"SecureURL"
 #define PROPERTYNAME_DOCWARN_SAVEORSEND         u"WarnSaveOrSendDoc"
 #define PROPERTYNAME_DOCWARN_SIGNING            u"WarnSignDoc"
@@ -63,7 +60,6 @@ using namespace ::com::sun::star::uno;
 #define PROPERTYNAME_TRUSTEDAUTHOR_RAWDATA      u"RawData"
 
 // xmlsec05 deprecated
-#define PROPERTYNAME_STAROFFICEBASIC    u"OfficeBasic"
 #define PROPERTYNAME_EXECUTEPLUGINS     u"ExecutePlugins"
 #define PROPERTYNAME_WARNINGENABLED     u"Warning"
 #define PROPERTYNAME_CONFIRMATIONENABLED u"Confirmation"
@@ -72,23 +68,22 @@ using namespace ::com::sun::star::uno;
 #define PROPERTYHANDLE_SECUREURL                    0
 
 // xmlsec05 deprecated
-#define PROPERTYHANDLE_STAROFFICEBASIC  1
-#define PROPERTYHANDLE_EXECUTEPLUGINS   2
-#define PROPERTYHANDLE_WARNINGENABLED   3
-#define PROPERTYHANDLE_CONFIRMATIONENABLED 4
+#define PROPERTYHANDLE_EXECUTEPLUGINS   1
+#define PROPERTYHANDLE_WARNINGENABLED   2
+#define PROPERTYHANDLE_CONFIRMATIONENABLED 3
 // xmlsec05 deprecated
 
-#define PROPERTYHANDLE_DOCWARN_SAVEORSEND           5
-#define PROPERTYHANDLE_DOCWARN_SIGNING              6
-#define PROPERTYHANDLE_DOCWARN_PRINT                7
-#define PROPERTYHANDLE_DOCWARN_CREATEPDF            8
-#define PROPERTYHANDLE_DOCWARN_REMOVEPERSONALINFO   9
-#define PROPERTYHANDLE_DOCWARN_RECOMMENDPASSWORD    10
-#define PROPERTYHANDLE_CTRLCLICK_HYPERLINK          11
-#define PROPERTYHANDLE_BLOCKUNTRUSTEDREFERERLINKS   12
-#define PROPERTYHANDLE_MACRO_SECLEVEL               13
-#define PROPERTYHANDLE_MACRO_TRUSTEDAUTHORS         14
-#define PROPERTYHANDLE_MACRO_DISABLE                15
+#define PROPERTYHANDLE_DOCWARN_SAVEORSEND           4
+#define PROPERTYHANDLE_DOCWARN_SIGNING              5
+#define PROPERTYHANDLE_DOCWARN_PRINT                6
+#define PROPERTYHANDLE_DOCWARN_CREATEPDF            7
+#define PROPERTYHANDLE_DOCWARN_REMOVEPERSONALINFO   8
+#define PROPERTYHANDLE_DOCWARN_RECOMMENDPASSWORD    9
+#define PROPERTYHANDLE_CTRLCLICK_HYPERLINK          10
+#define PROPERTYHANDLE_BLOCKUNTRUSTEDREFERERLINKS   11
+#define PROPERTYHANDLE_MACRO_SECLEVEL               12
+#define PROPERTYHANDLE_MACRO_TRUSTEDAUTHORS         13
+#define PROPERTYHANDLE_MACRO_DISABLE                14
 
 #define PROPERTYHANDLE_INVALID                      -1
 
@@ -185,7 +180,6 @@ class SvtSecurityOptions_Impl : public ConfigItem
         bool                                    m_bRODisableMacros;
 
         // xmlsec05 deprecated
-        EBasicSecurityMode      m_eBasicMode;
         bool                m_bExecutePlugins;
         bool                m_bWarning;
         bool                m_bConfirmation;
@@ -193,7 +187,6 @@ class SvtSecurityOptions_Impl : public ConfigItem
         bool                m_bROConfirmation;
         bool                m_bROWarning;
         bool                m_bROExecutePlugins;
-        bool                m_bROBasicMode;
         public:
         bool IsWarningEnabled() const { return m_bWarning;}
         void SetWarningEnabled( bool bSet );
@@ -201,9 +194,6 @@ class SvtSecurityOptions_Impl : public ConfigItem
         void SetConfirmationEnabled( bool bSet );
         bool    IsExecutePlugins() const { return m_bExecutePlugins;}
         void        SetExecutePlugins( bool bSet );
-        // xmlsec05 deprecated
-        EBasicSecurityMode      GetBasicMode    (                                               ) const { return m_eBasicMode;}
-        void                    SetBasicMode    (           EBasicSecurityMode      eMode       );
 };
 
 //  constructor
@@ -236,14 +226,12 @@ SvtSecurityOptions_Impl::SvtSecurityOptions_Impl()
     ,m_bRODisableMacros     ( true                  ) // currently is not intended to be changed
 
     // xmlsec05 deprecated
-    ,   m_eBasicMode        ( DEFAULT_STAROFFICEBASIC )
     ,   m_bExecutePlugins   ( true                )
     ,   m_bWarning          ( true                )
     ,   m_bConfirmation     ( true                )
     ,   m_bROConfirmation   ( CFG_READONLY_DEFAULT    )
     ,   m_bROWarning        ( CFG_READONLY_DEFAULT    )
     ,   m_bROExecutePlugins ( CFG_READONLY_DEFAULT    )
-    ,   m_bROBasicMode      ( CFG_READONLY_DEFAULT    )
     // xmlsec05 deprecated
 
 {
@@ -254,7 +242,7 @@ SvtSecurityOptions_Impl::SvtSecurityOptions_Impl()
     // Safe impossible cases.
     // We need values from ALL configuration keys.
     // Follow assignment use order of values in relation to our list of key names!
-    DBG_ASSERT( !(seqNames.getLength()!=seqValues.getLength()), "SvtSecurityOptions_Impl::SvtSecurityOptions_Impl()\nI miss some values of configuration keys!\n" );
+    assert( seqNames.getLength() == seqValues.getLength() && "I miss some values of configuration keys!" );
 
     // Copy values from list in right order to our internal member.
     sal_Int32               nPropertyCount = seqValues.getLength();
@@ -372,14 +360,6 @@ void SvtSecurityOptions_Impl::SetProperty( sal_Int32 nProperty, const Any& rValu
         break;
 
         // xmlsec05 deprecated
-        case PROPERTYHANDLE_STAROFFICEBASIC:
-        {
-            sal_Int32 nMode = 0;
-            rValue >>= nMode;
-            m_eBasicMode = static_cast<EBasicSecurityMode>(nMode);
-            m_bROBasicMode = bRO;
-        }
-        break;
         case PROPERTYHANDLE_EXECUTEPLUGINS:
         {
             rValue >>= m_bExecutePlugins;
@@ -487,8 +467,6 @@ sal_Int32 SvtSecurityOptions_Impl::GetHandle( std::u16string_view rName )
         nHandle = PROPERTYHANDLE_MACRO_DISABLE;
 
     // xmlsec05 deprecated
-    else if( rName == PROPERTYNAME_STAROFFICEBASIC )
-        nHandle = PROPERTYHANDLE_STAROFFICEBASIC;
     else if( rName == PROPERTYNAME_EXECUTEPLUGINS )
         nHandle = PROPERTYHANDLE_EXECUTEPLUGINS;
     else if( rName == PROPERTYNAME_WARNINGENABLED )
@@ -709,13 +687,6 @@ void SvtSecurityOptions_Impl::ImplCommit()
             break;
 
             // xmlsec05 deprecated
-            case PROPERTYHANDLE_STAROFFICEBASIC:
-            {
-                bDone = !m_bROBasicMode;
-                if( bDone )
-                    lValues[ nRealCount ] <<= static_cast<sal_Int32>(m_eBasicMode);
-            }
-            break;
             case PROPERTYHANDLE_EXECUTEPLUGINS:
             {
                 bDone = !m_bROExecutePlugins;
@@ -795,9 +766,6 @@ bool SvtSecurityOptions_Impl::IsReadOnly( SvtSecurityOptions::EOption eOption )
             break;
 
         // xmlsec05 deprecated
-        case SvtSecurityOptions::EOption::BasicMode:
-            bReadonly = m_bROBasicMode;
-            break;
         case SvtSecurityOptions::EOption::ExecutePlugins:
             bReadonly = m_bROExecutePlugins;
             break;
@@ -904,7 +872,6 @@ Sequence< OUString > SvtSecurityOptions_Impl::GetPropertyNames()
     return Sequence< OUString >
     {
         PROPERTYNAME_SECUREURL,
-        PROPERTYNAME_STAROFFICEBASIC,
         PROPERTYNAME_EXECUTEPLUGINS,
         PROPERTYNAME_WARNINGENABLED,
         PROPERTYNAME_CONFIRMATIONENABLED,
@@ -1073,17 +1040,6 @@ Mutex& SvtSecurityOptions::GetInitMutex()
     return theSecurityOptionsMutex::get();
 }
 
-void SvtSecurityOptions_Impl::SetBasicMode( EBasicSecurityMode eMode )
-{
-    DBG_ASSERT(!m_bROBasicMode, "SvtSecurityOptions_Impl::SetBasicMode()\nYou tried to write on a readonly value!\n");
-    if (!m_bROBasicMode && m_eBasicMode!=eMode)
-    {
-        m_eBasicMode = eMode;
-        SetModified();
-    }
-}
-
-
 void SvtSecurityOptions_Impl::SetExecutePlugins( bool bSet )
 {
     DBG_ASSERT(!m_bROExecutePlugins, "SvtSecurityOptions_Impl::SetExecutePlugins()\nYou tried to write on a readonly value!\n");
@@ -1152,16 +1108,4 @@ void SvtSecurityOptions::SetConfirmationEnabled( bool bSet )
     m_pImpl->SetConfirmationEnabled( bSet );
 }
 
-void SvtSecurityOptions::SetBasicMode( EBasicSecurityMode eMode )
-{
-    MutexGuard aGuard( GetInitMutex() );
-    m_pImpl->SetBasicMode( eMode );
-}
-
-EBasicSecurityMode SvtSecurityOptions::GetBasicMode() const
-{
-    MutexGuard aGuard( GetInitMutex() );
-    return m_pImpl->GetBasicMode();
-}
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */


More information about the Libreoffice-commits mailing list