diff options
-rw-r--r-- | sw/source/ui/config/optpage.cxx | 135 | ||||
-rw-r--r-- | sw/source/uibase/inc/optpage.hxx | 22 | ||||
-rw-r--r-- | sw/uiconfig/swriter/ui/optcomparison.ui | 18 |
3 files changed, 74 insertions, 101 deletions
diff --git a/sw/source/ui/config/optpage.cxx b/sw/source/ui/config/optpage.cxx index 4e6838961647..3cf60750e370 100644 --- a/sw/source/ui/config/optpage.cxx +++ b/sw/source/ui/config/optpage.cxx @@ -2124,46 +2124,31 @@ void SwRedlineOptionsTabPage::InitFontStyle(SvxFontPrevWindow& rExampleWin) rExampleWin.Invalidate(); } -SwCompareOptionsTabPage::SwCompareOptionsTabPage( vcl::Window* pParent, const SfxItemSet& rSet ) - : SfxTabPage( pParent,"OptComparison","modules/swriter/ui/optcomparison.ui", &rSet ) +SwCompareOptionsTabPage::SwCompareOptionsTabPage(TabPageParent pParent, const SfxItemSet& rSet) + : SfxTabPage(pParent, "modules/swriter/ui/optcomparison.ui", "OptComparison", &rSet) + , m_xAutoRB(m_xBuilder->weld_radio_button("auto")) + , m_xWordRB(m_xBuilder->weld_radio_button("byword")) + , m_xCharRB(m_xBuilder->weld_radio_button("bycharacter")) + , m_xRsidCB(m_xBuilder->weld_check_button("useRSID")) + , m_xIgnoreCB(m_xBuilder->weld_check_button("ignore")) + , m_xLenNF(m_xBuilder->weld_spin_button("ignorelen")) + , m_xStoreRsidCB(m_xBuilder->weld_check_button("storeRSID")) { - get(m_pAutoRB,"auto"); - get(m_pWordRB, "byword"); - get(m_pCharRB, "bycharacter"); + Link<weld::Button&,void> aLnk( LINK( this, SwCompareOptionsTabPage, ComparisonHdl ) ); + m_xAutoRB->connect_clicked( aLnk ); + m_xWordRB->connect_clicked( aLnk ); + m_xCharRB->connect_clicked( aLnk ); - get(m_pRsidCB, "useRSID"); - get(m_pIgnoreCB, "ignore"); - get(m_pLenNF, "ignorelen"); - get(m_pStoreRsidCB, "storeRSID"); - - Link<Button*,void> aLnk( LINK( this, SwCompareOptionsTabPage, ComparisonHdl ) ); - m_pAutoRB->SetClickHdl( aLnk ); - m_pWordRB->SetClickHdl( aLnk ); - m_pCharRB->SetClickHdl( aLnk ); - - m_pIgnoreCB->SetClickHdl( LINK( this, SwCompareOptionsTabPage, IgnoreHdl) ); + m_xIgnoreCB->connect_clicked( LINK( this, SwCompareOptionsTabPage, IgnoreHdl) ); } SwCompareOptionsTabPage::~SwCompareOptionsTabPage() { - disposeOnce(); -} - -void SwCompareOptionsTabPage::dispose() -{ - m_pAutoRB.clear(); - m_pWordRB.clear(); - m_pCharRB.clear(); - m_pRsidCB.clear(); - m_pIgnoreCB.clear(); - m_pLenNF.clear(); - m_pStoreRsidCB.clear(); - SfxTabPage::dispose(); } VclPtr<SfxTabPage> SwCompareOptionsTabPage::Create( TabPageParent pParent, const SfxItemSet* rAttrSet ) { - return VclPtr<SwCompareOptionsTabPage>::Create( pParent.pParent, *rAttrSet ); + return VclPtr<SwCompareOptionsTabPage>::Create( pParent, *rAttrSet ); } bool SwCompareOptionsTabPage::FillItemSet( SfxItemSet* ) @@ -2171,41 +2156,41 @@ bool SwCompareOptionsTabPage::FillItemSet( SfxItemSet* ) bool bRet = false; SwModuleOptions *pOpt = SW_MOD()->GetModuleConfig(); - if( m_pAutoRB->IsValueChangedFromSaved() || - m_pWordRB->IsValueChangedFromSaved() || - m_pCharRB->IsValueChangedFromSaved() ) + if( m_xAutoRB->get_state_changed_from_saved() || + m_xWordRB->get_state_changed_from_saved() || + m_xCharRB->get_state_changed_from_saved() ) { SwCompareMode eCmpMode = SwCompareMode::Auto; - if ( m_pAutoRB->IsChecked() ) eCmpMode = SwCompareMode::Auto; - if ( m_pWordRB->IsChecked() ) eCmpMode = SwCompareMode::ByWord; - if ( m_pCharRB->IsChecked() ) eCmpMode = SwCompareMode::ByChar; + if ( m_xAutoRB->get_active() ) eCmpMode = SwCompareMode::Auto; + if ( m_xWordRB->get_active() ) eCmpMode = SwCompareMode::ByWord; + if ( m_xCharRB->get_active() ) eCmpMode = SwCompareMode::ByChar; pOpt->SetCompareMode( eCmpMode ); bRet = true; } - if( m_pRsidCB->IsValueChangedFromSaved() ) + if( m_xRsidCB->get_state_changed_from_saved() ) { - pOpt->SetUseRsid( m_pRsidCB->IsChecked() ); + pOpt->SetUseRsid( m_xRsidCB->get_active() ); bRet = true; } - if( m_pIgnoreCB->IsValueChangedFromSaved() ) + if( m_xIgnoreCB->get_state_changed_from_saved() ) { - pOpt->SetIgnorePieces( m_pIgnoreCB->IsChecked() ); + pOpt->SetIgnorePieces( m_xIgnoreCB->get_active() ); bRet = true; } - if( m_pLenNF->IsModified() ) + if( m_xLenNF->get_value_changed_from_saved() ) { - pOpt->SetPieceLen( m_pLenNF->GetValue() ); + pOpt->SetPieceLen( m_xLenNF->get_value() ); bRet = true; } - if (m_pStoreRsidCB->IsValueChangedFromSaved()) + if (m_xStoreRsidCB->get_state_changed_from_saved()) { - pOpt->SetStoreRsid(m_pStoreRsidCB->IsChecked()); + pOpt->SetStoreRsid(m_xStoreRsidCB->get_active()); bRet = true; } @@ -2219,55 +2204,55 @@ void SwCompareOptionsTabPage::Reset( const SfxItemSet* ) SwCompareMode eCmpMode = pOpt->GetCompareMode(); if( eCmpMode == SwCompareMode::Auto ) { - m_pAutoRB->Check(); - m_pRsidCB->Disable(); - m_pIgnoreCB->Disable(); - m_pLenNF->Disable(); + m_xAutoRB->set_active(true); + m_xRsidCB->set_sensitive(false); + m_xIgnoreCB->set_sensitive(false); + m_xLenNF->set_sensitive(false); } else if( eCmpMode == SwCompareMode::ByWord ) { - m_pWordRB->Check(); - m_pRsidCB->Enable(); - m_pIgnoreCB->Enable(); - m_pLenNF->Enable(); + m_xWordRB->set_active(true); + m_xRsidCB->set_sensitive(true); + m_xIgnoreCB->set_sensitive(true); + m_xLenNF->set_sensitive(true); } else if( eCmpMode == SwCompareMode::ByChar) { - m_pCharRB->Check(); - m_pRsidCB->Enable(); - m_pIgnoreCB->Enable(); - m_pLenNF->Enable(); + m_xCharRB->set_active(true); + m_xRsidCB->set_sensitive(true); + m_xIgnoreCB->set_sensitive(true); + m_xLenNF->set_sensitive(true); } - m_pAutoRB->SaveValue(); - m_pWordRB->SaveValue(); - m_pCharRB->SaveValue(); + m_xAutoRB->save_state(); + m_xWordRB->save_state(); + m_xCharRB->save_state(); - m_pRsidCB->Check( pOpt->IsUseRsid() ); - m_pRsidCB->SaveValue(); + m_xRsidCB->set_active( pOpt->IsUseRsid() ); + m_xRsidCB->save_state(); - m_pIgnoreCB->Check( pOpt->IsIgnorePieces() ); - m_pIgnoreCB->SaveValue(); + m_xIgnoreCB->set_active( pOpt->IsIgnorePieces() ); + m_xIgnoreCB->save_state(); - m_pLenNF->Enable( m_pIgnoreCB->IsChecked() && eCmpMode != SwCompareMode::Auto ); + m_xLenNF->set_sensitive( m_xIgnoreCB->get_active() && eCmpMode != SwCompareMode::Auto ); - m_pLenNF->SetValue( pOpt->GetPieceLen() ); - m_pLenNF->SaveValue(); + m_xLenNF->set_value( pOpt->GetPieceLen() ); + m_xLenNF->save_value(); - m_pStoreRsidCB->Check(pOpt->IsStoreRsid()); - m_pStoreRsidCB->SaveValue(); + m_xStoreRsidCB->set_active(pOpt->IsStoreRsid()); + m_xStoreRsidCB->save_state(); } -IMPL_LINK_NOARG(SwCompareOptionsTabPage, ComparisonHdl, Button*, void) +IMPL_LINK_NOARG(SwCompareOptionsTabPage, ComparisonHdl, weld::Button&, void) { - bool bChecked = !m_pAutoRB->IsChecked(); - m_pRsidCB->Enable( bChecked ); - m_pIgnoreCB->Enable( bChecked ); - m_pLenNF->Enable( bChecked && m_pIgnoreCB->IsChecked() ); + bool bChecked = !m_xAutoRB->get_active(); + m_xRsidCB->set_sensitive( bChecked ); + m_xIgnoreCB->set_sensitive( bChecked ); + m_xLenNF->set_sensitive( bChecked && m_xIgnoreCB->get_active() ); } -IMPL_LINK_NOARG(SwCompareOptionsTabPage, IgnoreHdl, Button*, void) +IMPL_LINK_NOARG(SwCompareOptionsTabPage, IgnoreHdl, weld::Button&, void) { - m_pLenNF->Enable( m_pIgnoreCB->IsChecked() ); + m_xLenNF->set_sensitive(m_xIgnoreCB->get_active()); } #ifdef DBG_UTIL diff --git a/sw/source/uibase/inc/optpage.hxx b/sw/source/uibase/inc/optpage.hxx index 54988c190de3..010eafdb6d05 100644 --- a/sw/source/uibase/inc/optpage.hxx +++ b/sw/source/uibase/inc/optpage.hxx @@ -375,22 +375,20 @@ private: class SwCompareOptionsTabPage : public SfxTabPage { - VclPtr<RadioButton> m_pAutoRB; - VclPtr<RadioButton> m_pWordRB; - VclPtr<RadioButton> m_pCharRB; + std::unique_ptr<weld::RadioButton> m_xAutoRB; + std::unique_ptr<weld::RadioButton> m_xWordRB; + std::unique_ptr<weld::RadioButton> m_xCharRB; + std::unique_ptr<weld::CheckButton> m_xRsidCB; + std::unique_ptr<weld::CheckButton> m_xIgnoreCB; + std::unique_ptr<weld::SpinButton> m_xLenNF; + std::unique_ptr<weld::CheckButton> m_xStoreRsidCB; - VclPtr<CheckBox> m_pRsidCB; - VclPtr<CheckBox> m_pIgnoreCB; - VclPtr<NumericField> m_pLenNF; - VclPtr<CheckBox> m_pStoreRsidCB; - - DECL_LINK(ComparisonHdl, Button*, void); - DECL_LINK(IgnoreHdl, Button*, void); + DECL_LINK(ComparisonHdl, weld::Button&, void); + DECL_LINK(IgnoreHdl, weld::Button&, void); public: - SwCompareOptionsTabPage( vcl::Window* pParent, const SfxItemSet& rSet ); + SwCompareOptionsTabPage(TabPageParent pParent, const SfxItemSet& rSet); virtual ~SwCompareOptionsTabPage() override; - virtual void dispose() override; static VclPtr<SfxTabPage> Create(TabPageParent pParent, const SfxItemSet* rAttrSet ); diff --git a/sw/uiconfig/swriter/ui/optcomparison.ui b/sw/uiconfig/swriter/ui/optcomparison.ui index 73f26be49e25..43f0501fa8ba 100644 --- a/sw/uiconfig/swriter/ui/optcomparison.ui +++ b/sw/uiconfig/swriter/ui/optcomparison.ui @@ -1,4 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> +<!-- Generated with glade 3.22.1 --> <interface domain="sw"> <requires lib="gtk+" version="3.18"/> <object class="GtkAdjustment" id="adjustment1"> @@ -41,13 +42,10 @@ <property name="xalign">0</property> <property name="active">True</property> <property name="draw_indicator">True</property> - <property name="group">byword</property> </object> <packing> <property name="left_attach">0</property> <property name="top_attach">0</property> - <property name="width">1</property> - <property name="height">1</property> </packing> </child> <child> @@ -59,13 +57,11 @@ <property name="use_underline">True</property> <property name="xalign">0</property> <property name="draw_indicator">True</property> - <property name="group">bycharacter</property> + <property name="group">auto</property> </object> <packing> <property name="left_attach">0</property> <property name="top_attach">1</property> - <property name="width">1</property> - <property name="height">1</property> </packing> </child> <child> @@ -77,12 +73,11 @@ <property name="use_underline">True</property> <property name="xalign">0</property> <property name="draw_indicator">True</property> + <property name="group">auto</property> </object> <packing> <property name="left_attach">0</property> <property name="top_attach">2</property> - <property name="width">1</property> - <property name="height">1</property> </packing> </child> </object> @@ -137,8 +132,6 @@ <packing> <property name="left_attach">0</property> <property name="top_attach">1</property> - <property name="width">1</property> - <property name="height">1</property> </packing> </child> <child> @@ -155,21 +148,18 @@ <packing> <property name="left_attach">0</property> <property name="top_attach">0</property> - <property name="width">1</property> - <property name="height">1</property> </packing> </child> <child> <object class="GtkSpinButton" id="ignorelen"> <property name="visible">True</property> <property name="can_focus">True</property> + <property name="activates_default">True</property> <property name="adjustment">adjustment1</property> </object> <packing> <property name="left_attach">1</property> <property name="top_attach">1</property> - <property name="width">1</property> - <property name="height">1</property> </packing> </child> <child> |