diff options
author | Balazs Varga <balazs.varga.extern@allotropia.de> | 2023-11-01 23:03:19 +0100 |
---|---|---|
committer | Balazs Varga <balazs.varga.extern@allotropia.de> | 2023-11-02 13:50:51 +0100 |
commit | 30877bdc01d3a9cda1878f66ca7a84760f5f8c67 (patch) | |
tree | 01f14581db57a9b44dab1cd812e578b1840d5438 /cui/source | |
parent | 71ebaf56d8611ec45e914d5e619c9eb18ba28959 (diff) |
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 <balazs.varga.extern@allotropia.de>
Diffstat (limited to 'cui/source')
-rw-r--r-- | cui/source/options/optfltr.cxx | 33 | ||||
-rw-r--r-- | cui/source/options/optfltr.hxx | 8 |
2 files changed, 39 insertions, 2 deletions
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 <unotools/moduleoptions.hxx> #include <unotools/fltrcfg.hxx> #include <officecfg/Office/Common.hxx> +#include <officecfg/Office/Calc.hxx> +#include <officecfg/Office/Writer.hxx> +#include <officecfg/Office/Impress.hxx> #include "optfltr.hxx" #include <strings.hrc> #include <dialmgr.hxx> @@ -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<SfxTabPage> 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(); } diff --git a/cui/source/options/optfltr.hxx b/cui/source/options/optfltr.hxx index fcde68941e62..dd4fcf18cd2e 100644 --- a/cui/source/options/optfltr.hxx +++ b/cui/source/options/optfltr.hxx @@ -23,13 +23,21 @@ class OfaMSFilterTabPage : public SfxTabPage { std::unique_ptr<weld::CheckButton> m_xWBasicCodeCB; + std::unique_ptr<weld::Widget> m_xWBasicCodeImg; std::unique_ptr<weld::CheckButton> m_xWBasicWbctblCB; + std::unique_ptr<weld::Widget> m_xWBasicWbctblImg; std::unique_ptr<weld::CheckButton> m_xWBasicStgCB; + std::unique_ptr<weld::Widget> m_xWBasicStgImg; std::unique_ptr<weld::CheckButton> m_xEBasicCodeCB; + std::unique_ptr<weld::Widget> m_xEBasicCodeImg; std::unique_ptr<weld::CheckButton> m_xEBasicExectblCB; + std::unique_ptr<weld::Widget> m_xEBasicExectblImg; std::unique_ptr<weld::CheckButton> m_xEBasicStgCB; + std::unique_ptr<weld::Widget> m_xEBasicStgImg; std::unique_ptr<weld::CheckButton> m_xPBasicCodeCB; + std::unique_ptr<weld::Widget> m_xPBasicCodeImg; std::unique_ptr<weld::CheckButton> m_xPBasicStgCB; + std::unique_ptr<weld::Widget> m_xPBasicStgImg; DECL_LINK(LoadWordBasicCheckHdl_Impl, weld::Toggleable&, void); DECL_LINK(LoadExcelBasicCheckHdl_Impl, weld::Toggleable&, void); |