diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2015-10-04 15:05:38 +0200 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2015-10-12 10:48:13 +0000 |
commit | 3c99f8500f657ed84b316390d5175a6f5e56bc69 (patch) | |
tree | 749f16652560a50d409b12a23bf1a5d93b3cd2d5 /sw/source/ui/frmdlg | |
parent | bbadb38539eb233ac45b267034066a7274181c65 (diff) |
convert Link<> to typed
Change-Id: Iec15042138e0715459b2c9e872a7464d75a6b1eb
Reviewed-on: https://gerrit.libreoffice.org/19305
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'sw/source/ui/frmdlg')
-rw-r--r-- | sw/source/ui/frmdlg/column.cxx | 20 | ||||
-rw-r--r-- | sw/source/ui/frmdlg/cption.cxx | 6 | ||||
-rw-r--r-- | sw/source/ui/frmdlg/frmpage.cxx | 39 |
3 files changed, 36 insertions, 29 deletions
diff --git a/sw/source/ui/frmdlg/column.cxx b/sw/source/ui/frmdlg/column.cxx index 8a62944e9592..2595b91ef741 100644 --- a/sw/source/ui/frmdlg/column.cxx +++ b/sw/source/ui/frmdlg/column.cxx @@ -204,7 +204,7 @@ SwColumnDlg::SwColumnDlg(vcl::Window* pParent, SwWrtShell& rSh) m_pApplyToLB->SelectEntryPos(0); ObjectHdl(0); - m_pApplyToLB->SetSelectHdl(LINK(this, SwColumnDlg, ObjectHdl)); + m_pApplyToLB->SetSelectHdl(LINK(this, SwColumnDlg, ObjectListBoxHdl)); OKButton *pOK = get<OKButton>("ok"); pOK->SetClickHdl(LINK(this, SwColumnDlg, OkHdl)); //#i80458# if no columns can be set then disable OK @@ -230,7 +230,11 @@ void SwColumnDlg::dispose() SfxModalDialog::dispose(); } -IMPL_LINK(SwColumnDlg, ObjectHdl, ListBox*, pBox) +IMPL_LINK_TYPED(SwColumnDlg, ObjectListBoxHdl, ListBox&, rBox, void) +{ + ObjectHdl(&rBox); +} +void SwColumnDlg::ObjectHdl(ListBox* pBox) { SfxItemSet* pSet = 0; switch(nOldSelection) @@ -290,7 +294,6 @@ IMPL_LINK(SwColumnDlg, ObjectHdl, ListBox*, pBox) pTabPage->SetPageWidth(nWidth); if( pSet ) pTabPage->Reset(pSet); - return 0; } IMPL_LINK_NOARG_TYPED(SwColumnDlg, OkHdl, Button*, void) @@ -497,11 +500,12 @@ SwColumnPage::SwColumnPage(vcl::Window *pParent, const SfxItemSet &rSet) m_pAutoWidthBox->SetClickHdl(LINK(this, SwColumnPage, AutoWidthHdl)); aLk = LINK( this, SwColumnPage, UpdateColMgr ); - m_pLineTypeDLB->SetSelectHdl( aLk ); + Link<ListBox&,void> aLk2 = LINK( this, SwColumnPage, UpdateColMgrListBox ); + m_pLineTypeDLB->SetSelectHdl( aLk2 ); m_pLineWidthEdit->SetModifyHdl( aLk ); - m_pLineColorDLB->SetSelectHdl( aLk ); + m_pLineColorDLB->SetSelectHdl( aLk2 ); m_pLineHeightEdit->SetModifyHdl( aLk ); - m_pLinePosDLB->SetSelectHdl( aLk ); + m_pLinePosDLB->SetSelectHdl( aLk2 ); // Separator line m_pLineTypeDLB->SetUnit( FUNIT_POINT ); @@ -695,6 +699,10 @@ bool SwColumnPage::FillItemSet(SfxItemSet *rSet) } // update ColumnManager +IMPL_LINK_NOARG_TYPED( SwColumnPage, UpdateColMgrListBox, ListBox&, void ) +{ + UpdateColMgr(0); +} IMPL_LINK_NOARG( SwColumnPage, UpdateColMgr ) { long nGutterWidth = pColMgr->GetGutterWidth(); diff --git a/sw/source/ui/frmdlg/cption.cxx b/sw/source/ui/frmdlg/cption.cxx index db588e66959e..9e3fee8cf273 100644 --- a/sw/source/ui/frmdlg/cption.cxx +++ b/sw/source/ui/frmdlg/cption.cxx @@ -138,7 +138,7 @@ SwCaptionDialog::SwCaptionDialog( vcl::Window *pParent, SwView &rV ) : aLk = LINK(this, SwCaptionDialog, SelectHdl); m_pCategoryBox->SetSelectHdl( aLk ); - m_pFormatBox->SetSelectHdl( aLk ); + m_pFormatBox->SetSelectHdl( LINK(this, SwCaptionDialog, SelectListBoxHdl) ); m_pOptionButton->SetClickHdl( LINK( this, SwCaptionDialog, OptionHdl ) ); m_pAutoCaptionButton->SetClickHdl(LINK(this, SwCaptionDialog, CaptionHdl)); @@ -302,6 +302,10 @@ IMPL_LINK_TYPED( SwCaptionDialog, OptionHdl, Button*, pButton, void ) DrawSample(); } +IMPL_LINK_NOARG_TYPED(SwCaptionDialog, SelectListBoxHdl, ListBox&, void) +{ + DrawSample(); +} IMPL_LINK_NOARG(SwCaptionDialog, SelectHdl) { DrawSample(); diff --git a/sw/source/ui/frmdlg/frmpage.cxx b/sw/source/ui/frmdlg/frmpage.cxx index 9e3097c17db1..a2318f5ff99b 100644 --- a/sw/source/ui/frmdlg/frmpage.cxx +++ b/sw/source/ui/frmdlg/frmpage.cxx @@ -1441,7 +1441,7 @@ sal_Int32 SwFrmPage::FillPosLB(const FrmMap* _pMap, if (!_rLB.GetSelectEntryCount()) _rLB.SelectEntryPos(0); - PosHdl(&_rLB); + PosHdl(_rLB); return GetMapPos(_pMap, _rLB); } @@ -1621,7 +1621,7 @@ sal_uLong SwFrmPage::FillRelLB( const FrmMap* _pMap, _rLB.Enable( bEnable ); _rFT.Enable( bEnable ); - RelHdl(&_rLB); + RelHdl(_rLB); return nLBRelations; } @@ -1940,23 +1940,23 @@ IMPL_LINK_NOARG_TYPED(SwFrmPage, AnchorTypeHdl, Button*, void) if(bHtmlMode) { - PosHdl(m_pHorizontalDLB); - PosHdl(m_pVerticalDLB); + PosHdl(*m_pHorizontalDLB); + PosHdl(*m_pVerticalDLB); } EnableVerticalPositioning( !(m_bIsMathOLE && m_bIsMathBaselineAlignment && FLY_AS_CHAR == eId) ); } -IMPL_LINK( SwFrmPage, PosHdl, ListBox *, pLB ) +IMPL_LINK_TYPED( SwFrmPage, PosHdl, ListBox&, rLB, void ) { - bool bHori = pLB == m_pHorizontalDLB; + bool bHori = &rLB == m_pHorizontalDLB; ListBox *pRelLB = bHori ? m_pHoriRelationLB : m_pVertRelationLB; FixedText *pRelFT = bHori ? m_pHoriRelationFT : m_pVertRelationFT; FrmMap *pMap = bHori ? pHMap : pVMap; - const sal_Int32 nMapPos = GetMapPos(pMap, *pLB); - const sal_Int16 nAlign = GetAlignment(pMap, nMapPos, *pLB, *pRelLB); + const sal_Int32 nMapPos = GetMapPos(pMap, rLB); + const sal_Int16 nAlign = GetAlignment(pMap, nMapPos, rLB, *pRelLB); if (bHori) { @@ -1974,7 +1974,7 @@ IMPL_LINK( SwFrmPage, PosHdl, ListBox *, pLB ) RangeModifyHdl(); sal_Int16 nRel = 0; - if (pLB->GetSelectEntryCount()) + if (rLB.GetSelectEntryCount()) { if (pRelLB->GetSelectEntryPos() != LISTBOX_ENTRY_NOTFOUND) @@ -2020,7 +2020,7 @@ IMPL_LINK( SwFrmPage, PosHdl, ListBox *, pLB ) bSet = true; } if(bSet) - PosHdl(m_pVerticalDLB); + PosHdl(*m_pVerticalDLB); } else { @@ -2043,17 +2043,16 @@ IMPL_LINK( SwFrmPage, PosHdl, ListBox *, pLB ) m_pHoriRelationLB->SelectEntryPos(0) ; } if(bSet) - PosHdl(m_pHorizontalDLB); + PosHdl(*m_pHorizontalDLB); } } - return 0; } // horizontal Pos -IMPL_LINK( SwFrmPage, RelHdl, ListBox *, pLB ) +IMPL_LINK_TYPED( SwFrmPage, RelHdl, ListBox&, rLB, void ) { - bool bHori = pLB == m_pHoriRelationLB; + bool bHori = &rLB == m_pHoriRelationLB; UpdateExample(); @@ -2077,10 +2076,7 @@ IMPL_LINK( SwFrmPage, RelHdl, ListBox *, pLB ) } } } - if (pLB) // Only when Handler was called by changing of the controller - RangeModifyHdl(); - - return 0; + RangeModifyHdl(); } IMPL_LINK_NOARG_TYPED(SwFrmPage, RealSizeHdl, Button*, void) @@ -3056,7 +3052,7 @@ void SwFrmAddPage::Reset(const SfxItemSet *rSet ) } else pNextLB->SelectEntryPos(0); - Link<> aLink(LINK(this, SwFrmAddPage, ChainModifyHdl)); + Link<ListBox&,void> aLink(LINK(this, SwFrmAddPage, ChainModifyHdl)); pPrevLB->SetSelectHdl(aLink); pNextLB->SetSelectHdl(aLink); } @@ -3214,7 +3210,7 @@ void SwFrmAddPage::SetFormatUsed(bool bFormatUsed) } } -IMPL_LINK(SwFrmAddPage, ChainModifyHdl, ListBox*, pBox) +IMPL_LINK_TYPED(SwFrmAddPage, ChainModifyHdl, ListBox&, rBox, void) { OUString sCurrentPrevChain, sCurrentNextChain; if(pPrevLB->GetSelectEntryPos()) @@ -3224,7 +3220,7 @@ IMPL_LINK(SwFrmAddPage, ChainModifyHdl, ListBox*, pBox) SwFrameFormat* pFormat = pWrtSh->GetFlyFrameFormat(); if (pFormat) { - bool bNextBox = pNextLB == pBox; + bool bNextBox = pNextLB == &rBox; ListBox& rChangeLB = bNextBox ? *pPrevLB : *pNextLB; for(sal_Int32 nEntry = rChangeLB.GetEntryCount(); nEntry > 1; nEntry--) rChangeLB.RemoveEntry(nEntry - 1); @@ -3244,7 +3240,6 @@ IMPL_LINK(SwFrmAddPage, ChainModifyHdl, ListBox*, pBox) rChangeLB.SelectEntryPos(0); } - return 0; } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |