summaryrefslogtreecommitdiff
path: root/cui
diff options
context:
space:
mode:
Diffstat (limited to 'cui')
-rw-r--r--cui/source/options/optinet2.cxx27
-rw-r--r--cui/source/options/optinet2.hxx2
-rw-r--r--cui/source/options/securityoptions.cxx26
-rw-r--r--cui/source/options/securityoptions.hxx4
4 files changed, 26 insertions, 33 deletions
diff --git a/cui/source/options/optinet2.cxx b/cui/source/options/optinet2.cxx
index acb04b97d696..e01433516ff7 100644
--- a/cui/source/options/optinet2.cxx
+++ b/cui/source/options/optinet2.cxx
@@ -475,7 +475,6 @@ IMPL_STATIC_LINK(SvxProxyTabPage, LoseFocusHdl_Impl, weld::Widget&, rControl, vo
/********************************************************************/
SvxSecurityTabPage::SvxSecurityTabPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rSet)
: SfxTabPage(pPage, pController, "cui/ui/optsecuritypage.ui", "OptSecurityPage", &rSet)
- , mpSecOptions(new SvtSecurityOptions)
, m_xSecurityOptionsPB(m_xBuilder->weld_button("options"))
, m_xSavePasswordsCB(m_xBuilder->weld_check_button("savepassword"))
, m_xShowConnectionsPB(m_xBuilder->weld_button("connections"))
@@ -523,7 +522,7 @@ SvxSecurityTabPage::~SvxSecurityTabPage()
IMPL_LINK_NOARG(SvxSecurityTabPage, SecurityOptionsHdl, weld::Button&, void)
{
if (!m_xSecOptDlg)
- m_xSecOptDlg.reset(new svx::SecurityOptionsDialog(GetFrameWeld(), mpSecOptions.get()));
+ m_xSecOptDlg.reset(new svx::SecurityOptionsDialog(GetFrameWeld()));
m_xSecOptDlg->run();
}
@@ -766,15 +765,15 @@ DeactivateRC SvxSecurityTabPage::DeactivatePage( SfxItemSet* _pSet )
namespace
{
- bool CheckAndSave( SvtSecurityOptions& _rOpt, SvtSecurityOptions::EOption _eOpt, const bool _bIsChecked, bool& _rModified )
+ bool CheckAndSave( SvtSecurityOptions::EOption _eOpt, const bool _bIsChecked, bool& _rModified )
{
bool bModified = false;
- if ( _rOpt.IsOptionEnabled( _eOpt ) )
+ if ( !SvtSecurityOptions::IsReadOnly( _eOpt ) )
{
- bModified = _rOpt.IsOptionSet( _eOpt ) != _bIsChecked;
+ bModified = SvtSecurityOptions::IsOptionSet( _eOpt ) != _bIsChecked;
if ( bModified )
{
- _rOpt.SetOption( _eOpt, _bIsChecked );
+ SvtSecurityOptions::SetOption( _eOpt, _bIsChecked );
_rModified = true;
}
}
@@ -789,14 +788,14 @@ bool SvxSecurityTabPage::FillItemSet( SfxItemSet* )
if (m_xSecOptDlg)
{
- CheckAndSave( *mpSecOptions, SvtSecurityOptions::EOption::DocWarnSaveOrSend, m_xSecOptDlg->IsSaveOrSendDocsChecked(), bModified );
- CheckAndSave( *mpSecOptions, SvtSecurityOptions::EOption::DocWarnSigning, m_xSecOptDlg->IsSignDocsChecked(), bModified );
- CheckAndSave( *mpSecOptions, SvtSecurityOptions::EOption::DocWarnPrint, m_xSecOptDlg->IsPrintDocsChecked(), bModified );
- CheckAndSave( *mpSecOptions, SvtSecurityOptions::EOption::DocWarnCreatePdf, m_xSecOptDlg->IsCreatePdfChecked(), bModified );
- CheckAndSave( *mpSecOptions, SvtSecurityOptions::EOption::DocWarnRemovePersonalInfo, m_xSecOptDlg->IsRemovePersInfoChecked(), bModified );
- CheckAndSave( *mpSecOptions, SvtSecurityOptions::EOption::DocWarnRecommendPassword, m_xSecOptDlg->IsRecommPasswdChecked(), bModified );
- CheckAndSave( *mpSecOptions, SvtSecurityOptions::EOption::CtrlClickHyperlink, m_xSecOptDlg->IsCtrlHyperlinkChecked(), bModified );
- CheckAndSave( *mpSecOptions, SvtSecurityOptions::EOption::BlockUntrustedRefererLinks, m_xSecOptDlg->IsBlockUntrustedRefererLinksChecked(), bModified );
+ CheckAndSave( SvtSecurityOptions::EOption::DocWarnSaveOrSend, m_xSecOptDlg->IsSaveOrSendDocsChecked(), bModified );
+ CheckAndSave( SvtSecurityOptions::EOption::DocWarnSigning, m_xSecOptDlg->IsSignDocsChecked(), bModified );
+ CheckAndSave( SvtSecurityOptions::EOption::DocWarnPrint, m_xSecOptDlg->IsPrintDocsChecked(), bModified );
+ CheckAndSave( SvtSecurityOptions::EOption::DocWarnCreatePdf, m_xSecOptDlg->IsCreatePdfChecked(), bModified );
+ CheckAndSave( SvtSecurityOptions::EOption::DocWarnRemovePersonalInfo, m_xSecOptDlg->IsRemovePersInfoChecked(), bModified );
+ CheckAndSave( SvtSecurityOptions::EOption::DocWarnRecommendPassword, m_xSecOptDlg->IsRecommPasswdChecked(), bModified );
+ CheckAndSave( SvtSecurityOptions::EOption::CtrlClickHyperlink, m_xSecOptDlg->IsCtrlHyperlinkChecked(), bModified );
+ CheckAndSave( SvtSecurityOptions::EOption::BlockUntrustedRefererLinks, m_xSecOptDlg->IsBlockUntrustedRefererLinksChecked(), bModified );
}
return bModified;
diff --git a/cui/source/options/optinet2.hxx b/cui/source/options/optinet2.hxx
index 6b4ca975199a..4d03d2d04337 100644
--- a/cui/source/options/optinet2.hxx
+++ b/cui/source/options/optinet2.hxx
@@ -74,12 +74,10 @@ public:
// class SvxSecurityTabPage ---------------------------------------------
-class SvtSecurityOptions;
class CertPathDialog;
class SvxSecurityTabPage : public SfxTabPage
{
private:
- std::unique_ptr<SvtSecurityOptions> mpSecOptions;
std::unique_ptr<svx::SecurityOptionsDialog> m_xSecOptDlg;
std::unique_ptr<CertPathDialog> mpCertPathDlg;
diff --git a/cui/source/options/securityoptions.cxx b/cui/source/options/securityoptions.cxx
index 202128b99860..f5c94edf1029 100644
--- a/cui/source/options/securityoptions.cxx
+++ b/cui/source/options/securityoptions.cxx
@@ -23,14 +23,13 @@
namespace
{
- bool enableAndSet(const SvtSecurityOptions& rOptions,
- SvtSecurityOptions::EOption eOption,
+ bool enableAndSet(SvtSecurityOptions::EOption eOption,
weld::CheckButton& rCheckBox, weld::Widget& rFixedImage)
{
- bool bEnable = rOptions.IsOptionEnabled(eOption);
+ bool bEnable = !SvtSecurityOptions::IsReadOnly(eOption);
rCheckBox.set_sensitive(bEnable);
rFixedImage.set_visible(!bEnable);
- rCheckBox.set_active(rOptions.IsOptionSet(eOption));
+ rCheckBox.set_active(SvtSecurityOptions::IsOptionSet(eOption));
return bEnable;
}
}
@@ -38,7 +37,7 @@ namespace
namespace svx
{
-SecurityOptionsDialog::SecurityOptionsDialog(weld::Window* pParent, SvtSecurityOptions const * pOptions)
+SecurityOptionsDialog::SecurityOptionsDialog(weld::Window* pParent)
: GenericDialogController(pParent, "cui/ui/securityoptionsdialog.ui", "SecurityOptionsDialog")
, m_xSaveOrSendDocsCB(m_xBuilder->weld_check_button("savesenddocs"))
, m_xSaveOrSendDocsImg(m_xBuilder->weld_widget("locksavesenddocs"))
@@ -57,22 +56,21 @@ SecurityOptionsDialog::SecurityOptionsDialog(weld::Window* pParent, SvtSecurityO
, m_xBlockUntrustedRefererLinksCB(m_xBuilder->weld_check_button("blockuntrusted"))
, m_xBlockUntrustedRefererLinksImg(m_xBuilder->weld_widget("lockblockuntrusted"))
{
- DBG_ASSERT( pOptions, "SecurityOptionsDialog::SecurityOptionsDialog(): invalid SvtSecurityOptions" );
- enableAndSet(*pOptions, SvtSecurityOptions::EOption::DocWarnSaveOrSend, *m_xSaveOrSendDocsCB,
+ enableAndSet(SvtSecurityOptions::EOption::DocWarnSaveOrSend, *m_xSaveOrSendDocsCB,
*m_xSaveOrSendDocsImg);
- enableAndSet(*pOptions, SvtSecurityOptions::EOption::DocWarnSigning, *m_xSignDocsCB,
+ enableAndSet(SvtSecurityOptions::EOption::DocWarnSigning, *m_xSignDocsCB,
*m_xSignDocsImg);
- enableAndSet(*pOptions, SvtSecurityOptions::EOption::DocWarnPrint, *m_xPrintDocsCB,
+ enableAndSet(SvtSecurityOptions::EOption::DocWarnPrint, *m_xPrintDocsCB,
*m_xPrintDocsImg);
- enableAndSet(*pOptions, SvtSecurityOptions::EOption::DocWarnCreatePdf, *m_xCreatePdfCB,
+ enableAndSet(SvtSecurityOptions::EOption::DocWarnCreatePdf, *m_xCreatePdfCB,
*m_xCreatePdfImg);
- enableAndSet(*pOptions, SvtSecurityOptions::EOption::DocWarnRemovePersonalInfo, *m_xRemovePersInfoCB,
+ enableAndSet(SvtSecurityOptions::EOption::DocWarnRemovePersonalInfo, *m_xRemovePersInfoCB,
*m_xRemovePersInfoImg);
- enableAndSet(*pOptions, SvtSecurityOptions::EOption::DocWarnRecommendPassword, *m_xRecommPasswdCB,
+ enableAndSet(SvtSecurityOptions::EOption::DocWarnRecommendPassword, *m_xRecommPasswdCB,
*m_xRecommPasswdImg);
- enableAndSet(*pOptions, SvtSecurityOptions::EOption::CtrlClickHyperlink, *m_xCtrlHyperlinkCB,
+ enableAndSet(SvtSecurityOptions::EOption::CtrlClickHyperlink, *m_xCtrlHyperlinkCB,
*m_xCtrlHyperlinkImg);
- enableAndSet(*pOptions, SvtSecurityOptions::EOption::BlockUntrustedRefererLinks, *m_xBlockUntrustedRefererLinksCB,
+ enableAndSet(SvtSecurityOptions::EOption::BlockUntrustedRefererLinks, *m_xBlockUntrustedRefererLinksCB,
*m_xBlockUntrustedRefererLinksImg);
}
diff --git a/cui/source/options/securityoptions.hxx b/cui/source/options/securityoptions.hxx
index d5ed7b01ac25..dc05f5bb8150 100644
--- a/cui/source/options/securityoptions.hxx
+++ b/cui/source/options/securityoptions.hxx
@@ -20,8 +20,6 @@
#include <vcl/weld.hxx>
-class SvtSecurityOptions;
-
namespace svx
{
@@ -47,7 +45,7 @@ namespace svx
std::unique_ptr<weld::Widget> m_xBlockUntrustedRefererLinksImg;
public:
- SecurityOptionsDialog(weld::Window* pParent, SvtSecurityOptions const * pOptions);
+ SecurityOptionsDialog(weld::Window* pParent);
bool IsSaveOrSendDocsChecked() const { return m_xSaveOrSendDocsCB->get_active(); }
bool IsSignDocsChecked() const { return m_xSignDocsCB->get_active(); }