sw/source/ui/config/optpage.cxx | 314 +++++++++++----------------- sw/source/uibase/inc/optpage.hxx | 63 ++--- sw/uiconfig/swriter/ui/optcomparison.ui | 18 - sw/uiconfig/swriter/ui/optformataidspage.ui | 6 4 files changed, 170 insertions(+), 231 deletions(-)
New commits: commit 3125a3c7a559c507c149849674c1aee4ad56be93 Author: Caolán McNamara <[email protected]> AuthorDate: Sat Jul 27 15:52:29 2019 +0100 Commit: Caolán McNamara <[email protected]> CommitDate: Sat Jul 27 18:44:46 2019 +0200 weld SwShdwCursorOptionsTabPage Change-Id: Ibbfeb0763d7103bce3e99edb1889e6e9e6c636fa Reviewed-on: https://gerrit.libreoffice.org/76476 Tested-by: Jenkins Reviewed-by: Caolán McNamara <[email protected]> Tested-by: Caolán McNamara <[email protected]> diff --git a/sw/source/ui/config/optpage.cxx b/sw/source/ui/config/optpage.cxx index 3cf60750e370..1fe20a7f38dc 100644 --- a/sw/source/ui/config/optpage.cxx +++ b/sw/source/ui/config/optpage.cxx @@ -1260,34 +1260,27 @@ void SwTableOptionsTabPage::PageCreated( const SfxAllItemSet& aSet) m_pWrtShell = pWrtSh->GetValue(); } -SwShdwCursorOptionsTabPage::SwShdwCursorOptionsTabPage( vcl::Window* pParent, - const SfxItemSet& rSet ) - : SfxTabPage(pParent, "OptFormatAidsPage", - "modules/swriter/ui/optformataidspage.ui", &rSet), - m_pWrtShell( nullptr ) -{ - get(m_pParaCB, "paragraph"); - get(m_pSHyphCB, "hyphens"); - get(m_pSpacesCB, "spaces"); - get(m_pHSpacesCB, "nonbreak"); - get(m_pTabCB, "tabs"); - get(m_pBreakCB, "break"); - get(m_pCharHiddenCB, "hiddentext"); - - get(m_pDirectCursorFrame, "directcrsrframe"); - get(m_pOnOffCB, "cursoronoff"); - - get(m_pFillMarginRB, "fillmargin"); - get(m_pFillIndentRB, "fillindent"); - get(m_pFillTabRB, "filltab"); - get(m_pFillTabAndSpaceRB, "filltabandspace"); - get(m_pFillSpaceRB, "fillspace"); - - get(m_pCursorProtFrame, "crsrprotframe"); - get(m_pCursorInProtCB, "cursorinprot"); - - get(m_pMathBaselineAlignmentCB, "mathbaseline"); - +SwShdwCursorOptionsTabPage::SwShdwCursorOptionsTabPage(TabPageParent pParent, const SfxItemSet& rSet) + : SfxTabPage(pParent, "modules/swriter/ui/optformataidspage.ui", "OptFormatAidsPage", &rSet) + , m_pWrtShell(nullptr) + , m_xParaCB(m_xBuilder->weld_check_button("paragraph")) + , m_xSHyphCB(m_xBuilder->weld_check_button("hyphens")) + , m_xSpacesCB(m_xBuilder->weld_check_button("spaces")) + , m_xHSpacesCB(m_xBuilder->weld_check_button("nonbreak")) + , m_xTabCB(m_xBuilder->weld_check_button("tabs")) + , m_xBreakCB(m_xBuilder->weld_check_button("break")) + , m_xCharHiddenCB(m_xBuilder->weld_check_button("hiddentext")) + , m_xDirectCursorFrame(m_xBuilder->weld_frame("directcrsrframe")) + , m_xOnOffCB(m_xBuilder->weld_check_button("cursoronoff")) + , m_xFillMarginRB(m_xBuilder->weld_radio_button("fillmargin")) + , m_xFillIndentRB(m_xBuilder->weld_radio_button("fillindent")) + , m_xFillTabRB(m_xBuilder->weld_radio_button("filltab")) + , m_xFillTabAndSpaceRB(m_xBuilder->weld_radio_button("filltabandspace")) + , m_xFillSpaceRB(m_xBuilder->weld_radio_button("fillspace")) + , m_xCursorProtFrame(m_xBuilder->weld_frame("crsrprotframe")) + , m_xCursorInProtCB(m_xBuilder->weld_check_button("cursorinprot")) + , m_xMathBaselineAlignmentCB(m_xBuilder->weld_check_button("mathbaseline")) +{ const SfxPoolItem* pItem = nullptr; sal_uInt8 eMode = SwFillMode::FILL_TAB; bool bIsOn = false; @@ -1298,66 +1291,40 @@ SwShdwCursorOptionsTabPage::SwShdwCursorOptionsTabPage( vcl::Window* pParent, eMode = aOpt.GetMode(); bIsOn = aOpt.IsOn(); } - m_pOnOffCB->Check( bIsOn ); + m_xOnOffCB->set_active( bIsOn ); - m_pFillIndentRB->Check( FILL_INDENT == eMode ); - m_pFillMarginRB->Check( FILL_MARGIN == eMode ); - m_pFillTabRB->Check( FILL_TAB == eMode ); - m_pFillSpaceRB->Check( FILL_SPACE == eMode ); - m_pFillTabAndSpaceRB->Check( FILL_TAB_SPACE == eMode ); + m_xFillIndentRB->set_active( FILL_INDENT == eMode ); + m_xFillMarginRB->set_active( FILL_MARGIN == eMode ); + m_xFillTabRB->set_active( FILL_TAB == eMode ); + m_xFillSpaceRB->set_active( FILL_SPACE == eMode ); + m_xFillTabAndSpaceRB->set_active( FILL_TAB_SPACE == eMode ); if(SfxItemState::SET != rSet.GetItemState(SID_HTML_MODE, false, &pItem ) || !(static_cast<const SfxUInt16Item*>(pItem)->GetValue() & HTMLMODE_ON)) return; - m_pTabCB->Hide(); - m_pCharHiddenCB->Hide(); -// m_pFieldHiddenCB->Hide(); -// m_pFieldHiddenParaCB->Hide(); + m_xTabCB->hide(); + m_xCharHiddenCB->hide(); - m_pDirectCursorFrame->Hide(); - m_pOnOffCB->Hide(); - m_pFillMarginRB->Hide(); - m_pFillIndentRB->Hide(); - m_pFillTabRB->Hide(); - m_pFillSpaceRB->Hide(); - m_pFillTabAndSpaceRB->Hide(); - - m_pCursorProtFrame->Hide(); - m_pCursorInProtCB->Hide(); + m_xDirectCursorFrame->hide(); + m_xOnOffCB->hide(); + m_xFillMarginRB->hide(); + m_xFillIndentRB->hide(); + m_xFillTabRB->hide(); + m_xFillSpaceRB->hide(); + m_xFillTabAndSpaceRB->hide(); + m_xCursorProtFrame->hide(); + m_xCursorInProtCB->hide(); } SwShdwCursorOptionsTabPage::~SwShdwCursorOptionsTabPage() { - disposeOnce(); -} - -void SwShdwCursorOptionsTabPage::dispose() -{ - m_pParaCB.clear(); - m_pSHyphCB.clear(); - m_pSpacesCB.clear(); - m_pHSpacesCB.clear(); - m_pTabCB.clear(); - m_pBreakCB.clear(); - m_pCharHiddenCB.clear(); - m_pDirectCursorFrame.clear(); - m_pOnOffCB.clear(); - m_pFillMarginRB.clear(); - m_pFillIndentRB.clear(); - m_pFillTabRB.clear(); - m_pFillSpaceRB.clear(); - m_pFillTabAndSpaceRB.clear(); - m_pCursorProtFrame.clear(); - m_pCursorInProtCB.clear(); - m_pMathBaselineAlignmentCB.clear(); - SfxTabPage::dispose(); } VclPtr<SfxTabPage> SwShdwCursorOptionsTabPage::Create( TabPageParent pParent, const SfxItemSet* rSet ) { - return VclPtr<SwShdwCursorOptionsTabPage>::Create( pParent.pParent, *rSet ); + return VclPtr<SwShdwCursorOptionsTabPage>::Create( pParent, *rSet ); } void SwShdwCursorOptionsTabPage::PageCreated( const SfxAllItemSet& aSet ) @@ -1370,16 +1337,16 @@ void SwShdwCursorOptionsTabPage::PageCreated( const SfxAllItemSet& aSet ) bool SwShdwCursorOptionsTabPage::FillItemSet( SfxItemSet* rSet ) { SwShadowCursorItem aOpt; - aOpt.SetOn( m_pOnOffCB->IsChecked() ); + aOpt.SetOn( m_xOnOffCB->get_active() ); sal_uInt8 eMode; - if( m_pFillIndentRB->IsChecked() ) + if( m_xFillIndentRB->get_active() ) eMode= FILL_INDENT; - else if( m_pFillMarginRB->IsChecked() ) + else if( m_xFillMarginRB->get_active() ) eMode = FILL_MARGIN; - else if( m_pFillTabRB->IsChecked() ) + else if( m_xFillTabRB->get_active() ) eMode = FILL_TAB; - else if ( m_pFillTabAndSpaceRB->IsChecked() ) + else if ( m_xFillTabAndSpaceRB->get_active() ) eMode = FILL_TAB_SPACE; else eMode = FILL_SPACE; @@ -1396,13 +1363,13 @@ bool SwShdwCursorOptionsTabPage::FillItemSet( SfxItemSet* rSet ) if (m_pWrtShell) { m_pWrtShell->GetDoc()->getIDocumentSettingAccess().set( DocumentSettingId::MATH_BASELINE_ALIGNMENT, - m_pMathBaselineAlignmentCB->IsChecked() ); - bRet |= m_pMathBaselineAlignmentCB->IsValueChangedFromSaved(); + m_xMathBaselineAlignmentCB->get_active() ); + bRet |= m_xMathBaselineAlignmentCB->get_state_changed_from_saved(); } - if( m_pCursorInProtCB->IsValueChangedFromSaved()) + if( m_xCursorInProtCB->get_state_changed_from_saved()) { - rSet->Put(SfxBoolItem(FN_PARAM_CRSR_IN_PROTECTED, m_pCursorInProtCB->IsChecked())); + rSet->Put(SfxBoolItem(FN_PARAM_CRSR_IN_PROTECTED, m_xCursorInProtCB->get_active())); bRet = true; } @@ -1411,13 +1378,13 @@ bool SwShdwCursorOptionsTabPage::FillItemSet( SfxItemSet* rSet ) SwDocDisplayItem aDisp; - aDisp.bParagraphEnd = m_pParaCB->IsChecked(); - aDisp.bTab = m_pTabCB->IsChecked(); - aDisp.bSpace = m_pSpacesCB->IsChecked(); - aDisp.bNonbreakingSpace = m_pHSpacesCB->IsChecked(); - aDisp.bSoftHyphen = m_pSHyphCB->IsChecked(); - aDisp.bCharHiddenText = m_pCharHiddenCB->IsChecked(); - aDisp.bManualBreak = m_pBreakCB->IsChecked(); + aDisp.bParagraphEnd = m_xParaCB->get_active(); + aDisp.bTab = m_xTabCB->get_active(); + aDisp.bSpace = m_xSpacesCB->get_active(); + aDisp.bNonbreakingSpace = m_xHSpacesCB->get_active(); + aDisp.bSoftHyphen = m_xSHyphCB->get_active(); + aDisp.bCharHiddenText = m_xCharHiddenCB->get_active(); + aDisp.bManualBreak = m_xBreakCB->get_active(); bRet |= (!pOldAttr || aDisp != *pOldAttr); if(bRet) @@ -1438,24 +1405,24 @@ void SwShdwCursorOptionsTabPage::Reset( const SfxItemSet* rSet ) eMode = aOpt.GetMode(); bIsOn = aOpt.IsOn(); } - m_pOnOffCB->Check( bIsOn ); + m_xOnOffCB->set_active( bIsOn ); - m_pFillIndentRB->Check( FILL_INDENT == eMode ); - m_pFillMarginRB->Check( FILL_MARGIN == eMode ); - m_pFillTabRB->Check( FILL_TAB == eMode ); - m_pFillSpaceRB->Check( FILL_SPACE == eMode ); - m_pFillTabAndSpaceRB->Check( FILL_TAB_SPACE == eMode ); + m_xFillIndentRB->set_active( FILL_INDENT == eMode ); + m_xFillMarginRB->set_active( FILL_MARGIN == eMode ); + m_xFillTabRB->set_active( FILL_TAB == eMode ); + m_xFillSpaceRB->set_active( FILL_SPACE == eMode ); + m_xFillTabAndSpaceRB->set_active( FILL_TAB_SPACE == eMode ); if (m_pWrtShell) { - m_pMathBaselineAlignmentCB->Check( m_pWrtShell->GetDoc()->getIDocumentSettingAccess().get( DocumentSettingId::MATH_BASELINE_ALIGNMENT ) ); - m_pMathBaselineAlignmentCB->SaveValue(); + m_xMathBaselineAlignmentCB->set_active( m_pWrtShell->GetDoc()->getIDocumentSettingAccess().get( DocumentSettingId::MATH_BASELINE_ALIGNMENT ) ); + m_xMathBaselineAlignmentCB->save_state(); } else { - m_pMathBaselineAlignmentCB->Hide(); + m_xMathBaselineAlignmentCB->hide(); } if( SfxItemState::SET == rSet->GetItemState( FN_PARAM_CRSR_IN_PROTECTED, false, &pItem )) - m_pCursorInProtCB->Check(static_cast<const SfxBoolItem*>(pItem)->GetValue()); - m_pCursorInProtCB->SaveValue(); + m_xCursorInProtCB->set_active(static_cast<const SfxBoolItem*>(pItem)->GetValue()); + m_xCursorInProtCB->save_state(); const SwDocDisplayItem* pDocDisplayAttr = nullptr; @@ -1463,13 +1430,13 @@ void SwShdwCursorOptionsTabPage::Reset( const SfxItemSet* rSet ) reinterpret_cast<const SfxPoolItem**>(&pDocDisplayAttr) ); if(pDocDisplayAttr) { - m_pParaCB->Check ( pDocDisplayAttr->bParagraphEnd ); - m_pTabCB->Check ( pDocDisplayAttr->bTab ); - m_pSpacesCB->Check ( pDocDisplayAttr->bSpace ); - m_pHSpacesCB->Check ( pDocDisplayAttr->bNonbreakingSpace ); - m_pSHyphCB->Check ( pDocDisplayAttr->bSoftHyphen ); - m_pCharHiddenCB->Check ( pDocDisplayAttr->bCharHiddenText ); - m_pBreakCB->Check ( pDocDisplayAttr->bManualBreak ); + m_xParaCB->set_active( pDocDisplayAttr->bParagraphEnd ); + m_xTabCB->set_active( pDocDisplayAttr->bTab ); + m_xSpacesCB->set_active( pDocDisplayAttr->bSpace ); + m_xHSpacesCB->set_active( pDocDisplayAttr->bNonbreakingSpace ); + m_xSHyphCB->set_active( pDocDisplayAttr->bSoftHyphen ); + m_xCharHiddenCB->set_active( pDocDisplayAttr->bCharHiddenText ); + m_xBreakCB->set_active( pDocDisplayAttr->bManualBreak ); } } diff --git a/sw/source/uibase/inc/optpage.hxx b/sw/source/uibase/inc/optpage.hxx index 010eafdb6d05..bcdf792ab572 100644 --- a/sw/source/uibase/inc/optpage.hxx +++ b/sw/source/uibase/inc/optpage.hxx @@ -228,35 +228,34 @@ public: // TabPage for ShadowCursor class SwShdwCursorOptionsTabPage : public SfxTabPage { + SwWrtShell * m_pWrtShell; + //nonprinting characters - VclPtr<CheckBox> m_pParaCB; - VclPtr<CheckBox> m_pSHyphCB; - VclPtr<CheckBox> m_pSpacesCB; - VclPtr<CheckBox> m_pHSpacesCB; - VclPtr<CheckBox> m_pTabCB; - VclPtr<CheckBox> m_pBreakCB; - VclPtr<CheckBox> m_pCharHiddenCB; + std::unique_ptr<weld::CheckButton> m_xParaCB; + std::unique_ptr<weld::CheckButton> m_xSHyphCB; + std::unique_ptr<weld::CheckButton> m_xSpacesCB; + std::unique_ptr<weld::CheckButton> m_xHSpacesCB; + std::unique_ptr<weld::CheckButton> m_xTabCB; + std::unique_ptr<weld::CheckButton> m_xBreakCB; + std::unique_ptr<weld::CheckButton> m_xCharHiddenCB; - VclPtr<VclFrame> m_pDirectCursorFrame; - VclPtr<CheckBox> m_pOnOffCB; + std::unique_ptr<weld::Frame> m_xDirectCursorFrame; + std::unique_ptr<weld::CheckButton> m_xOnOffCB; - VclPtr<RadioButton> m_pFillMarginRB; - VclPtr<RadioButton> m_pFillIndentRB; - VclPtr<RadioButton> m_pFillTabRB; - VclPtr<RadioButton> m_pFillTabAndSpaceRB; - VclPtr<RadioButton> m_pFillSpaceRB; + std::unique_ptr<weld::RadioButton> m_xFillMarginRB; + std::unique_ptr<weld::RadioButton> m_xFillIndentRB; + std::unique_ptr<weld::RadioButton> m_xFillTabRB; + std::unique_ptr<weld::RadioButton> m_xFillTabAndSpaceRB; + std::unique_ptr<weld::RadioButton> m_xFillSpaceRB; - VclPtr<VclFrame> m_pCursorProtFrame; - VclPtr<CheckBox> m_pCursorInProtCB; + std::unique_ptr<weld::Frame> m_xCursorProtFrame; + std::unique_ptr<weld::CheckButton> m_xCursorInProtCB; - VclPtr<CheckBox> m_pMathBaselineAlignmentCB; - - SwWrtShell * m_pWrtShell; + std::unique_ptr<weld::CheckButton> m_xMathBaselineAlignmentCB; public: - SwShdwCursorOptionsTabPage( vcl::Window* pParent, const SfxItemSet& rSet ); + SwShdwCursorOptionsTabPage(TabPageParent pParent, const SfxItemSet& rSet); virtual ~SwShdwCursorOptionsTabPage() override; - virtual void dispose() override; static VclPtr<SfxTabPage> Create(TabPageParent pParent, const SfxItemSet* rAttrSet); diff --git a/sw/uiconfig/swriter/ui/optformataidspage.ui b/sw/uiconfig/swriter/ui/optformataidspage.ui index a869a1c3344e..209de810ac5b 100644 --- a/sw/uiconfig/swriter/ui/optformataidspage.ui +++ b/sw/uiconfig/swriter/ui/optformataidspage.ui @@ -355,8 +355,8 @@ <property name="receives_default">False</property> <property name="use_underline">True</property> <property name="xalign">0</property> + <property name="active">True</property> <property name="draw_indicator">True</property> - <property name="group">fillindent</property> </object> <packing> <property name="left_attach">0</property> @@ -372,7 +372,7 @@ <property name="use_underline">True</property> <property name="xalign">0</property> <property name="draw_indicator">True</property> - <property name="group">filltab</property> + <property name="group">fillmargin</property> </object> <packing> <property name="left_attach">0</property> @@ -388,7 +388,7 @@ <property name="use_underline">True</property> <property name="xalign">0</property> <property name="draw_indicator">True</property> - <property name="group">filltabandspace</property> + <property name="group">fillmargin</property> </object> <packing> <property name="left_attach">0</property> commit 579350af152d3599e9b62e8f80f59523184a104e Author: Caolán McNamara <[email protected]> AuthorDate: Sat Jul 27 15:32:17 2019 +0100 Commit: Caolán McNamara <[email protected]> CommitDate: Sat Jul 27 18:44:34 2019 +0200 weld SwCompareOptionsTabPage Change-Id: Idd158f9352caa2544188e99d3db69f4cccce0474 Reviewed-on: https://gerrit.libreoffice.org/76475 Tested-by: Jenkins Reviewed-by: Caolán McNamara <[email protected]> Tested-by: Caolán McNamara <[email protected]> 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> _______________________________________________ Libreoffice-commits mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
