summaryrefslogtreecommitdiff
path: root/sfx2/source/appl
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2021-07-25 21:35:05 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-07-26 14:25:35 +0200
commit6ed8c5a0f19901ab413c6610649326b2475c3a8c (patch)
tree948037d1a61f9e88547b88e107ba6e8a306c3833 /sfx2/source/appl
parenta23b44fd9f0119f7ea3523e32875f55c1a07c1cd (diff)
use officecfg for security options
Change-Id: I9d91fd5b260b82e05aac6567143386742953ecf6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119486 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sfx2/source/appl')
-rw-r--r--sfx2/source/appl/appcfg.cxx13
-rw-r--r--sfx2/source/appl/appopen.cxx2
-rw-r--r--sfx2/source/appl/linkmgr2.cxx2
-rw-r--r--sfx2/source/appl/sfxhelp.cxx3
4 files changed, 7 insertions, 13 deletions
diff --git a/sfx2/source/appl/appcfg.cxx b/sfx2/source/appl/appcfg.cxx
index e2435ce2f43b..233a2bd46334 100644
--- a/sfx2/source/appl/appcfg.cxx
+++ b/sfx2/source/appl/appcfg.cxx
@@ -115,7 +115,6 @@ void SfxApplication::GetOptions( SfxItemSet& rSet )
SfxItemPool &rPool = GetPool();
const WhichRangesContainer& pRanges = rSet.GetRanges();
- SvtSecurityOptions aSecurityOptions;
SvtMiscOptions aMiscOptions;
for (auto const & pRange : pRanges)
@@ -281,12 +280,11 @@ void SfxApplication::GetOptions( SfxItemSet& rSet )
case SID_SECURE_URL :
{
bRet = true;
- if (!aSecurityOptions.IsReadOnly(SvtSecurityOptions::EOption::SecureUrls))
+ if (!SvtSecurityOptions::IsReadOnly(SvtSecurityOptions::EOption::SecureUrls))
{
- css::uno::Sequence< OUString > seqURLs = aSecurityOptions.GetSecureURLs();
- auto aList = comphelper::sequenceToContainer<std::vector<OUString>>(seqURLs);
+ std::vector< OUString > seqURLs = SvtSecurityOptions::GetSecureURLs();
- if( !rSet.Put( SfxStringListItem( rPool.GetWhich(SID_SECURE_URL), &aList ) ) )
+ if( !rSet.Put( SfxStringListItem( rPool.GetWhich(SID_SECURE_URL), &seqURLs ) ) )
bRet = false;
}
}
@@ -408,7 +406,6 @@ void SfxApplication::SetOptions_Impl( const SfxItemSet& rSet )
const SfxPoolItem *pItem = nullptr;
SfxItemPool &rPool = GetPool();
- SvtSecurityOptions aSecurityOptions;
SvtMiscOptions aMiscOptions;
std::shared_ptr< comphelper::ConfigurationChanges > batch(
comphelper::ConfigurationChanges::create());
@@ -644,9 +641,7 @@ void SfxApplication::SetOptions_Impl( const SfxItemSet& rSet )
if ( SfxItemState::SET == rSet.GetItemState(SID_SECURE_URL, true, &pItem))
{
DBG_ASSERT(dynamic_cast< const SfxStringListItem *>( pItem ) != nullptr, "StringListItem expected");
- css::uno::Sequence< OUString > seqURLs;
- static_cast<const SfxStringListItem*>(pItem)->GetStringList(seqURLs);
- aSecurityOptions.SetSecureURLs( seqURLs );
+ SvtSecurityOptions::SetSecureURLs( static_cast<const SfxStringListItem*>(pItem)->GetList() );
}
// Store changed data
diff --git a/sfx2/source/appl/appopen.cxx b/sfx2/source/appl/appopen.cxx
index f26b88a1b06c..15c47a31c0e5 100644
--- a/sfx2/source/appl/appopen.cxx
+++ b/sfx2/source/appl/appopen.cxx
@@ -927,7 +927,7 @@ void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq )
}
}
- if (!SvtSecurityOptions().isSecureMacroUri(aFileName, aReferer))
+ if (!SvtSecurityOptions::isSecureMacroUri(aFileName, aReferer))
{
SfxErrorContext aCtx( ERRCTX_SFX_OPENDOC, aFileName );
ErrorHandler::HandleError( ERRCODE_IO_ACCESSDENIED );
diff --git a/sfx2/source/appl/linkmgr2.cxx b/sfx2/source/appl/linkmgr2.cxx
index b567e63a7938..062450c3d0c3 100644
--- a/sfx2/source/appl/linkmgr2.cxx
+++ b/sfx2/source/appl/linkmgr2.cxx
@@ -525,7 +525,7 @@ bool LinkManager::GetGraphicFromAny(const OUString& rMimeType,
sReferer = sh->GetMedium()->GetName();
OUString sURL = rValue.get<OUString>();
- if (!SvtSecurityOptions().isUntrustedReferer(sReferer))
+ if (!SvtSecurityOptions::isUntrustedReferer(sReferer))
rGraphic = vcl::graphic::loadFromURL(sURL, pParentWin);
if (rGraphic.IsNone())
rGraphic.SetDefaultType();
diff --git a/sfx2/source/appl/sfxhelp.cxx b/sfx2/source/appl/sfxhelp.cxx
index b158062683e7..541352697fb0 100644
--- a/sfx2/source/appl/sfxhelp.cxx
+++ b/sfx2/source/appl/sfxhelp.cxx
@@ -667,8 +667,7 @@ OUString SfxHelp::GetHelpText(const OUString& aCommandURL, const weld::Widget* p
OUString SfxHelp::GetURLHelpText(std::u16string_view aURL)
{
- SvtSecurityOptions aSecOpt;
- bool bCtrlClickHlink = aSecOpt.IsOptionSet(SvtSecurityOptions::EOption::CtrlClickHyperlink);
+ bool bCtrlClickHlink = SvtSecurityOptions::IsOptionSet(SvtSecurityOptions::EOption::CtrlClickHyperlink);
// "ctrl-click to follow link:" for not MacOS
// "⌘-click to follow link:" for MacOs