summaryrefslogtreecommitdiff
path: root/svtools
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2015-08-19 09:11:34 +0200
committerNoel Grandin <noel@peralex.com>2015-08-26 11:15:35 +0200
commit167bc621ef825ed5b961502fe9324a675ee34e42 (patch)
tree523838d8adc14a62f846529ee6eab3343b2fe87b /svtools
parent46a27805fb707544a844a961a3743b8b992282f0 (diff)
Convert vcl Button Link<> click handler to typed Link<Button*,void>
Change-Id: Ie80dfb003118d40741549c41ebcc7eda4819f05b
Diffstat (limited to 'svtools')
-rw-r--r--svtools/source/brwbox/ebbcontrols.cxx4
-rw-r--r--svtools/source/control/calendar.cxx5
-rw-r--r--svtools/source/control/filectrl.cxx4
-rw-r--r--svtools/source/control/tabbar.cxx14
-rw-r--r--svtools/source/dialogs/PlaceEditDialog.cxx7
-rw-r--r--svtools/source/dialogs/ServerDetailsControls.cxx4
-rw-r--r--svtools/source/dialogs/addresstemplate.cxx9
-rw-r--r--svtools/source/dialogs/prnsetup.cxx6
-rw-r--r--svtools/source/dialogs/restartdialog.cxx12
-rw-r--r--svtools/source/dialogs/wizardmachine.cxx22
-rw-r--r--svtools/source/filter/exportdialog.cxx21
-rw-r--r--svtools/source/filter/exportdialog.hxx5
-rw-r--r--svtools/source/toolpanel/paneltabbar.cxx7
13 files changed, 52 insertions, 68 deletions
diff --git a/svtools/source/brwbox/ebbcontrols.cxx b/svtools/source/brwbox/ebbcontrols.cxx
index e55b90d0c123..e486e0e7b0bb 100644
--- a/svtools/source/brwbox/ebbcontrols.cxx
+++ b/svtools/source/brwbox/ebbcontrols.cxx
@@ -259,10 +259,10 @@ namespace svt
}
- IMPL_LINK_NOARG(CheckBoxControl, OnClick)
+ IMPL_LINK_NOARG_TYPED(CheckBoxControl, OnClick, Button*, void)
{
m_aClickLink.Call(pBox);
- return m_aModifyLink.Call(pBox);
+ m_aModifyLink.Call(pBox);
}
diff --git a/svtools/source/control/calendar.cxx b/svtools/source/control/calendar.cxx
index 12cdcfd867a4..a403848ebfe7 100644
--- a/svtools/source/control/calendar.cxx
+++ b/svtools/source/control/calendar.cxx
@@ -2252,8 +2252,9 @@ IMPL_LINK_TYPED( CalendarField, ImplSelectHdl, Calendar*, pCalendar, void )
}
}
-IMPL_LINK( CalendarField, ImplClickHdl, PushButton*, pBtn )
+IMPL_LINK_TYPED( CalendarField, ImplClickHdl, Button*, pButton, void )
{
+ PushButton* pBtn = static_cast<PushButton*>(pButton);
mpFloatWin->EndPopupMode();
EndDropDown();
GrabFocus();
@@ -2277,8 +2278,6 @@ IMPL_LINK( CalendarField, ImplClickHdl, PushButton*, pBtn )
Modify();
}
}
-
- return 0;
}
IMPL_LINK_NOARG(CalendarField, ImplPopupModeEndHdl)
diff --git a/svtools/source/control/filectrl.cxx b/svtools/source/control/filectrl.cxx
index 4482cf4b8ab9..34941ecce52a 100644
--- a/svtools/source/control/filectrl.cxx
+++ b/svtools/source/control/filectrl.cxx
@@ -186,11 +186,9 @@ void FileControl::Resize()
-IMPL_LINK_NOARG(FileControl, ButtonHdl)
+IMPL_LINK_NOARG_TYPED(FileControl, ButtonHdl, Button*, void)
{
ImplBrowseFile( );
-
- return 0;
}
void FileControl::GetFocus()
diff --git a/svtools/source/control/tabbar.cxx b/svtools/source/control/tabbar.cxx
index a4cfe4e2d340..6cb9fe4919ef 100644
--- a/svtools/source/control/tabbar.cxx
+++ b/svtools/source/control/tabbar.cxx
@@ -822,14 +822,14 @@ void TabBar::ImplInitControls()
if ((mnWinStyle & WB_INSERTTAB) && !mpImpl->mpAddButton)
{
- Link<> aLink = LINK(this, TabBar, ImplAddClickHandler);
+ Link<Button*,void> aLink = LINK(this, TabBar, ImplAddClickHandler);
mpImpl->mpAddButton.reset(VclPtr<ImplTabButton>::Create(this, WB_REPEAT));
mpImpl->mpAddButton->SetClickHdl(aLink);
mpImpl->mpAddButton->SetSymbol(SymbolType::PLUS);
mpImpl->mpAddButton->Show();
}
- Link<> aLink = LINK( this, TabBar, ImplClickHdl );
+ Link<Button*,void> aLink = LINK( this, TabBar, ImplClickHdl );
if (mnWinStyle & (WB_MINSCROLL | WB_SCROLL))
{
@@ -929,8 +929,9 @@ void TabBar::ImplShowPage( sal_uInt16 nPos )
}
}
-IMPL_LINK( TabBar, ImplClickHdl, ImplTabButton*, pBtn )
+IMPL_LINK_TYPED( TabBar, ImplClickHdl, Button*, pButton, void )
{
+ ImplTabButton* pBtn = static_cast<ImplTabButton*>(pButton);
EndEditMode();
sal_uInt16 nNewPos = mnFirstPos;
@@ -958,19 +959,16 @@ IMPL_LINK( TabBar, ImplClickHdl, ImplTabButton*, pBtn )
}
else
{
- return 0;
+ return;
}
if (nNewPos != mnFirstPos)
SetFirstPageId(GetPageId(nNewPos));
-
- return 0;
}
-IMPL_LINK_NOARG(TabBar, ImplAddClickHandler)
+IMPL_LINK_NOARG_TYPED(TabBar, ImplAddClickHandler, Button*, void)
{
AddTabClick();
- return 0;
}
void TabBar::MouseMove(const MouseEvent& rMEvt)
diff --git a/svtools/source/dialogs/PlaceEditDialog.cxx b/svtools/source/dialogs/PlaceEditDialog.cxx
index 5b8bba57c044..b244494fbfda 100644
--- a/svtools/source/dialogs/PlaceEditDialog.cxx
+++ b/svtools/source/dialogs/PlaceEditDialog.cxx
@@ -252,7 +252,7 @@ void PlaceEditDialog::UpdateLabel( )
}
}
-IMPL_LINK ( PlaceEditDialog, OKHdl, Button *, )
+IMPL_LINK_TYPED( PlaceEditDialog, OKHdl, Button*, /*pBtn*/, void)
{
if ( m_xCurrentDetails.get() )
{
@@ -285,15 +285,12 @@ IMPL_LINK ( PlaceEditDialog, OKHdl, Button *, )
EndDialog( RET_OK );
}
}
-
- return 1;
}
-IMPL_LINK ( PlaceEditDialog, DelHdl, Button *, )
+IMPL_LINK_TYPED( PlaceEditDialog, DelHdl, Button*, /*pButton*/, void)
{
// ReUsing existing symbols...
EndDialog( RET_NO );
- return 1;
}
IMPL_LINK_NOARG_TYPED( PlaceEditDialog, EditHdl, DetailsContainer*, void )
diff --git a/svtools/source/dialogs/ServerDetailsControls.cxx b/svtools/source/dialogs/ServerDetailsControls.cxx
index ad4750e27ece..96da5918c740 100644
--- a/svtools/source/dialogs/ServerDetailsControls.cxx
+++ b/svtools/source/dialogs/ServerDetailsControls.cxx
@@ -393,7 +393,7 @@ void CmisDetailsContainer::selectRepository( )
}
}
-IMPL_LINK_NOARG( CmisDetailsContainer, RefreshReposHdl )
+IMPL_LINK_NOARG_TYPED( CmisDetailsContainer, RefreshReposHdl, Button*, void )
{
OUString sBindingUrl = m_pEDHost->GetText().trim( );
@@ -456,8 +456,6 @@ IMPL_LINK_NOARG( CmisDetailsContainer, RefreshReposHdl )
m_pLBRepository->SelectEntryPos( 0 );
selectRepository( );
}
-
- return 0;
}
IMPL_LINK_NOARG( CmisDetailsContainer, SelectRepoHdl )
diff --git a/svtools/source/dialogs/addresstemplate.cxx b/svtools/source/dialogs/addresstemplate.cxx
index 01b730bf7d31..041c198e619a 100644
--- a/svtools/source/dialogs/addresstemplate.cxx
+++ b/svtools/source/dialogs/addresstemplate.cxx
@@ -1155,7 +1155,7 @@ void AssignmentPersistentData::ImplCommit()
}
- IMPL_LINK_NOARG(AddressBookSourceDialog, OnOkClicked)
+ IMPL_LINK_NOARG_TYPED(AddressBookSourceDialog, OnOkClicked, Button*, void)
{
OUString sSelectedDS = lcl_getSelectedDataSource(*m_pDatasource);
if ( m_pImpl->bWorkingPersistent )
@@ -1178,11 +1178,10 @@ void AssignmentPersistentData::ImplCommit()
EndDialog(RET_OK);
- return 0L;
}
- IMPL_LINK_NOARG(AddressBookSourceDialog, OnAdministrateDatasources)
+ IMPL_LINK_NOARG_TYPED(AddressBookSourceDialog, OnAdministrateDatasources, Button*, void)
{
// create the dialog object
Reference< XExecutableDialog > xAdminDialog;
@@ -1194,7 +1193,7 @@ void AssignmentPersistentData::ImplCommit()
if (!xAdminDialog.is())
{
ShowServiceNotAvailableError(this, OUString("com.sun.star.ui.dialogs.AddressBookSourcePilot"), true);
- return 1L;
+ return;
}
// execute the dialog
@@ -1232,8 +1231,6 @@ void AssignmentPersistentData::ImplCommit()
// try to preserve the current selection
// initializeDatasources();
-
- return 0L;
}
bool AddressBookSourceDialog::PreNotify( NotifyEvent& _rNEvt )
diff --git a/svtools/source/dialogs/prnsetup.cxx b/svtools/source/dialogs/prnsetup.cxx
index 05a7e6d9c59b..849714f133e5 100644
--- a/svtools/source/dialogs/prnsetup.cxx
+++ b/svtools/source/dialogs/prnsetup.cxx
@@ -264,7 +264,7 @@ void PrinterSetupDialog::dispose()
ModalDialog::dispose();
}
-void PrinterSetupDialog::SetOptionsHdl( const Link<>& rLink )
+void PrinterSetupDialog::SetOptionsHdl( const Link<Button*,void>& rLink )
{
m_pBtnOptions->SetClickHdl( rLink );
m_pBtnOptions->Show( rLink.IsSet() );
@@ -301,13 +301,11 @@ IMPL_LINK_NOARG_TYPED(PrinterSetupDialog, ImplStatusHdl, Timer *, void)
-IMPL_LINK_NOARG(PrinterSetupDialog, ImplPropertiesHdl)
+IMPL_LINK_NOARG_TYPED(PrinterSetupDialog, ImplPropertiesHdl, Button*, void)
{
if ( !mpTempPrinter )
mpTempPrinter = VclPtr<Printer>::Create( mpPrinter->GetJobSetup() );
mpTempPrinter->Setup( this );
-
- return 0;
}
diff --git a/svtools/source/dialogs/restartdialog.cxx b/svtools/source/dialogs/restartdialog.cxx
index 1fa2de2c6c73..3deeb8b0995a 100644
--- a/svtools/source/dialogs/restartdialog.cxx
+++ b/svtools/source/dialogs/restartdialog.cxx
@@ -59,22 +59,22 @@ public:
ModalDialog::dispose();
}
private:
- DECL_LINK(hdlYes, void *);
- DECL_LINK(hdlNo, void *);
+ DECL_LINK_TYPED(hdlYes, Button*, void);
+ DECL_LINK_TYPED(hdlNo, Button*, void);
VclPtr<vcl::Window> reason_;
VclPtr<PushButton> btnYes_;
VclPtr<PushButton> btnNo_;
};
-IMPL_LINK_NOARG(RestartDialog, hdlYes) {
+IMPL_LINK_NOARG_TYPED(RestartDialog, hdlYes, Button*, void)
+{
EndDialog(RET_OK);
- return 0;
}
-IMPL_LINK_NOARG(RestartDialog, hdlNo) {
+IMPL_LINK_NOARG_TYPED(RestartDialog, hdlNo, Button*, void)
+{
EndDialog();
- return 0;
}
}
diff --git a/svtools/source/dialogs/wizardmachine.cxx b/svtools/source/dialogs/wizardmachine.cxx
index ffb47bb6255b..458598b3e673 100644
--- a/svtools/source/dialogs/wizardmachine.cxx
+++ b/svtools/source/dialogs/wizardmachine.cxx
@@ -412,16 +412,16 @@ namespace svt
}
- IMPL_LINK_NOARG(OWizardMachine, OnFinish)
+ IMPL_LINK_NOARG_TYPED(OWizardMachine, OnFinish, Button*, void)
{
if ( isTravelingSuspended() )
- return 0;
+ return;
WizardTravelSuspension aTravelGuard( *this );
if ( !prepareLeaveCurrentState( eFinish ) )
{
- return 0L;
+ return;
}
- return onFinish() ? 1L : 0L;
+ onFinish();
}
@@ -629,23 +629,21 @@ namespace svt
}
- IMPL_LINK_NOARG(OWizardMachine, OnPrevPage)
+ IMPL_LINK_NOARG_TYPED(OWizardMachine, OnPrevPage, Button*, void)
{
if ( isTravelingSuspended() )
- return 0;
+ return;
WizardTravelSuspension aTravelGuard( *this );
- bool nRet = travelPrevious();
- return nRet ? 1 : 0;
+ travelPrevious();
}
- IMPL_LINK_NOARG(OWizardMachine, OnNextPage)
+ IMPL_LINK_NOARG_TYPED(OWizardMachine, OnNextPage, Button*, void)
{
if ( isTravelingSuspended() )
- return 0;
+ return;
WizardTravelSuspension aTravelGuard( *this );
- bool nRet = travelNext();
- return nRet ? 1 : 0;
+ travelNext();
}
diff --git a/svtools/source/filter/exportdialog.cxx b/svtools/source/filter/exportdialog.cxx
index 1c6a6a0695bc..5f5f85e8659f 100644
--- a/svtools/source/filter/exportdialog.cxx
+++ b/svtools/source/filter/exportdialog.cxx
@@ -658,20 +658,20 @@ ExportDialog::ExportDialog(FltCallDialogParameter& rPara,
setupControls();
// Size
- mpLbSizeX->SetSelectHdl( LINK( this, ExportDialog, UpdateHdl ) );
+ mpLbSizeX->SetSelectHdl( LINK( this, ExportDialog, SelectHdl ) );
if (mpSbCompression)
mpSbCompression->SetScrollHdl(LINK(this, ExportDialog, SbCompressionUpdateHdl));
if (mpNfCompression)
- mpNfCompression->SetModifyHdl(LINK(this, ExportDialog, UpdateHdl));
+ mpNfCompression->SetModifyHdl(LINK(this, ExportDialog, SelectHdl));
mpMfSizeX->SetModifyHdl( LINK( this, ExportDialog, UpdateHdlMtfSizeX ) );
mpMfSizeY->SetModifyHdl( LINK( this, ExportDialog, UpdateHdlMtfSizeY ) );
mpNfResolution->SetModifyHdl( LINK( this, ExportDialog, UpdateHdlNfResolution ) );
- mpLbResolution->SetSelectHdl( LINK( this, ExportDialog, UpdateHdl ) );
+ mpLbResolution->SetSelectHdl( LINK( this, ExportDialog, SelectHdl ) );
- mpLbColorDepth->SetSelectHdl( LINK( this, ExportDialog, UpdateHdl ) );
+ mpLbColorDepth->SetSelectHdl( LINK( this, ExportDialog, SelectHdl ) );
mpCbInterlaced->SetClickHdl( LINK( this, ExportDialog, UpdateHdl ) );
@@ -1028,11 +1028,15 @@ void ExportDialog::dispose()
|* stores values set in the ini-file
|*
\************************************************************************/
-IMPL_LINK_NOARG(ExportDialog, UpdateHdl)
+IMPL_LINK_NOARG(ExportDialog, SelectHdl)
{
- updateControls();
+ UpdateHdl(NULL);
return 0;
}
+IMPL_LINK_NOARG_TYPED(ExportDialog, UpdateHdl, Button*, void)
+{
+ updateControls();
+}
IMPL_LINK_NOARG(ExportDialog, UpdateHdlMtfSizeX)
{
@@ -1123,15 +1127,12 @@ IMPL_LINK_NOARG(ExportDialog, SbCompressionUpdateHdl)
return 0;
}
-IMPL_LINK_NOARG(ExportDialog, OK)
+IMPL_LINK_NOARG_TYPED(ExportDialog, OK, Button*, void)
{
// writing config parameter
-
mrFltCallPara.aFilterData = GetFilterData( true );
EndDialog( RET_OK );
-
- return 0;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svtools/source/filter/exportdialog.hxx b/svtools/source/filter/exportdialog.hxx
index a68aa69921d3..898e6aaf6f16 100644
--- a/svtools/source/filter/exportdialog.hxx
+++ b/svtools/source/filter/exportdialog.hxx
@@ -142,13 +142,14 @@ private:
mxPage;
- DECL_LINK( UpdateHdl, void* );
+ DECL_LINK_TYPED( UpdateHdl, Button*, void );
+ DECL_LINK( SelectHdl, void* );
DECL_LINK( UpdateHdlMtfSizeX, void* );
DECL_LINK( UpdateHdlMtfSizeY, void* );
DECL_LINK( UpdateHdlNfResolution, void* );
DECL_LINK( SbCompressionUpdateHdl, void* );
- DECL_LINK( OK, void* );
+ DECL_LINK_TYPED( OK, Button*, void );
void setupSizeControls();
void createFilterOptions();
diff --git a/svtools/source/toolpanel/paneltabbar.cxx b/svtools/source/toolpanel/paneltabbar.cxx
index b872489c8991..583ebed423cd 100644
--- a/svtools/source/toolpanel/paneltabbar.cxx
+++ b/svtools/source/toolpanel/paneltabbar.cxx
@@ -410,7 +410,7 @@ namespace svt
}
protected:
- DECL_LINK( OnScroll, const PushButton* );
+ DECL_LINK_TYPED( OnScroll, Button*, void );
void impl_calcItemRects();
Size impl_calculateItemContentSize( const PToolPanel& i_pPanel, const TabItemContent i_eItemContent ) const;
@@ -924,8 +924,9 @@ namespace svt
}
- IMPL_LINK( PanelTabBar_Impl, OnScroll, const PushButton*, i_pButton )
+ IMPL_LINK_TYPED( PanelTabBar_Impl, OnScroll, Button*, pButton, void )
{
+ PushButton* i_pButton = static_cast<PushButton*>(pButton);
if ( i_pButton == m_aScrollBack.get() )
{
OSL_ENSURE( m_nScrollPosition > 0, "PanelTabBar_Impl::OnScroll: inconsistency!" );
@@ -940,8 +941,6 @@ namespace svt
}
UpdateScrollButtons();
-
- return 0L;
}