diff options
author | Caolán McNamara <caolanm@redhat.com> | 2019-07-29 20:59:08 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2019-07-30 09:55:03 +0200 |
commit | b6b8b4c3d978ffe28e51ccbeef68997b158f894a (patch) | |
tree | 92cd27bf9a762d251b386bd3c4ebadbe71da3cfb /cui | |
parent | 6833539b466e21bebb77e247275dc50de1f36c43 (diff) |
weld OfaMSFilterTabPage
Change-Id: Ie711d8624995027578f79389972c6fa26b3189a2
Reviewed-on: https://gerrit.libreoffice.org/76569
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'cui')
-rw-r--r-- | cui/source/options/optfltr.cxx | 126 | ||||
-rw-r--r-- | cui/source/options/optfltr.hxx | 26 |
2 files changed, 67 insertions, 85 deletions
diff --git a/cui/source/options/optfltr.cxx b/cui/source/options/optfltr.cxx index 764614a6030e..d11c655a472f 100644 --- a/cui/source/options/optfltr.cxx +++ b/cui/source/options/optfltr.cxx @@ -38,79 +38,63 @@ enum class MSFltrPg2_CheckBoxEntries { }; -OfaMSFilterTabPage::OfaMSFilterTabPage(vcl::Window* pParent, const SfxItemSet& rSet) - : SfxTabPage( pParent, "OptFltrPage", "cui/ui/optfltrpage.ui", &rSet ) +OfaMSFilterTabPage::OfaMSFilterTabPage(TabPageParent pParent, const SfxItemSet& rSet) + : SfxTabPage(pParent, "cui/ui/optfltrpage.ui", "OptFltrPage", &rSet) + , m_xWBasicCodeCB(m_xBuilder->weld_check_button("wo_basic")) + , m_xWBasicWbctblCB(m_xBuilder->weld_check_button("wo_exec")) + , m_xWBasicStgCB(m_xBuilder->weld_check_button("wo_saveorig")) + , m_xEBasicCodeCB(m_xBuilder->weld_check_button("ex_basic")) + , m_xEBasicExectblCB(m_xBuilder->weld_check_button("ex_exec")) + , m_xEBasicStgCB(m_xBuilder->weld_check_button("ex_saveorig")) + , m_xPBasicCodeCB(m_xBuilder->weld_check_button("pp_basic")) + , m_xPBasicStgCB(m_xBuilder->weld_check_button("pp_saveorig")) { - get( aWBasicCodeCB , "wo_basic" ); - get( aWBasicWbctblCB , "wo_exec" ); - get( aWBasicStgCB , "wo_saveorig" ); - get( aEBasicCodeCB , "ex_basic" ); - get( aEBasicExectblCB , "ex_exec" ); - get( aEBasicStgCB , "ex_saveorig" ); - get( aPBasicCodeCB , "pp_basic" ); - get( aPBasicStgCB , "pp_saveorig" ); - - aWBasicCodeCB->SetClickHdl( LINK( this, OfaMSFilterTabPage, LoadWordBasicCheckHdl_Impl ) ); - aEBasicCodeCB->SetClickHdl( LINK( this, OfaMSFilterTabPage, LoadExcelBasicCheckHdl_Impl ) ); + m_xWBasicCodeCB->connect_clicked( LINK( this, OfaMSFilterTabPage, LoadWordBasicCheckHdl_Impl ) ); + m_xEBasicCodeCB->connect_clicked( LINK( this, OfaMSFilterTabPage, LoadExcelBasicCheckHdl_Impl ) ); } OfaMSFilterTabPage::~OfaMSFilterTabPage() { - disposeOnce(); -} - -void OfaMSFilterTabPage::dispose() -{ - aWBasicCodeCB.clear(); - aWBasicWbctblCB.clear(); - aWBasicStgCB.clear(); - aEBasicCodeCB.clear(); - aEBasicExectblCB.clear(); - aEBasicStgCB.clear(); - aPBasicCodeCB.clear(); - aPBasicStgCB.clear(); - SfxTabPage::dispose(); } - -IMPL_LINK_NOARG(OfaMSFilterTabPage, LoadWordBasicCheckHdl_Impl, Button*, void) +IMPL_LINK_NOARG(OfaMSFilterTabPage, LoadWordBasicCheckHdl_Impl, weld::Button&, void) { - aWBasicWbctblCB->Enable( aWBasicCodeCB->IsChecked() ); + m_xWBasicWbctblCB->set_sensitive(m_xWBasicCodeCB->get_active()); } -IMPL_LINK_NOARG(OfaMSFilterTabPage, LoadExcelBasicCheckHdl_Impl, Button*, void) +IMPL_LINK_NOARG(OfaMSFilterTabPage, LoadExcelBasicCheckHdl_Impl, weld::Button&, void) { - aEBasicExectblCB->Enable( aEBasicCodeCB->IsChecked() ); + m_xEBasicExectblCB->set_sensitive(m_xEBasicCodeCB->get_active()); } VclPtr<SfxTabPage> OfaMSFilterTabPage::Create( TabPageParent pParent, const SfxItemSet* rAttrSet ) { - return VclPtr<OfaMSFilterTabPage>::Create( pParent.pParent, *rAttrSet ); + return VclPtr<OfaMSFilterTabPage>::Create(pParent, *rAttrSet); } bool OfaMSFilterTabPage::FillItemSet( SfxItemSet* ) { SvtFilterOptions& rOpt = SvtFilterOptions::Get(); - if( aWBasicCodeCB->IsValueChangedFromSaved() ) - rOpt.SetLoadWordBasicCode( aWBasicCodeCB->IsChecked() ); - if( aWBasicWbctblCB->IsValueChangedFromSaved() ) - rOpt.SetLoadWordBasicExecutable( aWBasicWbctblCB->IsChecked() ); - if( aWBasicStgCB->IsValueChangedFromSaved() ) - rOpt.SetLoadWordBasicStorage( aWBasicStgCB->IsChecked() ); - - if( aEBasicCodeCB->IsValueChangedFromSaved()) - rOpt.SetLoadExcelBasicCode( aEBasicCodeCB->IsChecked() ); - if( aEBasicExectblCB->IsValueChangedFromSaved()) - rOpt.SetLoadExcelBasicExecutable( aEBasicExectblCB->IsChecked() ); - if( aEBasicStgCB->IsValueChangedFromSaved()) - rOpt.SetLoadExcelBasicStorage( aEBasicStgCB->IsChecked() ); - - if( aPBasicCodeCB->IsValueChangedFromSaved()) - rOpt.SetLoadPPointBasicCode( aPBasicCodeCB->IsChecked() ); - if( aPBasicStgCB->IsValueChangedFromSaved()) - rOpt.SetLoadPPointBasicStorage( aPBasicStgCB->IsChecked() ); + if( m_xWBasicCodeCB->get_state_changed_from_saved() ) + rOpt.SetLoadWordBasicCode( m_xWBasicCodeCB->get_active() ); + if( m_xWBasicWbctblCB->get_state_changed_from_saved() ) + rOpt.SetLoadWordBasicExecutable( m_xWBasicWbctblCB->get_active() ); + if( m_xWBasicStgCB->get_state_changed_from_saved() ) + rOpt.SetLoadWordBasicStorage( m_xWBasicStgCB->get_active() ); + + if( m_xEBasicCodeCB->get_state_changed_from_saved()) + rOpt.SetLoadExcelBasicCode( m_xEBasicCodeCB->get_active() ); + if( m_xEBasicExectblCB->get_state_changed_from_saved()) + rOpt.SetLoadExcelBasicExecutable( m_xEBasicExectblCB->get_active() ); + if( m_xEBasicStgCB->get_state_changed_from_saved()) + rOpt.SetLoadExcelBasicStorage( m_xEBasicStgCB->get_active() ); + + if( m_xPBasicCodeCB->get_state_changed_from_saved()) + rOpt.SetLoadPPointBasicCode( m_xPBasicCodeCB->get_active() ); + if( m_xPBasicStgCB->get_state_changed_from_saved()) + rOpt.SetLoadPPointBasicStorage( m_xPBasicStgCB->get_active() ); return false; } @@ -119,26 +103,26 @@ void OfaMSFilterTabPage::Reset( const SfxItemSet* ) { const SvtFilterOptions& rOpt = SvtFilterOptions::Get(); - aWBasicCodeCB->Check( rOpt.IsLoadWordBasicCode() ); - aWBasicCodeCB->SaveValue(); - aWBasicWbctblCB->Check( rOpt.IsLoadWordBasicExecutable() ); - aWBasicWbctblCB->SaveValue(); - aWBasicStgCB->Check( rOpt.IsLoadWordBasicStorage() ); - aWBasicStgCB->SaveValue(); - LoadWordBasicCheckHdl_Impl( aWBasicCodeCB ); - - aEBasicCodeCB->Check( rOpt.IsLoadExcelBasicCode() ); - aEBasicCodeCB->SaveValue(); - aEBasicExectblCB->Check( rOpt.IsLoadExcelBasicExecutable() ); - aEBasicExectblCB->SaveValue(); - aEBasicStgCB->Check( rOpt.IsLoadExcelBasicStorage() ); - aEBasicStgCB->SaveValue(); - LoadExcelBasicCheckHdl_Impl( aEBasicCodeCB ); - - aPBasicCodeCB->Check( rOpt.IsLoadPPointBasicCode() ); - aPBasicCodeCB->SaveValue(); - aPBasicStgCB->Check( rOpt.IsLoadPPointBasicStorage() ); - aPBasicStgCB->SaveValue(); + m_xWBasicCodeCB->set_active( rOpt.IsLoadWordBasicCode() ); + m_xWBasicCodeCB->save_state(); + m_xWBasicWbctblCB->set_active( rOpt.IsLoadWordBasicExecutable() ); + m_xWBasicWbctblCB->save_state(); + m_xWBasicStgCB->set_active( rOpt.IsLoadWordBasicStorage() ); + m_xWBasicStgCB->save_state(); + LoadWordBasicCheckHdl_Impl( *m_xWBasicCodeCB ); + + m_xEBasicCodeCB->set_active( rOpt.IsLoadExcelBasicCode() ); + m_xEBasicCodeCB->save_state(); + m_xEBasicExectblCB->set_active( rOpt.IsLoadExcelBasicExecutable() ); + m_xEBasicExectblCB->save_state(); + m_xEBasicStgCB->set_active( rOpt.IsLoadExcelBasicStorage() ); + m_xEBasicStgCB->save_state(); + LoadExcelBasicCheckHdl_Impl( *m_xEBasicCodeCB ); + + m_xPBasicCodeCB->set_active( rOpt.IsLoadPPointBasicCode() ); + m_xPBasicCodeCB->save_state(); + m_xPBasicStgCB->set_active( rOpt.IsLoadPPointBasicStorage() ); + m_xPBasicStgCB->save_state(); } OfaMSFilterTabPage2::OfaMSFilterTabPage2( vcl::Window* pParent, const SfxItemSet& rSet ) : diff --git a/cui/source/options/optfltr.hxx b/cui/source/options/optfltr.hxx index eb7f638331ca..79854e7b8650 100644 --- a/cui/source/options/optfltr.hxx +++ b/cui/source/options/optfltr.hxx @@ -25,22 +25,20 @@ class OfaMSFilterTabPage : public SfxTabPage { - VclPtr<CheckBox> aWBasicCodeCB; - VclPtr<CheckBox> aWBasicWbctblCB; - VclPtr<CheckBox> aWBasicStgCB; - VclPtr<CheckBox> aEBasicCodeCB; - VclPtr<CheckBox> aEBasicExectblCB; - VclPtr<CheckBox> aEBasicStgCB; - VclPtr<CheckBox> aPBasicCodeCB; - VclPtr<CheckBox> aPBasicStgCB; - - - DECL_LINK(LoadWordBasicCheckHdl_Impl, Button*, void); - DECL_LINK(LoadExcelBasicCheckHdl_Impl, Button*, void); + std::unique_ptr<weld::CheckButton> m_xWBasicCodeCB; + std::unique_ptr<weld::CheckButton> m_xWBasicWbctblCB; + std::unique_ptr<weld::CheckButton> m_xWBasicStgCB; + std::unique_ptr<weld::CheckButton> m_xEBasicCodeCB; + std::unique_ptr<weld::CheckButton> m_xEBasicExectblCB; + std::unique_ptr<weld::CheckButton> m_xEBasicStgCB; + std::unique_ptr<weld::CheckButton> m_xPBasicCodeCB; + std::unique_ptr<weld::CheckButton> m_xPBasicStgCB; + + DECL_LINK(LoadWordBasicCheckHdl_Impl, weld::Button&, void); + DECL_LINK(LoadExcelBasicCheckHdl_Impl, weld::Button&, void); public: - OfaMSFilterTabPage( vcl::Window* pParent, const SfxItemSet& rSet ); + OfaMSFilterTabPage(TabPageParent pParent, const SfxItemSet& rSet ); virtual ~OfaMSFilterTabPage() override; - virtual void dispose() override; static VclPtr<SfxTabPage> Create( TabPageParent pParent, const SfxItemSet* rAttrSet ); |