diff options
author | Noel Grandin <noel@peralex.com> | 2015-08-19 09:11:34 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2015-08-26 11:15:35 +0200 |
commit | 167bc621ef825ed5b961502fe9324a675ee34e42 (patch) | |
tree | 523838d8adc14a62f846529ee6eab3343b2fe87b /svx | |
parent | 46a27805fb707544a844a961a3743b8b992282f0 (diff) |
Convert vcl Button Link<> click handler to typed Link<Button*,void>
Change-Id: Ie80dfb003118d40741549c41ebcc7eda4819f05b
Diffstat (limited to 'svx')
34 files changed, 197 insertions, 260 deletions
diff --git a/svx/source/dialog/_bmpmask.cxx b/svx/source/dialog/_bmpmask.cxx index ef68703c7b71..bbe0d9647a5f 100644 --- a/svx/source/dialog/_bmpmask.cxx +++ b/svx/source/dialog/_bmpmask.cxx @@ -173,10 +173,10 @@ public: bool IsExecReady() const { return bExecState; } DECL_LINK_TYPED( PipetteHdl, ToolBox*, void ); - DECL_LINK( CbxHdl, CheckBox* ); - DECL_LINK( CbxTransHdl, CheckBox* ); + DECL_LINK_TYPED( CbxHdl, Button*, void); + DECL_LINK_TYPED( CbxTransHdl, Button*, void ); DECL_LINK( FocusLbHdl, ColorLB* ); - DECL_LINK(ExecHdl, void *); + DECL_LINK_TYPED(ExecHdl, Button*, void); }; @@ -199,8 +199,9 @@ IMPL_LINK_TYPED( MaskData, PipetteHdl, ToolBox*, pTbx, void ) rBindings.GetDispatcher()->Execute( SID_BMPMASK_PIPETTE, OWN_CALLMODE, &aBItem, 0L ); } -IMPL_LINK( MaskData, CbxHdl, CheckBox*, pCbx ) +IMPL_LINK_TYPED( MaskData, CbxHdl, Button*, pButton, void ) { + CheckBox* pCbx = static_cast<CheckBox*>(pButton); bIsReady = pMask->m_pCbx1->IsChecked() || pMask->m_pCbx2->IsChecked() || pMask->m_pCbx3->IsChecked() || pMask->m_pCbx4->IsChecked(); @@ -229,14 +230,13 @@ IMPL_LINK( MaskData, CbxHdl, CheckBox*, pCbx ) pMask->m_pTbxPipette->CheckItem( pMask->m_pTbxPipette->GetItemId(0) ); PipetteHdl(pMask->m_pTbxPipette); } - - return 0; } -IMPL_LINK( MaskData, CbxTransHdl, CheckBox*, pCbx ) +IMPL_LINK_TYPED( MaskData, CbxTransHdl, Button*, pButton, void ) { + CheckBox* pCbx = static_cast<CheckBox*>(pButton); bIsReady = pCbx->IsChecked(); if ( bIsReady ) { @@ -292,8 +292,6 @@ IMPL_LINK( MaskData, CbxTransHdl, CheckBox*, pCbx ) pMask->m_pBtnExec->Enable(); else pMask->m_pBtnExec->Disable(); - - return 0L; } @@ -311,12 +309,10 @@ IMPL_LINK( MaskData, FocusLbHdl, ColorLB*, pLb ) -IMPL_LINK_NOARG(MaskData, ExecHdl) +IMPL_LINK_NOARG_TYPED(MaskData, ExecHdl, Button*, void) { SfxBoolItem aBItem( SID_BMPMASK_EXEC, true ); rBindings.GetDispatcher()->Execute( SID_BMPMASK_EXEC, OWN_CALLMODE, &aBItem, 0L ); - - return 0L; } void ColorWindow::Paint( vcl::RenderContext& rRenderContext, const Rectangle& /*Rect*/) diff --git a/svx/source/dialog/compressgraphicdialog.cxx b/svx/source/dialog/compressgraphicdialog.cxx index 43656aff665d..c398969ad996 100644 --- a/svx/source/dialog/compressgraphicdialog.cxx +++ b/svx/source/dialog/compressgraphicdialog.cxx @@ -340,7 +340,7 @@ IMPL_LINK_NOARG( CompressGraphicsDialog, ToggleReduceResolutionRB ) return 0L; } -IMPL_LINK_NOARG( CompressGraphicsDialog, CalculateClickHdl ) +IMPL_LINK_NOARG_TYPED( CompressGraphicsDialog, CalculateClickHdl, Button*, void ) { sal_Int32 aSize = 0; @@ -361,7 +361,6 @@ IMPL_LINK_NOARG( CompressGraphicsDialog, CalculateClickHdl ) aNewSizeString = aNewSizeString.replaceAll("$(CAPACITY)", aSizeAsString); m_pFixedText6->SetText(aNewSizeString); } - return 0L; } Rectangle CompressGraphicsDialog::GetScaledCropRectangle() diff --git a/svx/source/dialog/ctredlin.cxx b/svx/source/dialog/ctredlin.cxx index 602a7c2a76b8..3a6d07b9feef 100644 --- a/svx/source/dialog/ctredlin.cxx +++ b/svx/source/dialog/ctredlin.cxx @@ -392,7 +392,7 @@ SvxTPView::SvxTPView(vcl::Window *pParent, VclBuilderContainer *pTopLevel) pTable->set_height_request(aControlSize.Height()); m_pViewData = VclPtr<SvxRedlinTable>::Create(*pTable, 0); - Link<> aLink=LINK( this, SvxTPView, PbClickHdl); + Link<Button*,void> aLink=LINK( this, SvxTPView, PbClickHdl); m_pAccept->SetClickHdl(aLink); m_pAcceptAll->SetClickHdl(aLink); @@ -509,8 +509,9 @@ void SvxTPView::EnableUndo(bool nFlag) } -IMPL_LINK( SvxTPView, PbClickHdl, PushButton*, pPushB ) +IMPL_LINK_TYPED( SvxTPView, PbClickHdl, Button*, pButton, void ) { + PushButton* pPushB = static_cast<PushButton*>(pButton); if (pPushB == m_pAccept) { AcceptClickLk.Call(this); @@ -531,8 +532,6 @@ IMPL_LINK( SvxTPView, PbClickHdl, PushButton*, pPushB ) { UndoClickLk.Call(this); } - - return 0; } SvxTPFilter::SvxTPFilter( vcl::Window * pParent) @@ -571,7 +570,7 @@ SvxTPFilter::SvxTPFilter( vcl::Window * pParent) m_pIbClock2->SetClickHdl( LINK( this, SvxTPFilter,TimeHdl) ); m_pBtnRange->SetClickHdl( LINK( this, SvxTPFilter, RefHandle)); - Link<> aLink=LINK( this, SvxTPFilter, RowEnableHdl) ; + Link<Button*,void> aLink=LINK( this, SvxTPFilter, RowEnableHdl) ; m_pCbDate->SetClickHdl(aLink); m_pCbAuthor->SetClickHdl(aLink); m_pCbRange->SetClickHdl(aLink); @@ -915,8 +914,9 @@ IMPL_LINK( SvxTPFilter, SelDateHdl, ListBox*, pLb ) return 0; } -IMPL_LINK( SvxTPFilter, RowEnableHdl, CheckBox*, pCB ) +IMPL_LINK_TYPED( SvxTPFilter, RowEnableHdl, Button*, pButton, void ) { + CheckBox* pCB = static_cast<CheckBox*>(pButton); if (pCB == m_pCbDate) { m_pLbDate->Enable(m_pCbDate->IsChecked()); @@ -947,11 +947,11 @@ IMPL_LINK( SvxTPFilter, RowEnableHdl, CheckBox*, pCB ) } ModifyHdl(pCB); - return 0; } -IMPL_LINK( SvxTPFilter, TimeHdl, ImageButton*,pIB ) +IMPL_LINK_TYPED( SvxTPFilter, TimeHdl, Button*, pButton, void ) { + ImageButton* pIB = static_cast<ImageButton*>(pButton); Date aDate( Date::SYSTEM ); tools::Time aTime( tools::Time::SYSTEM ); if (pIB == m_pIbClock) @@ -965,7 +965,6 @@ IMPL_LINK( SvxTPFilter, TimeHdl, ImageButton*,pIB ) m_pTfDate2->SetTime(aTime); } ModifyHdl(m_pDfDate); - return 0; } IMPL_LINK( SvxTPFilter, ModifyHdl, void*, pCtr) @@ -1089,13 +1088,12 @@ IMPL_LINK( SvxTPFilter, ModifyDate, void*,pTF) return 0; } -IMPL_LINK( SvxTPFilter, RefHandle, PushButton*, pRef ) +IMPL_LINK_TYPED( SvxTPFilter, RefHandle, Button*, pRef, void ) { if(pRef!=NULL) { aRefLink.Call(this); } - return 0; } SvxAcceptChgCtr::SvxAcceptChgCtr(vcl::Window* pParent, VclBuilderContainer* pTopLevel) diff --git a/svx/source/dialog/dlgctl3d.cxx b/svx/source/dialog/dlgctl3d.cxx index 37d0b6ee28a1..ea9bc0f8a405 100644 --- a/svx/source/dialog/dlgctl3d.cxx +++ b/svx/source/dialog/dlgctl3d.cxx @@ -1241,7 +1241,7 @@ IMPL_LINK_NOARG(SvxLightCtl3D, ScrollBarMove) return 0; } -IMPL_LINK_NOARG(SvxLightCtl3D, ButtonPress) +IMPL_LINK_NOARG_TYPED(SvxLightCtl3D, ButtonPress, Button*, void) { if(SvxPreviewObjectType::SPHERE == GetSvx3DLightControl().GetObjectType()) { @@ -1251,8 +1251,6 @@ IMPL_LINK_NOARG(SvxLightCtl3D, ButtonPress) { GetSvx3DLightControl().SetObjectType(SvxPreviewObjectType::SPHERE); } - - return 0; } IMPL_LINK_NOARG(SvxLightCtl3D, InternalInteractiveChange) diff --git a/svx/source/dialog/docrecovery.cxx b/svx/source/dialog/docrecovery.cxx index c08b4b9f7bc9..019b4d99740d 100644 --- a/svx/source/dialog/docrecovery.cxx +++ b/svx/source/dialog/docrecovery.cxx @@ -678,7 +678,7 @@ void SaveDialog::dispose() Dialog::dispose(); } -IMPL_LINK_NOARG(SaveDialog, OKButtonHdl) +IMPL_LINK_NOARG_TYPED(SaveDialog, OKButtonHdl, Button*, void) { // start crash-save with progress ScopedVclPtrInstance< SaveProgressDialog > pProgress(this, m_pCore); @@ -691,7 +691,6 @@ IMPL_LINK_NOARG(SaveDialog, OKButtonHdl) nResult = DLG_RET_OK_AUTOLUNCH; EndDialog(nResult); - return 0; } SaveProgressDialog::SaveProgressDialog(vcl::Window* pParent, RecoveryCore* pCore) @@ -1166,7 +1165,7 @@ void RecoveryDialog::end() m_bWaitForCore = false; } -IMPL_LINK_NOARG(RecoveryDialog, NextButtonHdl) +IMPL_LINK_NOARG_TYPED(RecoveryDialog, NextButtonHdl, Button*, void) { switch (m_eRecoveryState) { @@ -1183,13 +1182,10 @@ IMPL_LINK_NOARG(RecoveryDialog, NextButtonHdl) if (m_eRecoveryState == RecoveryDialog::E_RECOVERY_HANDLED) { EndDialog(DLG_RET_OK); - return DLG_RET_OK; } - - return 0; } -IMPL_LINK_NOARG(RecoveryDialog, CancelButtonHdl) +IMPL_LINK_NOARG_TYPED(RecoveryDialog, CancelButtonHdl, Button*, void) { switch (m_eRecoveryState) { @@ -1209,10 +1205,7 @@ IMPL_LINK_NOARG(RecoveryDialog, CancelButtonHdl) if (m_eRecoveryState == RecoveryDialog::E_RECOVERY_HANDLED) { EndDialog(); - return DLG_RET_CANCEL; } - - return 0; } OUString RecoveryDialog::impl_getStatusString( const TURLInfo& rInfo ) const @@ -1332,7 +1325,7 @@ OUString BrokenRecoveryDialog::getSaveDirURL() } -IMPL_LINK_NOARG(BrokenRecoveryDialog, OkButtonHdl) +IMPL_LINK_NOARG_TYPED(BrokenRecoveryDialog, OkButtonHdl, Button*, void) { OUString sPhysicalPath = comphelper::string::strip(m_pSaveDirED->GetText(), ' '); OUString sURL; @@ -1342,21 +1335,18 @@ IMPL_LINK_NOARG(BrokenRecoveryDialog, OkButtonHdl) impl_askForSavePath(); EndDialog(DLG_RET_OK); - return 0; } -IMPL_LINK_NOARG(BrokenRecoveryDialog, CancelButtonHdl) +IMPL_LINK_NOARG_TYPED(BrokenRecoveryDialog, CancelButtonHdl, Button*, void) { EndDialog(); - return 0; } -IMPL_LINK_NOARG(BrokenRecoveryDialog, SaveButtonHdl) +IMPL_LINK_NOARG_TYPED(BrokenRecoveryDialog, SaveButtonHdl, Button*, void) { impl_askForSavePath(); - return 0; } diff --git a/svx/source/dialog/hdft.cxx b/svx/source/dialog/hdft.cxx index 03d3e31eb6e0..427eb4c0316e 100644 --- a/svx/source/dialog/hdft.cxx +++ b/svx/source/dialog/hdft.cxx @@ -501,8 +501,9 @@ void SvxHFPage::InitHandler() m_pBackgroundBtn->SetClickHdl(LINK(this,SvxHFPage, BackgroundHdl)); } -IMPL_LINK( SvxHFPage, TurnOnHdl, CheckBox *, pBox ) +IMPL_LINK_TYPED( SvxHFPage, TurnOnHdl, Button *, pButton, void ) { + CheckBox* pBox = static_cast<CheckBox*>(pButton); if ( m_pTurnOnBox->IsChecked() ) { m_pDistFT->Enable(); @@ -563,7 +564,6 @@ IMPL_LINK( SvxHFPage, TurnOnHdl, CheckBox *, pBox ) m_pTurnOnBox->Check(); } UpdateExample(); - return 0; } IMPL_LINK_NOARG(SvxHFPage, DistModify) @@ -585,7 +585,7 @@ IMPL_LINK_NOARG(SvxHFPage, BorderModify) return 0; } -IMPL_LINK_NOARG(SvxHFPage, BackgroundHdl) +IMPL_LINK_NOARG_TYPED(SvxHFPage, BackgroundHdl, Button*, void) { if(!pBBSet) { @@ -749,8 +749,6 @@ IMPL_LINK_NOARG(SvxHFPage, BackgroundHdl) UpdateExample(); } - - return 0; } void SvxHFPage::UpdateExample() diff --git a/svx/source/dialog/optgrid.cxx b/svx/source/dialog/optgrid.cxx index 2d2fca69b106..8340c0c51d29 100644 --- a/svx/source/dialog/optgrid.cxx +++ b/svx/source/dialog/optgrid.cxx @@ -157,7 +157,7 @@ SvxGridTabPage::SvxGridTabPage( vcl::Window* pParent, const SfxItemSet& rCoreSet pCbxRotate->SetClickHdl( LINK( this, SvxGridTabPage, ClickRotateHdl_Impl ) ); - Link<> aLink = LINK( this, SvxGridTabPage, ChangeGridsnapHdl_Impl ); + Link<Button*,void> aLink = LINK( this, SvxGridTabPage, ChangeGridsnapHdl_Impl ); pCbxUseGridsnap->SetClickHdl( aLink ); pCbxSynchronize->SetClickHdl( aLink ); pCbxGridVisible->SetClickHdl( aLink ); @@ -326,14 +326,12 @@ IMPL_LINK( SvxGridTabPage, ChangeDrawHdl_Impl, MetricField *, pField ) } -IMPL_LINK_NOARG(SvxGridTabPage, ClickRotateHdl_Impl) +IMPL_LINK_NOARG_TYPED(SvxGridTabPage, ClickRotateHdl_Impl, Button*, void) { if( pCbxRotate->IsChecked() ) pMtrFldAngle->Enable(); else pMtrFldAngle->Disable(); - - return 0L; } @@ -352,10 +350,9 @@ IMPL_LINK( SvxGridTabPage, ChangeDivisionHdl_Impl, NumericField *, pField ) } -IMPL_LINK_NOARG(SvxGridTabPage, ChangeGridsnapHdl_Impl) +IMPL_LINK_NOARG_TYPED(SvxGridTabPage, ChangeGridsnapHdl_Impl, Button*, void) { bAttrModified = true; - return 0; } diff --git a/svx/source/dialog/orienthelper.cxx b/svx/source/dialog/orienthelper.cxx index d622c8b4b66d..1bae8481e15e 100644 --- a/svx/source/dialog/orienthelper.cxx +++ b/svx/source/dialog/orienthelper.cxx @@ -49,7 +49,7 @@ struct OrientationHelper_Impl void ShowDependentWindows(); - DECL_LINK( ClickHdl, void* ); + DECL_LINK_TYPED( ClickHdl, Button*, void ); }; @@ -97,10 +97,9 @@ void OrientationHelper_Impl::ShowDependentWindows() aIt->first->Show( mbVisible ); } -IMPL_LINK_NOARG(OrientationHelper_Impl, ClickHdl) +IMPL_LINK_NOARG_TYPED(OrientationHelper_Impl, ClickHdl, Button*, void) { EnableDependentWindows(); - return 0L; } diff --git a/svx/source/dialog/passwd.cxx b/svx/source/dialog/passwd.cxx index 5139bafe8bb1..ebb736cdbfbe 100644 --- a/svx/source/dialog/passwd.cxx +++ b/svx/source/dialog/passwd.cxx @@ -23,7 +23,7 @@ #include <svx/dialmgr.hxx> #include <svx/dialogs.hrc> -IMPL_LINK_NOARG(SvxPasswordDialog, ButtonHdl) +IMPL_LINK_NOARG_TYPED(SvxPasswordDialog, ButtonHdl, Button*, void) { bool bOK = true; short nRet = RET_OK; @@ -48,8 +48,6 @@ IMPL_LINK_NOARG(SvxPasswordDialog, ButtonHdl) if ( bOK ) EndDialog( nRet ); - - return 0; } diff --git a/svx/source/dialog/rubydialog.cxx b/svx/source/dialog/rubydialog.cxx index 891dc33f077f..d6dc088dfd54 100644 --- a/svx/source/dialog/rubydialog.cxx +++ b/svx/source/dialog/rubydialog.cxx @@ -564,7 +564,7 @@ IMPL_LINK(SvxRubyDialog, ScrollHdl_Impl, ScrollBar*, pScroll) return 0; } -IMPL_LINK_NOARG(SvxRubyDialog, ApplyHdl_Impl) +IMPL_LINK_NOARG_TYPED(SvxRubyDialog, ApplyHdl_Impl, Button*, void) { const Sequence<PropertyValues>& aRubyValues = pImpl->GetRubyValues(); if (!aRubyValues.getLength()) @@ -590,16 +590,14 @@ IMPL_LINK_NOARG(SvxRubyDialog, ApplyHdl_Impl) OSL_FAIL("Exception caught"); } } - return 0; } -IMPL_LINK_NOARG(SvxRubyDialog, CloseHdl_Impl) +IMPL_LINK_NOARG_TYPED(SvxRubyDialog, CloseHdl_Impl, Button*, void) { Close(); - return 0; } -IMPL_LINK_NOARG(SvxRubyDialog, StylistHdl_Impl) +IMPL_LINK_NOARG_TYPED(SvxRubyDialog, StylistHdl_Impl, Button*, void) { SfxPoolItem* pState = nullptr; SfxItemState eState = pBindings->QueryState(SID_STYLE_DESIGNER, pState); @@ -609,7 +607,6 @@ IMPL_LINK_NOARG(SvxRubyDialog, StylistHdl_Impl) SfxCallMode::ASYNCHRON | SfxCallMode::RECORD); } delete pState; - return 0; } IMPL_LINK(SvxRubyDialog, AdjustHdl_Impl, ListBox*, pBox) diff --git a/svx/source/dialog/srchdlg.cxx b/svx/source/dialog/srchdlg.cxx index ba27a6a3a870..f31dc5bcb756 100644 --- a/svx/source/dialog/srchdlg.cxx +++ b/svx/source/dialog/srchdlg.cxx @@ -644,29 +644,29 @@ void SvxSearchDialog::InitControls_Impl() m_pSearchTmplLB->SetLoseFocusHdl( aLink ); m_pReplaceTmplLB->SetLoseFocusHdl( aLink ); - aLink = LINK( this, SvxSearchDialog, CommandHdl_Impl ); - m_pSearchBtn->SetClickHdl( aLink ); - m_pSearchAllBtn->SetClickHdl( aLink ); - m_pReplaceBtn->SetClickHdl( aLink ); - m_pReplaceAllBtn->SetClickHdl( aLink ); - m_pCloseBtn->SetClickHdl( aLink ); - m_pSimilarityBtn->SetClickHdl( aLink ); - m_pJapOptionsBtn->SetClickHdl( aLink ); - m_pSearchComponent1PB->SetClickHdl( aLink ); - m_pSearchComponent2PB->SetClickHdl( aLink ); - - aLink = LINK( this, SvxSearchDialog, FlagHdl_Impl ); - m_pWordBtn->SetClickHdl( aLink ); - m_pSelectionBtn->SetClickHdl( aLink ); - m_pMatchCaseCB->SetClickHdl( aLink ); - m_pRegExpBtn->SetClickHdl( aLink ); - m_pBackwardsBtn->SetClickHdl( aLink ); - m_pNotesBtn->SetClickHdl( aLink ); - m_pSimilarityBox->SetClickHdl( aLink ); - m_pJapOptionsCB->SetClickHdl( aLink ); - m_pJapMatchFullHalfWidthCB->SetClickHdl( aLink ); - m_pIgnoreDiacritics->SetClickHdl( aLink ); - m_pIgnoreKashida->SetClickHdl( aLink ); + Link<Button*,void> aLink2 = LINK( this, SvxSearchDialog, CommandHdl_Impl ); + m_pSearchBtn->SetClickHdl( aLink2 ); + m_pSearchAllBtn->SetClickHdl( aLink2 ); + m_pReplaceBtn->SetClickHdl( aLink2 ); + m_pReplaceAllBtn->SetClickHdl( aLink2 ); + m_pCloseBtn->SetClickHdl( aLink2 ); + m_pSimilarityBtn->SetClickHdl( aLink2 ); + m_pJapOptionsBtn->SetClickHdl( aLink2 ); + m_pSearchComponent1PB->SetClickHdl( aLink2 ); + m_pSearchComponent2PB->SetClickHdl( aLink2 ); + + aLink2 = LINK( this, SvxSearchDialog, FlagHdl_Impl ); + m_pWordBtn->SetClickHdl( aLink2 ); + m_pSelectionBtn->SetClickHdl( aLink2 ); + m_pMatchCaseCB->SetClickHdl( aLink2 ); + m_pRegExpBtn->SetClickHdl( aLink2 ); + m_pBackwardsBtn->SetClickHdl( aLink2 ); + m_pNotesBtn->SetClickHdl( aLink2 ); + m_pSimilarityBox->SetClickHdl( aLink2 ); + m_pJapOptionsCB->SetClickHdl( aLink2 ); + m_pJapMatchFullHalfWidthCB->SetClickHdl( aLink2 ); + m_pIgnoreDiacritics->SetClickHdl( aLink2 ); + m_pIgnoreKashida->SetClickHdl( aLink2 ); m_pLayoutBtn->SetClickHdl( LINK( this, SvxSearchDialog, TemplateHdl_Impl ) ); m_pFormatBtn->SetClickHdl( LINK( this, SvxSearchDialog, FormatHdl_Impl ) ); m_pNoFormatBtn->SetClickHdl( @@ -808,8 +808,8 @@ void SvxSearchDialog::Init_Impl( bool bSearchPattern ) if ( pSearchItem->GetAppFlag() == SvxSearchApp::CALC ) { m_pCalcGrid->Show(); - Link<> aLink = LINK( this, SvxSearchDialog, FlagHdl_Impl ); - m_pCalcSearchInLB->SetSelectHdl( aLink ); + Link<Button*,void> aLink = LINK( this, SvxSearchDialog, FlagHdl_Impl ); + m_pCalcSearchInLB->SetSelectHdl( LINK( this, SvxSearchDialog, LBSelectHdl_Impl ) ); m_pRowsBtn->SetClickHdl( aLink ); m_pColumnsBtn->SetClickHdl( aLink ); m_pAllSheetsCB->SetClickHdl( aLink ); @@ -1108,10 +1108,21 @@ void SvxSearchDialog::InitAttrList_Impl( const SfxItemSet* pSSet, -IMPL_LINK( SvxSearchDialog, FlagHdl_Impl, Control *, pCtrl ) +IMPL_LINK( SvxSearchDialog, LBSelectHdl_Impl, Control *, pCtrl ) +{ + ClickHdl_Impl(pCtrl); + return 0; +} + +IMPL_LINK_TYPED( SvxSearchDialog, FlagHdl_Impl, Button *, pCtrl, void ) +{ + ClickHdl_Impl(pCtrl); +} + +void SvxSearchDialog::ClickHdl_Impl(void* pCtrl) { if ( pCtrl && !bSet ) - SetModifyFlag_Impl( pCtrl ); + SetModifyFlag_Impl( static_cast<Control*>(pCtrl) ); else bSet = false; @@ -1207,13 +1218,13 @@ IMPL_LINK( SvxSearchDialog, FlagHdl_Impl, Control *, pCtrl ) } } - if (m_pAllSheetsCB == pCtrl) + if (pCtrl == m_pAllSheetsCB) { bSet = true; ModifyHdl_Impl(m_pSearchLB); } - if (m_pJapOptionsCB == pCtrl) + if (pCtrl == m_pJapOptionsCB) { bool bEnableJapOpt = m_pJapOptionsCB->IsChecked(); m_pMatchCaseCB->Enable(!bEnableJapOpt ); @@ -1223,12 +1234,11 @@ IMPL_LINK( SvxSearchDialog, FlagHdl_Impl, Control *, pCtrl ) if ( pImpl->bSaveToModule ) SaveToModule_Impl(); - return 0; } -IMPL_LINK( SvxSearchDialog, CommandHdl_Impl, Button *, pBtn ) +IMPL_LINK_TYPED( SvxSearchDialog, CommandHdl_Impl, Button *, pBtn, void ) { bool bInclusive = ( m_pLayoutBtn->GetText() == aLayoutStr ); @@ -1387,8 +1397,6 @@ IMPL_LINK( SvxSearchDialog, CommandHdl_Impl, Button *, pBtn ) pImpl->xCommand2Dispatch->dispatch(pImpl->aCommand2URL, aArgs); } } - - return 0; } @@ -1435,13 +1443,13 @@ IMPL_LINK( SvxSearchDialog, ModifyHdl_Impl, ComboBox *, pEd ) -IMPL_LINK_NOARG(SvxSearchDialog, TemplateHdl_Impl) +IMPL_LINK_NOARG_TYPED(SvxSearchDialog, TemplateHdl_Impl, Button*, void) { if ( pImpl->bSaveToModule ) SaveToModule_Impl(); if ( bFormat ) - return 0; + return; OUString sDesc; if ( m_pLayoutBtn->IsChecked() ) @@ -1518,7 +1526,6 @@ IMPL_LINK_NOARG(SvxSearchDialog, TemplateHdl_Impl) pImpl->bSaveToModule = false; FlagHdl_Impl(m_pLayoutBtn); pImpl->bSaveToModule = true; - return 0; } @@ -1880,14 +1887,14 @@ IMPL_LINK_NOARG(SvxSearchDialog, LoseFocusHdl_Impl) -IMPL_LINK_NOARG(SvxSearchDialog, FormatHdl_Impl) +IMPL_LINK_NOARG_TYPED(SvxSearchDialog, FormatHdl_Impl, Button*, void) { SfxObjectShell* pSh = SfxObjectShell::Current(); DBG_ASSERT( pSh, "no DocShell" ); if ( !pSh || !pImpl->pRanges ) - return 0; + return; sal_sSize nCnt = 0; const sal_uInt16* pPtr = pImpl->pRanges; @@ -1968,12 +1975,11 @@ IMPL_LINK_NOARG(SvxSearchDialog, FormatHdl_Impl) PaintAttrText_Impl(); // Set AttributText in GroupBox } } - return 0; } -IMPL_LINK_NOARG(SvxSearchDialog, NoFormatHdl_Impl) +IMPL_LINK_NOARG_TYPED(SvxSearchDialog, NoFormatHdl_Impl, Button*, void) { SvtModuleOptions::EFactory eFactory = getModule(rBindings); bool bWriterApp = @@ -2009,15 +2015,14 @@ IMPL_LINK_NOARG(SvxSearchDialog, NoFormatHdl_Impl) TemplateHdl_Impl(m_pLayoutBtn); pImpl->bSaveToModule = true; m_pNoFormatBtn->Disable(); - return 0; } -IMPL_LINK_NOARG(SvxSearchDialog, AttributeHdl_Impl) +IMPL_LINK_NOARG_TYPED(SvxSearchDialog, AttributeHdl_Impl, Button*, void) { if ( !pSearchList || !pImpl->pRanges ) - return 0; + return; SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); if(pFact) @@ -2027,7 +2032,6 @@ IMPL_LINK_NOARG(SvxSearchDialog, AttributeHdl_Impl) pDlg->Execute(); } PaintAttrText_Impl(); - return 0; } diff --git a/svx/source/engine3d/float3d.cxx b/svx/source/engine3d/float3d.cxx index 069e7a3e34e6..a18f2ac68eb6 100644 --- a/svx/source/engine3d/float3d.cxx +++ b/svx/source/engine3d/float3d.cxx @@ -219,7 +219,7 @@ Svx3DWin::Svx3DWin(SfxBindings* pInBindings, SfxChildWindow *pCW, vcl::Window* p m_pBtnAssign->SetClickHdl( LINK( this, Svx3DWin, ClickAssignHdl ) ); m_pBtnUpdate->SetClickHdl( LINK( this, Svx3DWin, ClickUpdateHdl ) ); - Link<> aLink( LINK( this, Svx3DWin, ClickViewTypeHdl ) ); + Link<Button*,void> aLink( LINK( this, Svx3DWin, ClickViewTypeHdl ) ); m_pBtnGeo->SetClickHdl( aLink ); m_pBtnRepresentation->SetClickHdl( aLink ); m_pBtnLight->SetClickHdl( aLink ); @@ -274,31 +274,31 @@ Svx3DWin::Svx3DWin(SfxBindings* pInBindings, SfxChildWindow *pCW, vcl::Window* p m_pBtnSpecularColor->SetClickHdl( aLink ); - aLink = LINK( this, Svx3DWin, SelectHdl ); - m_pLbMatFavorites->SetSelectHdl( aLink ); - m_pLbMatColor->SetSelectHdl( aLink ); - m_pLbMatEmission->SetSelectHdl( aLink ); - m_pLbMatSpecular->SetSelectHdl( aLink ); - m_pLbLight1->SetSelectHdl( aLink ); - m_pLbLight2->SetSelectHdl( aLink ); - m_pLbLight3->SetSelectHdl( aLink ); - m_pLbLight4->SetSelectHdl( aLink ); - m_pLbLight5->SetSelectHdl( aLink ); - m_pLbLight6->SetSelectHdl( aLink ); - m_pLbLight7->SetSelectHdl( aLink ); - m_pLbLight8->SetSelectHdl( aLink ); - m_pLbAmbientlight->SetSelectHdl( aLink ); - m_pLbShademode->SetSelectHdl( aLink ); - - aLink = LINK( this, Svx3DWin, ModifyHdl ); - m_pMtrMatSpecularIntensity->SetModifyHdl( aLink ); - m_pNumHorizontal->SetModifyHdl( aLink ); - m_pNumVertical->SetModifyHdl( aLink ); - m_pMtrSlant->SetModifyHdl( aLink ); + Link<> aLink2 = LINK( this, Svx3DWin, SelectHdl ); + m_pLbMatFavorites->SetSelectHdl( aLink2 ); + m_pLbMatColor->SetSelectHdl( aLink2 ); + m_pLbMatEmission->SetSelectHdl( aLink2 ); + m_pLbMatSpecular->SetSelectHdl( aLink2 ); + m_pLbLight1->SetSelectHdl( aLink2 ); + m_pLbLight2->SetSelectHdl( aLink2 ); + m_pLbLight3->SetSelectHdl( aLink2 ); + m_pLbLight4->SetSelectHdl( aLink2 ); + m_pLbLight5->SetSelectHdl( aLink2 ); + m_pLbLight6->SetSelectHdl( aLink2 ); + m_pLbLight7->SetSelectHdl( aLink2 ); + m_pLbLight8->SetSelectHdl( aLink2 ); + m_pLbAmbientlight->SetSelectHdl( aLink2 ); + m_pLbShademode->SetSelectHdl( aLink2 ); + + aLink2 = LINK( this, Svx3DWin, ModifyHdl ); + m_pMtrMatSpecularIntensity->SetModifyHdl( aLink2 ); + m_pNumHorizontal->SetModifyHdl( aLink2 ); + m_pNumVertical->SetModifyHdl( aLink2 ); + m_pMtrSlant->SetModifyHdl( aLink2 ); // Preview callback - aLink = LINK( this, Svx3DWin, ChangeSelectionCallbackHdl ); - m_pCtlLightPreview->SetUserSelectionChangeCallback(aLink); + aLink2 = LINK( this, Svx3DWin, ChangeSelectionCallbackHdl ); + m_pCtlLightPreview->SetUserSelectionChangeCallback(aLink2); aSize = GetOutputSizePixel(); SetMinOutputSizePixel( aSize ); @@ -356,7 +356,7 @@ void Svx3DWin::dispose() void Svx3DWin::Construct() { m_pBtnGeo->Check(); - Link<> aLink( LINK( this, Svx3DWin, ClickViewTypeHdl ) ); + Link<Button*,void> aLink( LINK( this, Svx3DWin, ClickViewTypeHdl ) ); aLink.Call(m_pBtnGeo); m_pCtlLightPreview->Hide(); } @@ -2141,7 +2141,7 @@ void Svx3DWin::Resize() SfxDockingWindow::Resize(); } -IMPL_LINK_NOARG(Svx3DWin, ClickUpdateHdl) +IMPL_LINK_NOARG_TYPED(Svx3DWin, ClickUpdateHdl, Button*, void) { bUpdate = !m_pBtnUpdate->IsChecked(); m_pBtnUpdate->Check( bUpdate ); @@ -2160,12 +2160,10 @@ IMPL_LINK_NOARG(Svx3DWin, ClickUpdateHdl) { // Controls can be disabled during certain circumstances } - - return 0L; } -IMPL_LINK_NOARG(Svx3DWin, ClickAssignHdl) +IMPL_LINK_NOARG_TYPED(Svx3DWin, ClickAssignHdl, Button*, void) { SfxDispatcher* pDispatcher = LocalGetDispatcher(pBindings); if (pDispatcher != NULL) @@ -2174,13 +2172,11 @@ IMPL_LINK_NOARG(Svx3DWin, ClickAssignHdl) pDispatcher->Execute( SID_3D_ASSIGN, SfxCallMode::ASYNCHRON | SfxCallMode::RECORD, &aItem, 0L ); } - - return 0L; } -IMPL_LINK( Svx3DWin, ClickViewTypeHdl, void *, pBtn ) +IMPL_LINK_TYPED( Svx3DWin, ClickViewTypeHdl, Button*, pBtn, void ) { if( pBtn ) @@ -2285,12 +2281,12 @@ IMPL_LINK( Svx3DWin, ClickViewTypeHdl, void *, pBtn ) m_pBtnTexture->Check( eViewType == VIEWTYPE_TEXTURE ); m_pBtnMaterial->Check( eViewType == VIEWTYPE_MATERIAL ); } - return 0L; } -IMPL_LINK( Svx3DWin, ClickHdl, PushButton *, pBtn ) +IMPL_LINK_TYPED( Svx3DWin, ClickHdl, Button *, pButton, void ) { + PushButton* pBtn = static_cast<PushButton*>(pButton); if( pBtn ) { bool bUpdatePreview = false; @@ -2443,12 +2439,11 @@ IMPL_LINK( Svx3DWin, ClickHdl, PushButton *, pBtn ) else if( bUpdatePreview ) UpdatePreview(); } - return 0L; } -IMPL_LINK( Svx3DWin, ClickColorHdl, PushButton *, pBtn ) +IMPL_LINK_TYPED( Svx3DWin, ClickColorHdl, Button *, pBtn, void) { SvColorDialog aColorDlg( this ); ColorLB* pLb; @@ -2473,7 +2468,6 @@ IMPL_LINK( Svx3DWin, ClickColorHdl, PushButton *, pBtn ) if( LBSelectColor( pLb, aColor ) ) SelectHdl( pLb ); } - return 0L; } diff --git a/svx/source/fmcomp/gridctrl.cxx b/svx/source/fmcomp/gridctrl.cxx index 5f986986b099..b4d305da16d2 100644 --- a/svx/source/fmcomp/gridctrl.cxx +++ b/svx/source/fmcomp/gridctrl.cxx @@ -500,7 +500,7 @@ sal_uInt16 DbGridControl::NavigationBar::ArrangeControls() return nX; } -IMPL_LINK(DbGridControl::NavigationBar, OnClick, Button *, pButton ) +IMPL_LINK_TYPED(DbGridControl::NavigationBar, OnClick, Button *, pButton, void ) { DbGridControl* pParent = static_cast<DbGridControl*>(GetParent()); @@ -520,7 +520,7 @@ IMPL_LINK(DbGridControl::NavigationBar, OnClick, Button *, pButton ) if (lResult) // the link already handled it - return 0; + return; } if (pButton == m_aFirstBtn.get()) @@ -533,7 +533,6 @@ IMPL_LINK(DbGridControl::NavigationBar, OnClick, Button *, pButton ) pParent->MoveToLast(); else if( pButton == m_aNewBtn.get() ) pParent->AppendNew(); - return 0; } void DbGridControl::NavigationBar::InvalidateAll(sal_Int32 nCurrentPos, bool bAll) diff --git a/svx/source/form/datanavi.cxx b/svx/source/form/datanavi.cxx index f1cdfbb47f53..164805583556 100644 --- a/svx/source/form/datanavi.cxx +++ b/svx/source/form/datanavi.cxx @@ -2351,8 +2351,9 @@ namespace svxform } - IMPL_LINK( AddDataItemDialog, CheckHdl, CheckBox *, pBox ) + IMPL_LINK_TYPED( AddDataItemDialog, CheckHdl, Button *, pButton, void ) { + CheckBox* pBox = static_cast<CheckBox*>(pButton); // Condition buttons are only enable if their check box is checked m_pReadonlyBtn->Enable( m_pReadonlyCB->IsChecked() ); m_pRequiredBtn->Enable( m_pRequiredCB->IsChecked() ); @@ -2381,13 +2382,12 @@ namespace svxform sTemp.clear(); m_xTempBinding->setPropertyValue( sPropName, makeAny( sTemp ) ); } - - return 0; } - IMPL_LINK( AddDataItemDialog, ConditionHdl, PushButton *, pBtn ) + IMPL_LINK_TYPED( AddDataItemDialog, ConditionHdl, Button *, pButton, void ) { + PushButton* pBtn = static_cast<PushButton*>(pButton); OUString sTemp, sPropName; if ( m_pDefaultBtn == pBtn ) sPropName = PN_BINDING_EXPR; @@ -2427,7 +2427,6 @@ namespace svxform sPropName, makeAny( OUString( sNewCondition ) ) ); } } - return 0; } void copyPropSet( const Reference< XPropertySet >& xFrom, Reference< XPropertySet >& xTo ) @@ -2465,7 +2464,7 @@ namespace svxform } - IMPL_LINK_NOARG(AddDataItemDialog, OKHdl) + IMPL_LINK_NOARG_TYPED(AddDataItemDialog, OKHdl, Button*, void) { bool bIsHandleBinding = ( DITBinding == m_eItemType ); bool bIsHandleText = ( DITText == m_eItemType ); @@ -2478,7 +2477,7 @@ namespace svxform ScopedVclPtrInstance< MessageDialog > aErrBox( this, SVX_RES( RID_STR_INVALID_XMLNAME ) ); aErrBox->set_primary_text(aErrBox->get_primary_text().replaceFirst(MSG_VARIABLE, sNewName)); aErrBox->Execute(); - return 0; + return; } OUString sDataType( m_pDataTypeLB->GetSelectEntry() ); @@ -2523,14 +2522,13 @@ namespace svxform } // then close the dialog EndDialog( RET_OK ); - return 0; } void AddDataItemDialog::InitDialog() { // set handler - Link<> aLink = LINK( this, AddDataItemDialog, CheckHdl ); + Link<Button*,void> aLink = LINK( this, AddDataItemDialog, CheckHdl ); m_pRequiredCB->SetClickHdl( aLink ); m_pRelevantCB->SetClickHdl( aLink ); m_pConstraintCB->SetClickHdl( aLink ); @@ -2830,7 +2828,7 @@ namespace svxform ModalDialog::dispose(); } - IMPL_LINK_NOARG(AddConditionDialog, EditHdl) + IMPL_LINK_NOARG_TYPED(AddConditionDialog, EditHdl, Button*, void) { Reference< XNameContainer > xNameContnr; try @@ -2851,11 +2849,10 @@ namespace svxform { SAL_WARN( "svx.form", "AddDataItemDialog::EditHdl(): exception caught" ); } - return 0; } - IMPL_LINK_NOARG(AddConditionDialog, OKHdl) + IMPL_LINK_NOARG_TYPED(AddConditionDialog, OKHdl, Button*, void) { /*!!! try @@ -2869,7 +2866,6 @@ namespace svxform } */ EndDialog( RET_OK ); - return 0; } @@ -2928,7 +2924,7 @@ namespace svxform sHeader, HEADERBAR_APPEND, HeaderBarItemBits::LEFT /*| HeaderBarItemBits::FIXEDPOS | HeaderBarItemBits::FIXED*/ ); m_pNamespacesList->SetSelectHdl( LINK( this, NamespaceItemDialog, SelectHdl ) ); - Link<> aLink = LINK( this, NamespaceItemDialog, ClickHdl ); + Link<Button*,void> aLink = LINK( this, NamespaceItemDialog, ClickHdl ); m_pAddNamespaceBtn->SetClickHdl( aLink ); m_pEditNamespaceBtn->SetClickHdl( aLink ); m_pDeleteNamespaceBtn->SetClickHdl( aLink ); @@ -2966,8 +2962,9 @@ namespace svxform } - IMPL_LINK( NamespaceItemDialog, ClickHdl, PushButton *, pBtn ) + IMPL_LINK_TYPED( NamespaceItemDialog, ClickHdl, Button *, pButton, void ) { + PushButton* pBtn = static_cast<PushButton*>(pButton); if ( m_pAddNamespaceBtn == pBtn ) { ScopedVclPtrInstance< ManageNamespaceDialog > aDlg(this, m_pConditionDlg, false); @@ -3012,11 +3009,10 @@ namespace svxform } SelectHdl( m_pNamespacesList ); - return 0; } - IMPL_LINK_NOARG(NamespaceItemDialog, OKHdl) + IMPL_LINK_NOARG_TYPED(NamespaceItemDialog, OKHdl, Button*, void) { try { @@ -3044,7 +3040,6 @@ namespace svxform } // and close the dialog EndDialog( RET_OK ); - return 0; } @@ -3107,7 +3102,7 @@ namespace svxform ModalDialog::dispose(); } - IMPL_LINK_NOARG(ManageNamespaceDialog, OKHdl) + IMPL_LINK_NOARG_TYPED(ManageNamespaceDialog, OKHdl, Button*, void) { OUString sPrefix = m_pPrefixED->GetText(); @@ -3118,7 +3113,7 @@ namespace svxform ScopedVclPtrInstance< MessageDialog > aErrBox(this, SVX_RES( RID_STR_INVALID_XMLPREFIX ) ); aErrBox->set_primary_text(aErrBox->get_primary_text().replaceFirst(MSG_VARIABLE, sPrefix)); aErrBox->Execute(); - return 0; + return; } } catch ( Exception& ) @@ -3128,7 +3123,6 @@ namespace svxform // no error so close the dialog EndDialog( RET_OK ); - return 0; } AddSubmissionDialog::AddSubmissionDialog( @@ -3176,18 +3170,16 @@ namespace svxform } - IMPL_LINK_NOARG(AddSubmissionDialog, RefHdl) + IMPL_LINK_NOARG_TYPED(AddSubmissionDialog, RefHdl, Button*, void) { ScopedVclPtrInstance< AddConditionDialog > aDlg(this, PN_BINDING_EXPR, m_xTempBinding ); aDlg->SetCondition( m_pRefED->GetText() ); if ( aDlg->Execute() == RET_OK ) m_pRefED->SetText( aDlg->GetCondition() ); - - return 0; } - IMPL_LINK_NOARG(AddSubmissionDialog, OKHdl) + IMPL_LINK_NOARG_TYPED(AddSubmissionDialog, OKHdl, Button*, void) { OUString sName(m_pNameED->GetText()); if(sName.isEmpty()) { @@ -3195,7 +3187,7 @@ namespace svxform ScopedVclPtrInstance< MessageDialog > aErrorBox(this,SVX_RES(RID_STR_EMPTY_SUBMISSIONNAME)); aErrorBox->set_primary_text( Application::GetDisplayName() ); aErrorBox->Execute(); - return 0; + return; } if ( !m_xSubmission.is() ) @@ -3247,7 +3239,6 @@ namespace svxform } EndDialog( RET_OK ); - return 0; } @@ -3419,7 +3410,7 @@ namespace svxform ModalDialog::dispose(); } - IMPL_LINK_NOARG(AddInstanceDialog, FilePickerHdl) + IMPL_LINK_NOARG_TYPED(AddInstanceDialog, FilePickerHdl, Button*, void) { ::sfx2::FileDialogHelper aDlg( css::ui::dialogs::TemplateDescription::FILEOPEN_SIMPLE, 0 ); @@ -3433,8 +3424,6 @@ namespace svxform if( aDlg.Execute() == ERRCODE_NONE ) m_pURLED->SetText( aDlg.GetPath() ); - - return 0; } LinkedInstanceWarningBox::LinkedInstanceWarningBox( vcl::Window* pParent ) diff --git a/svx/source/gallery2/galbrws1.cxx b/svx/source/gallery2/galbrws1.cxx index 53faca310e74..6e0a1a304b27 100644 --- a/svx/source/gallery2/galbrws1.cxx +++ b/svx/source/gallery2/galbrws1.cxx @@ -623,7 +623,7 @@ IMPL_LINK_NOARG(GalleryBrowser1, SelectThemeHdl) return 0L; } -IMPL_LINK_NOARG(GalleryBrowser1, ClickNewThemeHdl) +IMPL_LINK_NOARG_TYPED(GalleryBrowser1, ClickNewThemeHdl, Button*, void) { OUString aNewTheme( GAL_RESSTR(RID_SVXSTR_GALLERY_NEWTHEME) ); OUString aName( aNewTheme ); @@ -640,8 +640,6 @@ IMPL_LINK_NOARG(GalleryBrowser1, ClickNewThemeHdl) { ImplGalleryThemeProperties( aName, true ); } - - return 0L; } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/source/gallery2/galbrws1.hxx b/svx/source/gallery2/galbrws1.hxx index 2a35853696ac..cc8f2490f1f3 100644 --- a/svx/source/gallery2/galbrws1.hxx +++ b/svx/source/gallery2/galbrws1.hxx @@ -109,7 +109,7 @@ private: // SfxListener virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) SAL_OVERRIDE; - DECL_LINK( ClickNewThemeHdl, void* ); + DECL_LINK_TYPED( ClickNewThemeHdl, Button*, void ); DECL_LINK( SelectThemeHdl, void* ); DECL_LINK( ShowContextMenuHdl, void* ); DECL_LINK( PopupMenuHdl, Menu* ); diff --git a/svx/source/inc/datanavi.hxx b/svx/source/inc/datanavi.hxx index b2562e023659..88e8d7d4cf16 100644 --- a/svx/source/inc/datanavi.hxx +++ b/svx/source/inc/datanavi.hxx @@ -459,9 +459,9 @@ namespace svxform OUString m_sFL_Binding; OUString m_sFT_BindingExp; - DECL_LINK( CheckHdl, CheckBox * ); - DECL_LINK( ConditionHdl, PushButton * ); - DECL_LINK(OKHdl, void *); + DECL_LINK_TYPED( CheckHdl, Button*, void ); + DECL_LINK_TYPED( ConditionHdl, Button*, void ); + DECL_LINK_TYPED( OKHdl, Button*, void); void InitDialog(); void InitFromNode(); @@ -493,8 +493,8 @@ namespace svxform DECL_LINK(ModifyHdl, void *); DECL_LINK_TYPED(ResultHdl, Idle *, void); - DECL_LINK(EditHdl, void *); - DECL_LINK(OKHdl, void *); + DECL_LINK_TYPED(EditHdl, Button*, void); + DECL_LINK_TYPED(OKHdl, Button*, void); public: AddConditionDialog(vcl::Window* pParent, @@ -529,8 +529,8 @@ namespace svxform XNameContainer_ref& m_rNamespaces; DECL_LINK( SelectHdl, SvSimpleTable * ); - DECL_LINK( ClickHdl, PushButton * ); - DECL_LINK(OKHdl, void *); + DECL_LINK_TYPED( ClickHdl, Button*, void ); + DECL_LINK_TYPED( OKHdl, Button*, void); void LoadNamespaces(); @@ -550,7 +550,7 @@ namespace svxform VclPtr<AddConditionDialog> m_pConditionDlg; - DECL_LINK(OKHdl, void *); + DECL_LINK_TYPED(OKHdl, Button*, void); public: ManageNamespaceDialog(vcl::Window* pParent, AddConditionDialog* _pCondDlg, bool bIsEdit); @@ -591,8 +591,8 @@ namespace svxform XPropertySet_ref m_xTempBinding; XPropertySet_ref m_xCreatedBinding; - DECL_LINK(RefHdl, void *); - DECL_LINK(OKHdl, void *); + DECL_LINK_TYPED(RefHdl, Button*, void); + DECL_LINK_TYPED(OKHdl, Button*, void); void FillAllBoxes(); @@ -636,7 +636,7 @@ namespace svxform OUString m_sAllFilterName; - DECL_LINK(FilePickerHdl, void *); + DECL_LINK_TYPED(FilePickerHdl, Button*, void); public: AddInstanceDialog( vcl::Window* pParent, bool _bEdit ); diff --git a/svx/source/inc/docrecovery.hxx b/svx/source/inc/docrecovery.hxx index 47c425856e40..1cd3ba4dacfc 100644 --- a/svx/source/inc/docrecovery.hxx +++ b/svx/source/inc/docrecovery.hxx @@ -396,7 +396,7 @@ class SaveDialog : public Dialog virtual ~SaveDialog(); virtual void dispose() SAL_OVERRIDE; - DECL_LINK(OKButtonHdl, void*); + DECL_LINK_TYPED(OKButtonHdl, Button*, void); }; class SaveProgressDialog : public ModalDialog @@ -544,8 +544,8 @@ class RecoveryDialog : public Dialog // helper private: /** @short TODO */ - DECL_LINK(NextButtonHdl, void*); - DECL_LINK(CancelButtonHdl, void*); + DECL_LINK_TYPED(NextButtonHdl, Button*, void); + DECL_LINK_TYPED(CancelButtonHdl, Button*, void); /** @short TODO */ @@ -599,15 +599,15 @@ class BrokenRecoveryDialog : public ModalDialog /** @short TODO */ - DECL_LINK(SaveButtonHdl, void*); + DECL_LINK_TYPED(SaveButtonHdl, Button*, void); /** @short TODO */ - DECL_LINK(OkButtonHdl, void*); + DECL_LINK_TYPED(OkButtonHdl, Button*, void); /** @short TODO */ - DECL_LINK(CancelButtonHdl, void*); + DECL_LINK_TYPED(CancelButtonHdl, Button*, void); /** @short TODO */ diff --git a/svx/source/sidebar/paragraph/ParaLineSpacingControl.cxx b/svx/source/sidebar/paragraph/ParaLineSpacingControl.cxx index ff514d95b4b4..8fa15c13bf0f 100644 --- a/svx/source/sidebar/paragraph/ParaLineSpacingControl.cxx +++ b/svx/source/sidebar/paragraph/ParaLineSpacingControl.cxx @@ -66,19 +66,19 @@ ParaLineSpacingControl::ParaLineSpacingControl(sal_uInt16 nId) meLNSpaceUnit = SFX_MAPUNIT_100TH_MM; - Link<> aLink = LINK(this, ParaLineSpacingControl, PredefinedValuesHandler); + Link<Button*,void> aLink = LINK(this, ParaLineSpacingControl, PredefinedValuesHandler); mpSpacing1Button->SetClickHdl(aLink); mpSpacing115Button->SetClickHdl(aLink); mpSpacing15Button->SetClickHdl(aLink); mpSpacing2Button->SetClickHdl(aLink); - aLink = LINK( this, ParaLineSpacingControl, LineSPDistHdl_Impl ); - mpLineDist->SetSelectHdl(aLink); + Link<> aLink2 = LINK( this, ParaLineSpacingControl, LineSPDistHdl_Impl ); + mpLineDist->SetSelectHdl(aLink2); SelectEntryPos(LLINESPACE_1); - aLink = LINK( this, ParaLineSpacingControl, LineSPDistAtHdl_Impl ); - mpLineDistAtPercentBox->SetModifyHdl( aLink ); - mpLineDistAtMetricBox->SetModifyHdl( aLink ); + aLink2 = LINK( this, ParaLineSpacingControl, LineSPDistAtHdl_Impl ); + mpLineDistAtPercentBox->SetModifyHdl( aLink2 ); + mpLineDistAtMetricBox->SetModifyHdl( aLink2 ); FieldUnit eUnit = FUNIT_INCH; const SfxPoolItem* pItem = NULL; @@ -409,7 +409,7 @@ void ParaLineSpacingControl::SetLineSpace(SvxLineSpacingItem& rLineSpace, int eS } } -IMPL_LINK(ParaLineSpacingControl, PredefinedValuesHandler, void *, pControl) +IMPL_LINK_TYPED(ParaLineSpacingControl, PredefinedValuesHandler, Button*, pControl, void) { if (pControl == mpSpacing1Button) { @@ -427,8 +427,6 @@ IMPL_LINK(ParaLineSpacingControl, PredefinedValuesHandler, void *, pControl) { ExecuteLineSpacing(LLINESPACE_2); } - - return 0; } void ParaLineSpacingControl::ExecuteLineSpacing(sal_uInt16 nEntry) diff --git a/svx/source/sidebar/paragraph/ParaLineSpacingControl.hxx b/svx/source/sidebar/paragraph/ParaLineSpacingControl.hxx index b3d04e538338..da9c3d98493a 100644 --- a/svx/source/sidebar/paragraph/ParaLineSpacingControl.hxx +++ b/svx/source/sidebar/paragraph/ParaLineSpacingControl.hxx @@ -23,6 +23,7 @@ #include <sfx2/tbxctrl.hxx> class SvxLineSpacingItem; +class Button; namespace svx { @@ -70,7 +71,7 @@ private: DECL_LINK(LineSPDistHdl_Impl, ListBox*); DECL_LINK(LineSPDistAtHdl_Impl, void*); - DECL_LINK(PredefinedValuesHandler, void*); + DECL_LINK_TYPED(PredefinedValuesHandler, Button*, void); }; } diff --git a/svx/source/sidebar/possize/PosSizePropertyPanel.cxx b/svx/source/sidebar/possize/PosSizePropertyPanel.cxx index a4a40a5b6b77..80ebaaedf01c 100644 --- a/svx/source/sidebar/possize/PosSizePropertyPanel.cxx +++ b/svx/source/sidebar/possize/PosSizePropertyPanel.cxx @@ -472,7 +472,7 @@ IMPL_LINK_NOARG( PosSizePropertyPanel, ChangePosYHdl ) -IMPL_LINK_NOARG( PosSizePropertyPanel, ClickAutoHdl ) +IMPL_LINK_NOARG_TYPED( PosSizePropertyPanel, ClickAutoHdl, Button*, void ) { if ( mpCbxScale->IsChecked() ) { @@ -483,8 +483,6 @@ IMPL_LINK_NOARG( PosSizePropertyPanel, ClickAutoHdl ) // mpCbxScale must synchronized with that on Position and Size tabpage on Shape Properties dialog SvtViewOptions aPageOpt(E_TABPAGE, "cui/ui/possizetabpage/PositionAndSize"); aPageOpt.SetUserItem( USERITEM_NAME, ::com::sun::star::uno::makeAny( ::rtl::OUString::number( int(mpCbxScale->IsChecked()) ) ) ); - - return 0; } diff --git a/svx/source/sidebar/possize/PosSizePropertyPanel.hxx b/svx/source/sidebar/possize/PosSizePropertyPanel.hxx index d315c6cf3469..875eae75f373 100644 --- a/svx/source/sidebar/possize/PosSizePropertyPanel.hxx +++ b/svx/source/sidebar/possize/PosSizePropertyPanel.hxx @@ -153,7 +153,7 @@ private: DECL_LINK( ChangePosYHdl, void * ); DECL_LINK( ChangeWidthHdl, void * ); DECL_LINK( ChangeHeightHdl, void * ); - DECL_LINK( ClickAutoHdl, void * ); + DECL_LINK_TYPED( ClickAutoHdl, Button*, void ); DECL_LINK( AngleModifiedHdl, void * ); DECL_LINK( RotationHdl, void * ); DECL_LINK_TYPED( FlipHdl, ToolBox *, void ); diff --git a/svx/source/sidebar/shadow/ShadowPropertyPanel.cxx b/svx/source/sidebar/shadow/ShadowPropertyPanel.cxx index a4bb8e122a36..31e5b33050be 100644 --- a/svx/source/sidebar/shadow/ShadowPropertyPanel.cxx +++ b/svx/source/sidebar/shadow/ShadowPropertyPanel.cxx @@ -123,8 +123,7 @@ void ShadowPropertyPanel::Initialize() pColorList = static_cast<const SvxColorListItem*>(pItem) ->GetColorList(); mpLBShadowColor->Fill(pColorList); mpShowShadow->SetState( TRISTATE_FALSE ); - Link<> bLink = LINK(this, ShadowPropertyPanel, ClickShadowHdl ); - mpShowShadow->SetClickHdl( bLink ); + mpShowShadow->SetClickHdl( LINK(this, ShadowPropertyPanel, ClickShadowHdl ) ); Link<> aLink = LINK( this, ShadowPropertyPanel, ModifyShadowColorHdl ); mpShadowTransMetric->SetModifyHdl( LINK(this, ShadowPropertyPanel, ModifyShadowTransMetricHdl) ); mpLBShadowColor->SetSelectHdl( aLink ); @@ -137,21 +136,18 @@ void ShadowPropertyPanel::Initialize() InsertAngleValues(); } -IMPL_LINK_NOARG(ShadowPropertyPanel, ClickShadowHdl) +IMPL_LINK_NOARG_TYPED(ShadowPropertyPanel, ClickShadowHdl, Button*, void) { if( mpShowShadow->GetState() == TRISTATE_FALSE ) { SdrOnOffItem aItem(makeSdrShadowItem(false)); GetBindings()->GetDispatcher()->Execute(SID_ATTR_FILL_SHADOW, SfxCallMode::RECORD, &aItem, 0L); } - else { SdrOnOffItem aItem(makeSdrShadowItem(true)); GetBindings()->GetDispatcher()->Execute(SID_ATTR_FILL_SHADOW, SfxCallMode::RECORD, &aItem, 0L); } - - return 0L; } IMPL_LINK_NOARG(ShadowPropertyPanel, ModifyShadowColorHdl) diff --git a/svx/source/sidebar/shadow/ShadowPropertyPanel.hxx b/svx/source/sidebar/shadow/ShadowPropertyPanel.hxx index 510f2489ed53..2ae22e1d39ad 100644 --- a/svx/source/sidebar/shadow/ShadowPropertyPanel.hxx +++ b/svx/source/sidebar/shadow/ShadowPropertyPanel.hxx @@ -81,7 +81,7 @@ private: void InsertAngleValues(); void SetTransparencyValue(long); void UpdateControls(); - DECL_LINK(ClickShadowHdl, void*); + DECL_LINK_TYPED(ClickShadowHdl, Button*, void); DECL_LINK(ModifyShadowColorHdl, void*); DECL_LINK(ModifyShadowTransMetricHdl, void*); DECL_LINK(ModifyShadowDistanceHdl, void*); diff --git a/svx/source/sidebar/text/TextUnderlineControl.cxx b/svx/source/sidebar/text/TextUnderlineControl.cxx index fc7362f53f39..6acfd14a7bde 100644 --- a/svx/source/sidebar/text/TextUnderlineControl.cxx +++ b/svx/source/sidebar/text/TextUnderlineControl.cxx @@ -86,7 +86,7 @@ void TextUnderlineControl::initial() GetSettings().GetStyleSettings().GetMenuColor() : sfx2::sidebar::Theme::GetColor( sfx2::sidebar::Theme::Paint_PanelBackground )); - Link<> aLink = LINK( this, TextUnderlineControl, PBClickHdl ) ; + Link<Button*,void> aLink = LINK( this, TextUnderlineControl, PBClickHdl ) ; maPBOptions->SetClickHdl(aLink); maVSUnderline->SetStyle( maVSUnderline->GetStyle()| WB_3DLOOK | WB_NO_DIRECTSELECT ); @@ -126,8 +126,8 @@ void TextUnderlineControl::initial() maVSUnderline->SetItemData(10, reinterpret_cast<void*>(UNDERLINE_WAVE)); maVSUnderline->SetColCount(); - aLink = LINK( this, TextUnderlineControl, VSSelectHdl ) ; - maVSUnderline->SetSelectHdl(aLink); + Link<> aLink2 = LINK( this, TextUnderlineControl, VSSelectHdl ) ; + maVSUnderline->SetSelectHdl(aLink2); maVSUnderline->StartSelection(); maVSUnderline->Show(); @@ -228,7 +228,7 @@ IMPL_LINK(TextUnderlineControl, VSSelectHdl, void *, pControl) return 0L; } -IMPL_LINK(TextUnderlineControl, PBClickHdl, PushButton *, pPBtn) +IMPL_LINK_TYPED(TextUnderlineControl, PBClickHdl, Button *, pPBtn, void) { if(pPBtn == maPBOptions.get()) { @@ -239,7 +239,6 @@ IMPL_LINK(TextUnderlineControl, PBClickHdl, PushButton *, pPBtn) } mrTextPropertyPanel.EndUnderlinePopupMode(); } - return 0; } }} diff --git a/svx/source/sidebar/text/TextUnderlineControl.hxx b/svx/source/sidebar/text/TextUnderlineControl.hxx index 441e15798eda..4c0f124d7ed0 100644 --- a/svx/source/sidebar/text/TextUnderlineControl.hxx +++ b/svx/source/sidebar/text/TextUnderlineControl.hxx @@ -70,7 +70,7 @@ private: void initial(); - DECL_LINK( PBClickHdl, PushButton *); + DECL_LINK_TYPED( PBClickHdl, Button*, void); DECL_LINK(VSSelectHdl, void *); }; }} diff --git a/svx/source/tbxctrls/colorwindow.hxx b/svx/source/tbxctrls/colorwindow.hxx index 9cb27fdf4c9d..82df5e198bb0 100644 --- a/svx/source/tbxctrls/colorwindow.hxx +++ b/svx/source/tbxctrls/colorwindow.hxx @@ -56,8 +56,8 @@ private: DECL_LINK( SelectHdl, SvxColorValueSet* ); DECL_LINK( SelectPaletteHdl, void *); - DECL_LINK( AutoColorClickHdl, void * ); - DECL_LINK( OpenPickerClickHdl, void * ); + DECL_LINK_TYPED( AutoColorClickHdl, Button*, void ); + DECL_LINK_TYPED( OpenPickerClickHdl, Button*, void ); protected: virtual void Resize() SAL_OVERRIDE; diff --git a/svx/source/tbxctrls/fontworkgallery.cxx b/svx/source/tbxctrls/fontworkgallery.cxx index aefc47d6776b..8e3cb432f887 100644 --- a/svx/source/tbxctrls/fontworkgallery.cxx +++ b/svx/source/tbxctrls/fontworkgallery.cxx @@ -241,11 +241,10 @@ void FontWorkGalleryDialog::insertSelectedFontwork() -IMPL_LINK_NOARG(FontWorkGalleryDialog, ClickOKHdl) +IMPL_LINK_NOARG_TYPED(FontWorkGalleryDialog, ClickOKHdl, Button*, void) { insertSelectedFontwork(); EndDialog( RET_OK ); - return 0; } diff --git a/svx/source/tbxctrls/layctrl.cxx b/svx/source/tbxctrls/layctrl.cxx index 96edbf0932d3..bfa401734dd8 100644 --- a/svx/source/tbxctrls/layctrl.cxx +++ b/svx/source/tbxctrls/layctrl.cxx @@ -69,7 +69,7 @@ private: long mnTableWidth; long mnTableHeight; - DECL_LINK( SelectHdl, void * ); + DECL_LINK_TYPED( SelectHdl, Button*, void ); public: TableWindow( sal_uInt16 nSlotId, @@ -96,10 +96,9 @@ const long TableWindow::TABLE_CELLS_VERT = 15; -IMPL_LINK_NOARG(TableWindow, SelectHdl) +IMPL_LINK_NOARG_TYPED(TableWindow, SelectHdl, Button*, void) { CloseAndShowTableDialog(); - return 0; } diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx index 528b4eac14ef..d9f4f133b524 100644 --- a/svx/source/tbxctrls/tbcontrl.cxx +++ b/svx/source/tbxctrls/tbcontrl.cxx @@ -1380,7 +1380,7 @@ IMPL_LINK_NOARG(SvxColorWindow_Impl, SelectPaletteHdl) return 0; } -IMPL_LINK_NOARG(SvxColorWindow_Impl, AutoColorClickHdl) +IMPL_LINK_NOARG_TYPED(SvxColorWindow_Impl, AutoColorClickHdl, Button*, void) { Color aColor; switch ( theSlotId ) @@ -1410,15 +1410,13 @@ IMPL_LINK_NOARG(SvxColorWindow_Impl, AutoColorClickHdl) maSelectedLink.Call(&aColor); maColorSelectFunction(maCommand, aColor); - return 0; } -IMPL_LINK_NOARG(SvxColorWindow_Impl, OpenPickerClickHdl) +IMPL_LINK_NOARG_TYPED(SvxColorWindow_Impl, OpenPickerClickHdl, Button*, void) { if ( IsInPopupMode() ) EndPopupMode(); mrPaletteManager.PopupColorPicker(maCommand); - return 0; } void SvxColorWindow_Impl::Resize() diff --git a/svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.cxx b/svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.cxx index 38b007fa8dc0..887fd203fa48 100644 --- a/svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.cxx +++ b/svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.cxx @@ -595,10 +595,9 @@ void ChineseDictionaryDialog::setDirectionAndTextConversionOptions( bool bDirect updateAfterDirectionChange(); } -IMPL_LINK_NOARG(ChineseDictionaryDialog, DirectionHdl) +IMPL_LINK_NOARG_TYPED(ChineseDictionaryDialog, DirectionHdl, Button*, void) { updateAfterDirectionChange(); - return 0; } void ChineseDictionaryDialog::updateAfterDirectionChange() @@ -713,10 +712,10 @@ void ChineseDictionaryDialog::updateButtons() m_pPB_Modify->Enable( bModify ); } -IMPL_LINK_NOARG(ChineseDictionaryDialog, AddHdl) +IMPL_LINK_NOARG_TYPED(ChineseDictionaryDialog, AddHdl, Button*, void) { if( !isEditFieldsHaveContent() ) - return 0; + return; sal_Int16 nConversionPropertyType = m_pLB_Property->GetSelectEntryPos()+1; @@ -729,9 +728,9 @@ IMPL_LINK_NOARG(ChineseDictionaryDialog, AddHdl) } updateButtons(); - return 0; } -IMPL_LINK_NOARG(ChineseDictionaryDialog, ModifyHdl) + +IMPL_LINK_NOARG_TYPED(ChineseDictionaryDialog, ModifyHdl, Button*, void) { OUString aTerm( m_pED_Term->GetText() ); OUString aMapping( m_pED_Mapping->GetText() ); @@ -742,7 +741,7 @@ IMPL_LINK_NOARG(ChineseDictionaryDialog, ModifyHdl) DictionaryEntry* pE = rActive.getFirstSelectedEntry(); if( pE && pE->m_aTerm != aTerm ) - return 0; + return; if( pE ) { @@ -761,10 +760,9 @@ IMPL_LINK_NOARG(ChineseDictionaryDialog, ModifyHdl) } updateButtons(); - return 0; } -IMPL_LINK_NOARG(ChineseDictionaryDialog, DeleteHdl) +IMPL_LINK_NOARG_TYPED(ChineseDictionaryDialog, DeleteHdl, Button*, void) { DictionaryList& rActive = getActiveDictionary(); DictionaryList& rReverse = getReverseDictionary(); @@ -792,7 +790,6 @@ IMPL_LINK_NOARG(ChineseDictionaryDialog, DeleteHdl) } updateButtons(); - return 0; } short ChineseDictionaryDialog::Execute() diff --git a/svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.hxx b/svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.hxx index 5e7f82954779..156c6c9756cc 100644 --- a/svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.hxx +++ b/svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.hxx @@ -123,12 +123,12 @@ public: virtual short Execute() SAL_OVERRIDE; private: - DECL_LINK( DirectionHdl, void* ); + DECL_LINK_TYPED( DirectionHdl, Button*, void ); DECL_LINK(EditFieldsHdl, void *); DECL_LINK( MappingSelectHdl, void* ); - DECL_LINK( AddHdl, void* ); - DECL_LINK( ModifyHdl, void* ); - DECL_LINK( DeleteHdl, void* ); + DECL_LINK_TYPED( AddHdl, Button*, void ); + DECL_LINK_TYPED( ModifyHdl, Button*, void ); + DECL_LINK_TYPED( DeleteHdl, Button*, void ); DECL_LINK( HeaderBarClick, HeaderBar* ); void initDictionaryControl(DictionaryList *pList, diff --git a/svx/source/unodialogs/textconversiondlgs/chinese_translationdialog.cxx b/svx/source/unodialogs/textconversiondlgs/chinese_translationdialog.cxx index faa63755f7b2..a1ab685c7c0f 100644 --- a/svx/source/unodialogs/textconversiondlgs/chinese_translationdialog.cxx +++ b/svx/source/unodialogs/textconversiondlgs/chinese_translationdialog.cxx @@ -89,7 +89,7 @@ void ChineseTranslationDialog::getSettings( bool& rbDirectionToSimplified rbTranslateCommonTerms = m_pCB_Translate_Commonterms->IsChecked(); } -IMPL_LINK_NOARG(ChineseTranslationDialog, OkHdl) +IMPL_LINK_NOARG_TYPED(ChineseTranslationDialog, OkHdl, Button*, void) { //save settings to configuration SvtLinguConfig aLngCfg; @@ -100,10 +100,9 @@ IMPL_LINK_NOARG(ChineseTranslationDialog, OkHdl) aLngCfg.SetProperty( OUString( UPN_IS_TRANSLATE_COMMON_TERMS ), aAny ); EndDialog( RET_OK ); - return 0; } -IMPL_LINK_NOARG(ChineseTranslationDialog, DictionaryHdl) +IMPL_LINK_NOARG_TYPED(ChineseTranslationDialog, DictionaryHdl, Button*, void) { if( !m_pDictionaryDialog ) { @@ -128,7 +127,6 @@ IMPL_LINK_NOARG(ChineseTranslationDialog, DictionaryHdl) m_pDictionaryDialog->Execute(); } } - return 0; } diff --git a/svx/source/unodialogs/textconversiondlgs/chinese_translationdialog.hxx b/svx/source/unodialogs/textconversiondlgs/chinese_translationdialog.hxx index 3b8140f7dce9..0091cfbbf7e3 100644 --- a/svx/source/unodialogs/textconversiondlgs/chinese_translationdialog.hxx +++ b/svx/source/unodialogs/textconversiondlgs/chinese_translationdialog.hxx @@ -45,8 +45,8 @@ public: , bool& rbTranslateCommonTerms ) const; private: - DECL_LINK( DictionaryHdl, void* ); - DECL_LINK( OkHdl, void* ); + DECL_LINK_TYPED( DictionaryHdl, Button*, void ); + DECL_LINK_TYPED( OkHdl, Button*, void ); private: VclPtr<RadioButton> m_pRB_To_Simplified; |