[Libreoffice-commits] core.git: include/sfx2 include/unotools sfx2/source unotools/source
Noel (via logerrit)
logerrit at kemper.freedesktop.org
Tue Dec 8 10:18:14 UTC 2020
include/sfx2/sfxsids.hrc | 5
include/unotools/securityoptions.hxx | 23 ---
sfx2/source/appl/appcfg.cxx | 48 -------
unotools/source/config/securityoptions.cxx | 197 +----------------------------
4 files changed, 12 insertions(+), 261 deletions(-)
New commits:
commit f36433c10a4be39bd5e93621ee46766c587ad57c
Author: Noel <noelgrandin at gmail.com>
AuthorDate: Tue Dec 8 11:28:47 2020 +0200
Commit: Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Tue Dec 8 11:17:29 2020 +0100
remove rest of 'xmlsec05' stuff
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: I1ead1bee759eb09eb72517d90b42813ad66ea1e5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107373
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
diff --git a/include/sfx2/sfxsids.hrc b/include/sfx2/sfxsids.hrc
index 0dc8f95b725c..608756a5cb84 100644
--- a/include/sfx2/sfxsids.hrc
+++ b/include/sfx2/sfxsids.hrc
@@ -204,8 +204,7 @@ class SvxSearchItem;
#define SID_VIEW_DATA_SOURCE_BROWSER (SID_SFX_START + 1660)
#define SID_UNPACK (SID_SFX_START + 1662)
// (SID_SFX_START + 1663) used further down
-#define SID_MACRO_WARNING (SID_SFX_START + 1664)
-#define SID_MACRO_CONFIRMATION (SID_SFX_START + 1665)
+ // FREE
#define SID_OUTPUTSTREAM (SID_SFX_START + 1666)
#define SID_IMAGE_ORIENTATION (SID_SFX_START + 1667)
@@ -524,8 +523,6 @@ class SvxSearchItem;
#define SID_INET_FTP_PROXY_NAME (SID_OPTIONS_START + 40)
#define SID_INET_FTP_PROXY_PORT (SID_OPTIONS_START + 41)
-#define SID_INET_EXE_PLUGIN (SID_OPTIONS_START + 52)
-
#define SID_SAVEREL_INET (SID_OPTIONS_START + 30)
#define SID_SAVEREL_FSYS (SID_OPTIONS_START + 31)
diff --git a/include/unotools/securityoptions.hxx b/include/unotools/securityoptions.hxx
index 475d1981db50..85ae5e6d1522 100644
--- a/include/unotools/securityoptions.hxx
+++ b/include/unotools/securityoptions.hxx
@@ -37,18 +37,6 @@ namespace osl { class Mutex; }
class SvtSecurityOptions_Impl;
-/*-************************************************************************************************************
- @descr These values present modes to handle StarOffice basic scripts.
- see GetBasicMode/SetBasicMode() for further information
-*//*-*************************************************************************************************************/
-
-enum EBasicSecurityMode
-{
- eNEVER_EXECUTE = 0,
- eFROM_LIST = 1,
- eALWAYS_EXECUTE = 2
-};
-
/*-************************************************************************************************************
@short collect information about security features
@ATTENTION This class is partially threadsafe.
@@ -63,9 +51,6 @@ class SAL_WARN_UNUSED UNOTOOLS_DLLPUBLIC SvtSecurityOptions final : public utl::
enum class EOption
{
SecureUrls,
- ExecutePlugins, // xmlsec05 deprecated
- Warning, // xmlsec05 deprecated
- Confirmation, // xmlsec05 deprecated
DocWarnSaveOrSend,
DocWarnSigning,
DocWarnPrint,
@@ -178,14 +163,6 @@ class SAL_WARN_UNUSED UNOTOOLS_DLLPUBLIC SvtSecurityOptions final : public utl::
void SetOption ( EOption eOption, bool bValue );
bool IsOptionEnabled ( EOption eOption ) const;
- // xmlsec05 deprecated methods
- bool IsExecutePlugins() const;
- void SetExecutePlugins( bool bSet );
- bool IsWarningEnabled() const;
- void SetWarningEnabled( bool bSet );
- bool IsConfirmationEnabled() const;
- void SetConfirmationEnabled( bool bSet );
-
// private methods
private:
diff --git a/sfx2/source/appl/appcfg.cxx b/sfx2/source/appl/appcfg.cxx
index eab3c7c723cc..bac9a650966f 100644
--- a/sfx2/source/appl/appcfg.cxx
+++ b/sfx2/source/appl/appcfg.cxx
@@ -269,36 +269,6 @@ void SfxApplication::GetOptions( SfxItemSet& rSet )
bRet = false;
}
break;
- case SID_INET_EXE_PLUGIN :
- {
- bRet = true;
- if (!aSecurityOptions.IsReadOnly(SvtSecurityOptions::EOption::ExecutePlugins))
- {
- if ( !rSet.Put( SfxBoolItem( SID_INET_EXE_PLUGIN, aSecurityOptions.IsExecutePlugins() ) ) )
- bRet = false;
- }
- }
- break;
- case SID_MACRO_WARNING :
- {
- bRet = true;
- if (!aSecurityOptions.IsReadOnly(SvtSecurityOptions::EOption::Warning))
- {
- if ( !rSet.Put( SfxBoolItem( SID_MACRO_WARNING, aSecurityOptions.IsWarningEnabled() ) ) )
- bRet = false;
- }
- }
- break;
- case SID_MACRO_CONFIRMATION :
- {
- bRet = true;
- if (!aSecurityOptions.IsReadOnly(SvtSecurityOptions::EOption::Confirmation))
- {
- if ( !rSet.Put( SfxBoolItem( SID_MACRO_CONFIRMATION, aSecurityOptions.IsConfirmationEnabled() ) ) )
- bRet = false;
- }
- }
- break;
case SID_SECURE_URL :
{
bRet = true;
@@ -599,13 +569,6 @@ void SfxApplication::SetOptions_Impl( const SfxItemSet& rSet )
ShutdownIcon::SetAutostart( static_cast<const SfxBoolItem*>( pItem )->GetValue() );
}
- // Execute PlugIns
- if ( SfxItemState::SET == rSet.GetItemState(SID_INET_EXE_PLUGIN, true, &pItem))
- {
- DBG_ASSERT(dynamic_cast< const SfxBoolItem *>( pItem ) != nullptr, "SfxBoolItem expected");
- aSecurityOptions.SetExecutePlugins( static_cast<const SfxBoolItem *>( pItem )->GetValue() );
- }
-
if ( SfxItemState::SET == rSet.GetItemState(rPool.GetWhich(SID_INET_PROXY_TYPE), true, &pItem))
{
DBG_ASSERT( dynamic_cast< const SfxUInt16Item *>( pItem ) != nullptr, "UInt16Item expected" );
@@ -653,17 +616,6 @@ void SfxApplication::SetOptions_Impl( const SfxItemSet& rSet )
aSecurityOptions.SetSecureURLs( seqURLs );
}
- if ( SfxItemState::SET == rSet.GetItemState(SID_MACRO_WARNING, true, &pItem))
- {
- DBG_ASSERT(dynamic_cast< const SfxBoolItem *>( pItem ) != nullptr, "SfxBoolItem expected");
- aSecurityOptions.SetWarningEnabled( static_cast<const SfxBoolItem *>(pItem)->GetValue() );
- }
- if ( SfxItemState::SET == rSet.GetItemState(SID_MACRO_CONFIRMATION, true, &pItem))
- {
- DBG_ASSERT(dynamic_cast< const SfxBoolItem *>( pItem ) != nullptr, "SfxBoolItem expected");
- aSecurityOptions.SetConfirmationEnabled( static_cast<const SfxBoolItem *>(pItem)->GetValue() );
- }
-
// Store changed data
batch->commit();
}
diff --git a/unotools/source/config/securityoptions.cxx b/unotools/source/config/securityoptions.cxx
index 354907dd7864..51318039a7f7 100644
--- a/unotools/source/config/securityoptions.cxx
+++ b/unotools/source/config/securityoptions.cxx
@@ -59,31 +59,19 @@ using namespace ::com::sun::star::uno;
#define PROPERTYNAME_TRUSTEDAUTHOR_SERIALNUMBER u"SerialNumber"
#define PROPERTYNAME_TRUSTEDAUTHOR_RAWDATA u"RawData"
-// xmlsec05 deprecated
-#define PROPERTYNAME_EXECUTEPLUGINS u"ExecutePlugins"
-#define PROPERTYNAME_WARNINGENABLED u"Warning"
-#define PROPERTYNAME_CONFIRMATIONENABLED u"Confirmation"
-// xmlsec05 deprecated
-
#define PROPERTYHANDLE_SECUREURL 0
-// xmlsec05 deprecated
-#define PROPERTYHANDLE_EXECUTEPLUGINS 1
-#define PROPERTYHANDLE_WARNINGENABLED 2
-#define PROPERTYHANDLE_CONFIRMATIONENABLED 3
-// xmlsec05 deprecated
-
-#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_DOCWARN_SAVEORSEND 1
+#define PROPERTYHANDLE_DOCWARN_SIGNING 2
+#define PROPERTYHANDLE_DOCWARN_PRINT 3
+#define PROPERTYHANDLE_DOCWARN_CREATEPDF 4
+#define PROPERTYHANDLE_DOCWARN_REMOVEPERSONALINFO 5
+#define PROPERTYHANDLE_DOCWARN_RECOMMENDPASSWORD 6
+#define PROPERTYHANDLE_CTRLCLICK_HYPERLINK 7
+#define PROPERTYHANDLE_BLOCKUNTRUSTEDREFERERLINKS 8
+#define PROPERTYHANDLE_MACRO_SECLEVEL 9
+#define PROPERTYHANDLE_MACRO_TRUSTEDAUTHORS 10
+#define PROPERTYHANDLE_MACRO_DISABLE 11
#define PROPERTYHANDLE_INVALID -1
@@ -178,22 +166,6 @@ class SvtSecurityOptions_Impl : public ConfigItem
bool m_bROSecLevel;
bool m_bROTrustedAuthors;
bool m_bRODisableMacros;
-
- // xmlsec05 deprecated
- bool m_bExecutePlugins;
- bool m_bWarning;
- bool m_bConfirmation;
-
- bool m_bROConfirmation;
- bool m_bROWarning;
- bool m_bROExecutePlugins;
- public:
- bool IsWarningEnabled() const { return m_bWarning;}
- void SetWarningEnabled( bool bSet );
- bool IsConfirmationEnabled() const { return m_bConfirmation;}
- void SetConfirmationEnabled( bool bSet );
- bool IsExecutePlugins() const { return m_bExecutePlugins;}
- void SetExecutePlugins( bool bSet );
};
// constructor
@@ -224,16 +196,6 @@ SvtSecurityOptions_Impl::SvtSecurityOptions_Impl()
,m_bROSecLevel ( CFG_READONLY_DEFAULT )
,m_bROTrustedAuthors ( CFG_READONLY_DEFAULT )
,m_bRODisableMacros ( true ) // currently is not intended to be changed
-
- // xmlsec05 deprecated
- , m_bExecutePlugins ( true )
- , m_bWarning ( true )
- , m_bConfirmation ( true )
- , m_bROConfirmation ( CFG_READONLY_DEFAULT )
- , m_bROWarning ( CFG_READONLY_DEFAULT )
- , m_bROExecutePlugins ( CFG_READONLY_DEFAULT )
- // xmlsec05 deprecated
-
{
Sequence< OUString > seqNames = GetPropertyNames ( );
Sequence< Any > seqValues = GetProperties ( seqNames );
@@ -359,27 +321,6 @@ void SvtSecurityOptions_Impl::SetProperty( sal_Int32 nProperty, const Any& rValu
}
break;
- // xmlsec05 deprecated
- case PROPERTYHANDLE_EXECUTEPLUGINS:
- {
- rValue >>= m_bExecutePlugins;
- m_bROExecutePlugins = bRO;
- }
- break;
- case PROPERTYHANDLE_WARNINGENABLED:
- {
- rValue >>= m_bWarning;
- m_bROWarning = bRO;
- }
- break;
- case PROPERTYHANDLE_CONFIRMATIONENABLED:
- {
- rValue >>= m_bConfirmation;
- m_bROConfirmation = bRO;
- }
- break;
- // xmlsec05 deprecated
-
#if OSL_DEBUG_LEVEL > 0
default:
assert(false && "Unknown property!");
@@ -466,15 +407,6 @@ sal_Int32 SvtSecurityOptions_Impl::GetHandle( std::u16string_view rName )
else if( rName == PROPERTYNAME_MACRO_DISABLE )
nHandle = PROPERTYHANDLE_MACRO_DISABLE;
- // xmlsec05 deprecated
- else if( rName == PROPERTYNAME_EXECUTEPLUGINS )
- nHandle = PROPERTYHANDLE_EXECUTEPLUGINS;
- else if( rName == PROPERTYNAME_WARNINGENABLED )
- nHandle = PROPERTYHANDLE_WARNINGENABLED;
- else if( rName == PROPERTYNAME_CONFIRMATIONENABLED )
- nHandle = PROPERTYHANDLE_CONFIRMATIONENABLED;
- // xmlsec05 deprecated
-
else
nHandle = PROPERTYHANDLE_INVALID;
@@ -686,30 +618,6 @@ void SvtSecurityOptions_Impl::ImplCommit()
}
break;
- // xmlsec05 deprecated
- case PROPERTYHANDLE_EXECUTEPLUGINS:
- {
- bDone = !m_bROExecutePlugins;
- if( bDone )
- lValues[ nRealCount ] <<= m_bExecutePlugins;
- }
- break;
- case PROPERTYHANDLE_WARNINGENABLED:
- {
- bDone = !m_bROWarning;
- if( bDone )
- lValues[ nRealCount ] <<= m_bWarning;
- }
- break;
- case PROPERTYHANDLE_CONFIRMATIONENABLED:
- {
- bDone = !m_bROConfirmation;
- if( bDone )
- lValues[ nRealCount ] <<= m_bConfirmation;
- }
- break;
- // xmlsec05 deprecated
-
default:
bDone = false;
}
@@ -765,18 +673,6 @@ bool SvtSecurityOptions_Impl::IsReadOnly( SvtSecurityOptions::EOption eOption )
bReadonly = m_bROBlockUntrustedRefererLinks;
break;
- // xmlsec05 deprecated
- case SvtSecurityOptions::EOption::ExecutePlugins:
- bReadonly = m_bROExecutePlugins;
- break;
- case SvtSecurityOptions::EOption::Warning:
- bReadonly = m_bROWarning;
- break;
- case SvtSecurityOptions::EOption::Confirmation:
- bReadonly = m_bROConfirmation;
- break;
- // xmlsec05 deprecated
-
default:
bReadonly = true;
}
@@ -872,9 +768,6 @@ Sequence< OUString > SvtSecurityOptions_Impl::GetPropertyNames()
return Sequence< OUString >
{
PROPERTYNAME_SECUREURL,
- PROPERTYNAME_EXECUTEPLUGINS,
- PROPERTYNAME_WARNINGENABLED,
- PROPERTYNAME_CONFIRMATIONENABLED,
PROPERTYNAME_DOCWARN_SAVEORSEND,
PROPERTYNAME_DOCWARN_SIGNING,
PROPERTYNAME_DOCWARN_PRINT,
@@ -1040,72 +933,4 @@ Mutex& SvtSecurityOptions::GetInitMutex()
return theSecurityOptionsMutex::get();
}
-void SvtSecurityOptions_Impl::SetExecutePlugins( bool bSet )
-{
- DBG_ASSERT(!m_bROExecutePlugins, "SvtSecurityOptions_Impl::SetExecutePlugins()\nYou tried to write on a readonly value!\n");
- if (!m_bROExecutePlugins && m_bExecutePlugins!=bSet)
- {
- m_bExecutePlugins = bSet;
- SetModified();
- }
-}
-
-
-void SvtSecurityOptions_Impl::SetWarningEnabled( bool bSet )
-{
- DBG_ASSERT(!m_bROWarning, "SvtSecurityOptions_Impl::SetWarningEnabled()\nYou tried to write on a readonly value!\n");
- if (!m_bROWarning && m_bWarning!=bSet)
- {
- m_bWarning = bSet;
- SetModified();
- }
-}
-
-
-void SvtSecurityOptions_Impl::SetConfirmationEnabled( bool bSet )
-{
- DBG_ASSERT(!m_bROConfirmation, "SvtSecurityOptions_Impl::SetConfirmationEnabled()\nYou tried to write on a readonly value!\n");
- if (!m_bROConfirmation && m_bConfirmation!=bSet)
- {
- m_bConfirmation = bSet;
- SetModified();
- }
-}
-
-bool SvtSecurityOptions::IsExecutePlugins() const
-{
- MutexGuard aGuard( GetInitMutex() );
- return m_pImpl->IsExecutePlugins();
-}
-
-void SvtSecurityOptions::SetExecutePlugins( bool bSet )
-{
- MutexGuard aGuard( GetInitMutex() );
- m_pImpl->SetExecutePlugins( bSet );
-}
-
-bool SvtSecurityOptions::IsWarningEnabled() const
-{
- MutexGuard aGuard( GetInitMutex() );
- return m_pImpl->IsWarningEnabled();
-}
-
-void SvtSecurityOptions::SetWarningEnabled( bool bSet )
-{
- MutexGuard aGuard( GetInitMutex() );
- m_pImpl->SetWarningEnabled( bSet );
-}
-
-bool SvtSecurityOptions::IsConfirmationEnabled() const
-{
- MutexGuard aGuard( GetInitMutex() );
- return m_pImpl->IsConfirmationEnabled();
-}
-
-void SvtSecurityOptions::SetConfirmationEnabled( bool bSet )
-{
- MutexGuard aGuard( GetInitMutex() );
- m_pImpl->SetConfirmationEnabled( bSet );
-}
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
More information about the Libreoffice-commits
mailing list