From 30877bdc01d3a9cda1878f66ca7a84760f5f8c67 Mon Sep 17 00:00:00 2001 From: Balazs Varga Date: Wed, 1 Nov 2023 23:03:19 +0100 Subject: tdf#157860 - UI: Part 14 - Unify lockdown behavior of Options dialog for Load/Save VBA Properties Page. Change-Id: I9526c2a5aa25fbdea1edbc0051d9b6a29c643d8d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158781 Tested-by: Jenkins Reviewed-by: Balazs Varga --- cui/source/options/optfltr.cxx | 33 +++++++++++++++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) (limited to 'cui/source/options/optfltr.cxx') diff --git a/cui/source/options/optfltr.cxx b/cui/source/options/optfltr.cxx index 0f1df6ef6755..7c04c20b27d0 100644 --- a/cui/source/options/optfltr.cxx +++ b/cui/source/options/optfltr.cxx @@ -20,6 +20,9 @@ #include #include #include +#include +#include +#include #include "optfltr.hxx" #include #include @@ -39,13 +42,21 @@ enum class MSFltrPg2_CheckBoxEntries { OfaMSFilterTabPage::OfaMSFilterTabPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rSet) : SfxTabPage(pPage, pController, "cui/ui/optfltrpage.ui", "OptFltrPage", &rSet) , m_xWBasicCodeCB(m_xBuilder->weld_check_button("wo_basic")) + , m_xWBasicCodeImg(m_xBuilder->weld_widget("lockwo_basic")) , m_xWBasicWbctblCB(m_xBuilder->weld_check_button("wo_exec")) + , m_xWBasicWbctblImg(m_xBuilder->weld_widget("lockwo_exec")) , m_xWBasicStgCB(m_xBuilder->weld_check_button("wo_saveorig")) + , m_xWBasicStgImg(m_xBuilder->weld_widget("lockwo_saveorig")) , m_xEBasicCodeCB(m_xBuilder->weld_check_button("ex_basic")) + , m_xEBasicCodeImg(m_xBuilder->weld_widget("lockex_basic")) , m_xEBasicExectblCB(m_xBuilder->weld_check_button("ex_exec")) + , m_xEBasicExectblImg(m_xBuilder->weld_widget("lockex_exec")) , m_xEBasicStgCB(m_xBuilder->weld_check_button("ex_saveorig")) + , m_xEBasicStgImg(m_xBuilder->weld_widget("lockex_saveorig")) , m_xPBasicCodeCB(m_xBuilder->weld_check_button("pp_basic")) + , m_xPBasicCodeImg(m_xBuilder->weld_widget("lockpp_basic")) , m_xPBasicStgCB(m_xBuilder->weld_check_button("pp_saveorig")) + , m_xPBasicStgImg(m_xBuilder->weld_widget("lockpp_saveorig")) { m_xWBasicCodeCB->connect_toggled( LINK( this, OfaMSFilterTabPage, LoadWordBasicCheckHdl_Impl ) ); m_xEBasicCodeCB->connect_toggled( LINK( this, OfaMSFilterTabPage, LoadExcelBasicCheckHdl_Impl ) ); @@ -57,12 +68,14 @@ OfaMSFilterTabPage::~OfaMSFilterTabPage() IMPL_LINK_NOARG(OfaMSFilterTabPage, LoadWordBasicCheckHdl_Impl, weld::Toggleable&, void) { - m_xWBasicWbctblCB->set_sensitive(m_xWBasicCodeCB->get_active()); + m_xWBasicWbctblCB->set_sensitive(m_xWBasicCodeCB->get_active() && !officecfg::Office::Writer::Filter::Import::VBA::Executable::isReadOnly()); + m_xWBasicWbctblImg->set_visible(officecfg::Office::Writer::Filter::Import::VBA::Executable::isReadOnly()); } IMPL_LINK_NOARG(OfaMSFilterTabPage, LoadExcelBasicCheckHdl_Impl, weld::Toggleable&, void) { - m_xEBasicExectblCB->set_sensitive(m_xEBasicCodeCB->get_active()); + m_xEBasicExectblCB->set_sensitive(m_xEBasicCodeCB->get_active() && !officecfg::Office::Calc::Filter::Import::VBA::Executable::isReadOnly()); + m_xEBasicExectblImg->set_visible(officecfg::Office::Calc::Filter::Import::VBA::Executable::isReadOnly()); } std::unique_ptr OfaMSFilterTabPage::Create( weld::Container* pPage, weld::DialogController* pController, @@ -125,24 +138,40 @@ void OfaMSFilterTabPage::Reset( const SfxItemSet* ) const SvtFilterOptions& rOpt = SvtFilterOptions::Get(); m_xWBasicCodeCB->set_active( rOpt.IsLoadWordBasicCode() ); + m_xWBasicCodeCB->set_sensitive(!officecfg::Office::Writer::Filter::Import::VBA::Load::isReadOnly()); + m_xWBasicCodeImg->set_visible(officecfg::Office::Writer::Filter::Import::VBA::Load::isReadOnly()); m_xWBasicCodeCB->save_state(); m_xWBasicWbctblCB->set_active( rOpt.IsLoadWordBasicExecutable() ); + m_xWBasicWbctblCB->set_sensitive(!officecfg::Office::Writer::Filter::Import::VBA::Executable::isReadOnly()); + m_xWBasicWbctblImg->set_visible(officecfg::Office::Writer::Filter::Import::VBA::Executable::isReadOnly()); m_xWBasicWbctblCB->save_state(); m_xWBasicStgCB->set_active( rOpt.IsLoadWordBasicStorage() ); + m_xWBasicStgCB->set_sensitive(!officecfg::Office::Writer::Filter::Import::VBA::Save::isReadOnly()); + m_xWBasicStgImg->set_visible(officecfg::Office::Writer::Filter::Import::VBA::Save::isReadOnly()); m_xWBasicStgCB->save_state(); LoadWordBasicCheckHdl_Impl( *m_xWBasicCodeCB ); m_xEBasicCodeCB->set_active( rOpt.IsLoadExcelBasicCode() ); + m_xEBasicCodeCB->set_sensitive(!officecfg::Office::Calc::Filter::Import::VBA::Load::isReadOnly()); + m_xEBasicCodeImg->set_visible(officecfg::Office::Calc::Filter::Import::VBA::Load::isReadOnly()); m_xEBasicCodeCB->save_state(); m_xEBasicExectblCB->set_active( rOpt.IsLoadExcelBasicExecutable() ); + m_xEBasicExectblCB->set_sensitive(!officecfg::Office::Calc::Filter::Import::VBA::Executable::isReadOnly()); + m_xEBasicExectblImg->set_visible(officecfg::Office::Calc::Filter::Import::VBA::Executable::isReadOnly()); m_xEBasicExectblCB->save_state(); m_xEBasicStgCB->set_active( rOpt.IsLoadExcelBasicStorage() ); + m_xEBasicStgCB->set_sensitive(!officecfg::Office::Calc::Filter::Import::VBA::Save::isReadOnly()); + m_xEBasicStgImg->set_visible(officecfg::Office::Calc::Filter::Import::VBA::Save::isReadOnly()); m_xEBasicStgCB->save_state(); LoadExcelBasicCheckHdl_Impl( *m_xEBasicCodeCB ); m_xPBasicCodeCB->set_active( rOpt.IsLoadPPointBasicCode() ); + m_xPBasicCodeCB->set_sensitive(!officecfg::Office::Impress::Filter::Import::VBA::Load::isReadOnly()); + m_xPBasicCodeImg->set_visible(officecfg::Office::Impress::Filter::Import::VBA::Load::isReadOnly()); m_xPBasicCodeCB->save_state(); m_xPBasicStgCB->set_active( rOpt.IsLoadPPointBasicStorage() ); + m_xPBasicStgCB->set_sensitive(!officecfg::Office::Impress::Filter::Import::VBA::Save::isReadOnly()); + m_xPBasicStgImg->set_visible(officecfg::Office::Impress::Filter::Import::VBA::Save::isReadOnly()); m_xPBasicStgCB->save_state(); } -- cgit tion> LibreOffice 核心代码仓库文档基金会
summaryrefslogtreecommitdiff
AgeCommit message (Expand)Author
2017-10-31loplugin:constantparam in oox,registry,reportdesignNoel Grandin
2017-10-23loplugin:includeform: registryStephan Bergmann
2017-05-27tdf#43157 - registry: convert from OSL_ASSERT to assertChris Sherlock
2017-05-09cleanup osl/diagnose.h includesJochen Nitschke
2017-05-07revert OSL_ASSERT changesChris Sherlock
2017-05-07tdf#43157 - registry: convert from OSL_ASSERT to assertChris Sherlock
2016-12-13OSL_TRACE->SAL in framework..salNoel Grandin
2016-09-12loplugin:constantparam in package..stocNoel Grandin
2016-05-10Replace fallthrough comments with new SAL_FALLTHROUGH macroStephan Bergmann
2016-02-12loplugin:unusedmethodsNoel Grandin
2016-02-04[ABI CHANGE] In SDK, replace regcompare with unoidl-checkStephan Bergmann
2016-02-04loplugin:fpcomparison in registry/Noel Grandin
2016-01-10Fix typosAndrea Gelmini
2015-11-10loplugin:nullptr (automatic rewrite)Stephan Bergmann
2015-11-06coverity#1338272 Uncaught exceptionCaolán McNamara
2015-11-06coverity#1338270 Uncaught exceptionCaolán McNamara
2015-11-06coverity#1338252 Uncaught exceptionCaolán McNamara
2015-10-12Replace "SAL_OVERRIDE" with "override" in LIBO_INTERNAL_ONLY codeStephan Bergmann
2015-10-12Replace "SAL_DELETED_FUNCTION" with "= delete" in LIBO_INTERNAL_ONLY codeStephan Bergmann
2015-07-03No need for a C API hereStephan Bergmann
2015-07-03Move module-private includes from include/registry/ to registry/Stephan Bergmann
2015-04-09convert RTReferenceType to scoped enumNoel Grandin
2015-04-09convert RTMethodMode to scoped enumNoel Grandin
2015-04-09convert RT_ACCESS fields to scoped enumNoel Grandin
2015-04-09convert RegError to scoped enumNoel Grandin
2015-04-09convert RegValueType to scoped enumNoel Grandin
2015-04-09convert REG_ constants to scoped enumNoel Grandin
2015-02-23remove unnecessary parenthesis in return statementsNoel Grandin
2015-02-07loplugin:deletedspecialStephan Bergmann
2014-11-24Bin commented-out unreachable 'break' statementsTor Lillqvist
2014-10-29remove unnecessary 'using namespace rtl' declarationsNoel Grandin
2014-05-01Many spelling fixes: directories r* - z*.Pedro Giffuni
2014-03-26First batch of adding SAL_OVERRRIDE to overriding function declarationsStephan Bergmann
2014-02-27coverity#1187666 Mixing enum typesCaolán McNamara
2014-02-17registry: sal_Bool -> boolStephan Bergmann