summaryrefslogtreecommitdiff
path: root/extensions
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2015-10-04 15:05:38 +0200
committerNoel Grandin <noelgrandin@gmail.com>2015-10-12 10:48:13 +0000
commit3c99f8500f657ed84b316390d5175a6f5e56bc69 (patch)
tree749f16652560a50d409b12a23bf1a5d93b3cd2d5 /extensions
parentbbadb38539eb233ac45b267034066a7274181c65 (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 'extensions')
-rw-r--r--extensions/source/abpilot/tableselectionpage.cxx3
-rw-r--r--extensions/source/abpilot/tableselectionpage.hxx2
-rw-r--r--extensions/source/bibliography/datman.cxx11
-rw-r--r--extensions/source/bibliography/toolbar.cxx3
-rw-r--r--extensions/source/bibliography/toolbar.hxx2
-rw-r--r--extensions/source/dbpilots/commonpagesdbp.cxx8
-rw-r--r--extensions/source/dbpilots/commonpagesdbp.hxx2
-rw-r--r--extensions/source/dbpilots/gridwizard.cxx3
-rw-r--r--extensions/source/dbpilots/gridwizard.hxx2
-rw-r--r--extensions/source/dbpilots/groupboxwiz.cxx6
-rw-r--r--extensions/source/dbpilots/groupboxwiz.hxx4
-rw-r--r--extensions/source/dbpilots/listcombowizard.cxx6
-rw-r--r--extensions/source/dbpilots/listcombowizard.hxx4
-rw-r--r--extensions/source/propctrlr/commoncontrol.cxx3
-rw-r--r--extensions/source/propctrlr/commoncontrol.hxx4
-rw-r--r--extensions/source/propctrlr/standardcontrol.hxx15
-rw-r--r--extensions/source/scanner/sanedlg.cxx9
-rw-r--r--extensions/source/scanner/sanedlg.hxx2
18 files changed, 46 insertions, 43 deletions
diff --git a/extensions/source/abpilot/tableselectionpage.cxx b/extensions/source/abpilot/tableselectionpage.cxx
index ed7beec4aec3..965ccac369d5 100644
--- a/extensions/source/abpilot/tableselectionpage.cxx
+++ b/extensions/source/abpilot/tableselectionpage.cxx
@@ -93,10 +93,9 @@ namespace abp
}
- IMPL_LINK( TableSelectionPage, OnTableSelected, void*, /*NOTINTERESTEDIN*/ )
+ IMPL_LINK_NOARG_TYPED( TableSelectionPage, OnTableSelected, ListBox&, void )
{
updateDialogTravelUI();
- return 0L;
}
diff --git a/extensions/source/abpilot/tableselectionpage.hxx b/extensions/source/abpilot/tableselectionpage.hxx
index 3b92ba60ada5..da51e010a6c9 100644
--- a/extensions/source/abpilot/tableselectionpage.hxx
+++ b/extensions/source/abpilot/tableselectionpage.hxx
@@ -50,7 +50,7 @@ namespace abp
virtual bool canAdvance() const SAL_OVERRIDE;
private:
- DECL_LINK( OnTableSelected, void* );
+ DECL_LINK_TYPED( OnTableSelected, ListBox&, void );
DECL_LINK_TYPED( OnTableDoubleClicked, ListBox&, void );
};
diff --git a/extensions/source/bibliography/datman.cxx b/extensions/source/bibliography/datman.cxx
index fbf65eccfabb..50f4fb3b2f66 100644
--- a/extensions/source/bibliography/datman.cxx
+++ b/extensions/source/bibliography/datman.cxx
@@ -237,7 +237,7 @@ class MappingDialog_Impl : public ModalDialog
DECL_LINK_TYPED(OkHdl, Button*, void);
- DECL_LINK(ListBoxSelectHdl, ListBox*);
+ DECL_LINK_TYPED(ListBoxSelectHdl, ListBox&, void);
public:
MappingDialog_Impl(vcl::Window* pParent, BibDataManager* pDatMan);
@@ -348,7 +348,7 @@ MappingDialog_Impl::MappingDialog_Impl(vcl::Window* pParent, BibDataManager* pMa
aListBoxes[0]->InsertEntry(pNames[nField]);
}
- Link<> aLnk = LINK(this, MappingDialog_Impl, ListBoxSelectHdl);
+ Link<ListBox&,void> aLnk = LINK(this, MappingDialog_Impl, ListBoxSelectHdl);
aListBoxes[0]->SelectEntryPos(0);
aListBoxes[0]->SetSelectHdl(aLnk);
@@ -422,19 +422,18 @@ void MappingDialog_Impl::dispose()
ModalDialog::dispose();
}
-IMPL_LINK(MappingDialog_Impl, ListBoxSelectHdl, ListBox*, pListBox)
+IMPL_LINK_TYPED(MappingDialog_Impl, ListBoxSelectHdl, ListBox&, rListBox, void)
{
- const sal_Int32 nEntryPos = pListBox->GetSelectEntryPos();
+ const sal_Int32 nEntryPos = rListBox.GetSelectEntryPos();
if(0 < nEntryPos)
{
for(sal_uInt16 i = 0; i < COLUMN_COUNT; i++)
{
- if(pListBox != aListBoxes[i] && aListBoxes[i]->GetSelectEntryPos() == nEntryPos)
+ if(&rListBox != aListBoxes[i] && aListBoxes[i]->GetSelectEntryPos() == nEntryPos)
aListBoxes[i]->SelectEntryPos(0);
}
}
SetModified();
- return 0;
}
IMPL_LINK_NOARG_TYPED(MappingDialog_Impl, OkHdl, Button*, void)
diff --git a/extensions/source/bibliography/toolbar.cxx b/extensions/source/bibliography/toolbar.cxx
index 8fa2b4e66056..4993130b2e27 100644
--- a/extensions/source/bibliography/toolbar.cxx
+++ b/extensions/source/bibliography/toolbar.cxx
@@ -462,10 +462,9 @@ bool BibToolBar::PreNotify( NotifyEvent& rNEvt )
return bResult;
}
-IMPL_LINK( BibToolBar, SelHdl, ListBox*, /*pLb*/ )
+IMPL_LINK_NOARG_TYPED( BibToolBar, SelHdl, ListBox&, void )
{
aIdle.Start();
- return 0;
}
IMPL_LINK_NOARG_TYPED( BibToolBar, SendSelHdl, Idle*, void )
diff --git a/extensions/source/bibliography/toolbar.hxx b/extensions/source/bibliography/toolbar.hxx
index a4b131a29a88..6eb060cee5b1 100644
--- a/extensions/source/bibliography/toolbar.hxx
+++ b/extensions/source/bibliography/toolbar.hxx
@@ -128,7 +128,7 @@ class BibToolBar: public ToolBox
sal_Int16 nOutStyle;
BibDataManager* pDatMan;
- DECL_LINK( SelHdl, ListBox* );
+ DECL_LINK_TYPED( SelHdl, ListBox&, void );
DECL_LINK_TYPED( SendSelHdl, Idle*, void );
DECL_LINK_TYPED( MenuHdl, ToolBox*, void );
DECL_LINK_TYPED( OptionsChanged_Impl, LinkParamNone*, void );
diff --git a/extensions/source/dbpilots/commonpagesdbp.cxx b/extensions/source/dbpilots/commonpagesdbp.cxx
index 13857eb888b5..e8850fc7d0ba 100644
--- a/extensions/source/dbpilots/commonpagesdbp.cxx
+++ b/extensions/source/dbpilots/commonpagesdbp.cxx
@@ -213,7 +213,7 @@ namespace dbp
sDataSourceName = aFileNotation.get(::svt::OFileNotation::N_SYSTEM);
m_pDatasource->InsertEntry(sDataSourceName);
m_pDatasource->SelectEntry(sDataSourceName);
- LINK(this, OTableSelectionPage, OnListboxSelection).Call(m_pDatasource);
+ LINK(this, OTableSelectionPage, OnListboxSelection).Call(*m_pDatasource);
}
}
@@ -224,16 +224,14 @@ namespace dbp
}
- IMPL_LINK( OTableSelectionPage, OnListboxSelection, ListBox*, _pBox )
+ IMPL_LINK_TYPED( OTableSelectionPage, OnListboxSelection, ListBox&, _rBox, void )
{
- if (m_pDatasource == _pBox)
+ if (m_pDatasource == &_rBox)
{ // new data source selected
implFillTables();
}
updateDialogTravelUI();
-
- return 0L;
}
diff --git a/extensions/source/dbpilots/commonpagesdbp.hxx b/extensions/source/dbpilots/commonpagesdbp.hxx
index 6e8267d83efc..b98bb31583f7 100644
--- a/extensions/source/dbpilots/commonpagesdbp.hxx
+++ b/extensions/source/dbpilots/commonpagesdbp.hxx
@@ -54,7 +54,7 @@ namespace dbp
virtual bool commitPage( ::svt::WizardTypes::CommitPageReason _eReason ) SAL_OVERRIDE;
protected:
- DECL_LINK( OnListboxSelection, ListBox* );
+ DECL_LINK_TYPED( OnListboxSelection, ListBox&, void );
DECL_LINK_TYPED( OnListboxDoubleClicked, ListBox&, void );
DECL_LINK_TYPED( OnSearchClicked, Button*, void );
diff --git a/extensions/source/dbpilots/gridwizard.cxx b/extensions/source/dbpilots/gridwizard.cxx
index 74b96f4e51b3..d79c06c3bc80 100644
--- a/extensions/source/dbpilots/gridwizard.cxx
+++ b/extensions/source/dbpilots/gridwizard.cxx
@@ -401,10 +401,9 @@ namespace dbp
}
- IMPL_LINK(OGridFieldsSelection, OnEntrySelected, ListBox*, /*NOTINTERESTEDIN*/)
+ IMPL_LINK_NOARG_TYPED(OGridFieldsSelection, OnEntrySelected, ListBox&, void)
{
implCheckButtons();
- return 0L;
}
diff --git a/extensions/source/dbpilots/gridwizard.hxx b/extensions/source/dbpilots/gridwizard.hxx
index 98c0aa41e98a..16881bbe9f8a 100644
--- a/extensions/source/dbpilots/gridwizard.hxx
+++ b/extensions/source/dbpilots/gridwizard.hxx
@@ -96,7 +96,7 @@ namespace dbp
protected:
DECL_LINK_TYPED(OnMoveOneEntry, Button*, void);
DECL_LINK_TYPED(OnMoveAllEntries, Button*, void);
- DECL_LINK(OnEntrySelected, ListBox*);
+ DECL_LINK_TYPED(OnEntrySelected, ListBox&, void);
DECL_LINK_TYPED(OnEntryDoubleClicked, ListBox&, void);
void implCheckButtons();
diff --git a/extensions/source/dbpilots/groupboxwiz.cxx b/extensions/source/dbpilots/groupboxwiz.cxx
index 5faaa92a04b4..45e08891f02c 100644
--- a/extensions/source/dbpilots/groupboxwiz.cxx
+++ b/extensions/source/dbpilots/groupboxwiz.cxx
@@ -285,10 +285,9 @@ namespace dbp
}
- IMPL_LINK( ORadioSelectionPage, OnEntrySelected, ListBox*, /*_pList*/ )
+ IMPL_LINK_NOARG_TYPED( ORadioSelectionPage, OnEntrySelected, ListBox&, void )
{
implCheckMoveButtons();
- return 0L;
}
@@ -408,10 +407,9 @@ namespace dbp
OGBWPage::dispose();
}
- IMPL_LINK( OOptionValuesPage, OnOptionSelected, ListBox*, /*NOTINTERESTEDIN*/ )
+ IMPL_LINK_NOARG_TYPED( OOptionValuesPage, OnOptionSelected, ListBox&, void )
{
implTraveledOptions();
- return 0L;
}
diff --git a/extensions/source/dbpilots/groupboxwiz.hxx b/extensions/source/dbpilots/groupboxwiz.hxx
index 0515544c0784..e50469583d79 100644
--- a/extensions/source/dbpilots/groupboxwiz.hxx
+++ b/extensions/source/dbpilots/groupboxwiz.hxx
@@ -101,7 +101,7 @@ namespace dbp
virtual bool canAdvance() const SAL_OVERRIDE;
DECL_LINK_TYPED( OnMoveEntry, Button*, void );
- DECL_LINK( OnEntrySelected, ListBox* );
+ DECL_LINK_TYPED( OnEntrySelected, ListBox&, void );
DECL_LINK( OnNameModified, Edit* );
void implCheckMoveButtons();
@@ -152,7 +152,7 @@ namespace dbp
void implTraveledOptions();
- DECL_LINK( OnOptionSelected, ListBox* );
+ DECL_LINK_TYPED( OnOptionSelected, ListBox&, void );
};
class OOptionDBFieldPage : public ODBFieldPage
diff --git a/extensions/source/dbpilots/listcombowizard.cxx b/extensions/source/dbpilots/listcombowizard.cxx
index 87a605d57bfe..cca2309137da 100644
--- a/extensions/source/dbpilots/listcombowizard.cxx
+++ b/extensions/source/dbpilots/listcombowizard.cxx
@@ -300,10 +300,9 @@ namespace dbp
}
- IMPL_LINK( OContentTableSelection, OnTableSelected, ListBox*, /*_pListBox*/ )
+ IMPL_LINK_NOARG_TYPED( OContentTableSelection, OnTableSelected, ListBox&, void )
{
updateDialogTravelUI();
- return 0L;
}
@@ -409,11 +408,10 @@ namespace dbp
}
- IMPL_LINK( OContentFieldSelection, OnFieldSelected, ListBox*, /*NOTINTERESTEDIN*/ )
+ IMPL_LINK_NOARG_TYPED( OContentFieldSelection, OnFieldSelected, ListBox&, void )
{
updateDialogTravelUI();
m_pDisplayedField->SetText(m_pSelectTableField->GetSelectEntry());
- return 0L;
}
diff --git a/extensions/source/dbpilots/listcombowizard.hxx b/extensions/source/dbpilots/listcombowizard.hxx
index efe066862b2f..968b19470c62 100644
--- a/extensions/source/dbpilots/listcombowizard.hxx
+++ b/extensions/source/dbpilots/listcombowizard.hxx
@@ -114,7 +114,7 @@ namespace dbp
protected:
DECL_LINK_TYPED( OnTableDoubleClicked, ListBox&, void );
- DECL_LINK( OnTableSelected, ListBox* );
+ DECL_LINK_TYPED( OnTableSelected, ListBox&, void );
};
class OContentFieldSelection : public OLCPage
@@ -131,7 +131,7 @@ namespace dbp
virtual void dispose() SAL_OVERRIDE;
protected:
- DECL_LINK( OnFieldSelected, ListBox* );
+ DECL_LINK_TYPED( OnFieldSelected, ListBox&, void );
DECL_LINK_TYPED( OnTableDoubleClicked, ListBox&, void );
// TabPage overridables
diff --git a/extensions/source/propctrlr/commoncontrol.cxx b/extensions/source/propctrlr/commoncontrol.cxx
index 325f129a65d5..be90a9be44ac 100644
--- a/extensions/source/propctrlr/commoncontrol.cxx
+++ b/extensions/source/propctrlr/commoncontrol.cxx
@@ -95,13 +95,12 @@ namespace pcr
}
- IMPL_LINK( CommonBehaviourControlHelper, ModifiedHdl, vcl::Window*, /*_pWin*/ )
+ IMPL_LINK_NOARG( CommonBehaviourControlHelper, ModifiedHdl )
{
setModified();
return 0;
}
-
IMPL_LINK_NOARG_TYPED( CommonBehaviourControlHelper, GetFocusHdl, Control&, void )
{
try
diff --git a/extensions/source/propctrlr/commoncontrol.hxx b/extensions/source/propctrlr/commoncontrol.hxx
index d1ab9eda6ec0..5ae884768db9 100644
--- a/extensions/source/propctrlr/commoncontrol.hxx
+++ b/extensions/source/propctrlr/commoncontrol.hxx
@@ -30,6 +30,7 @@
class NotifyEvent;
class Control;
+class ListBox;
namespace pcr
{
@@ -86,7 +87,8 @@ namespace pcr
virtual vcl::Window* getVclWindow() = 0;
/// may be used by derived classes, they forward the event to the PropCtrListener
- DECL_LINK( ModifiedHdl, vcl::Window* );
+ DECL_LINK( ModifiedHdl, void* );
+ DECL_LINK_TYPED( SelectHdl, ListBox&, void );
DECL_LINK_TYPED( GetFocusHdl, Control&, void );
DECL_LINK_TYPED( LoseFocusHdl, Control&, void );
};
diff --git a/extensions/source/propctrlr/standardcontrol.hxx b/extensions/source/propctrlr/standardcontrol.hxx
index 4169fec2fa2c..a38cc772c455 100644
--- a/extensions/source/propctrlr/standardcontrol.hxx
+++ b/extensions/source/propctrlr/standardcontrol.hxx
@@ -58,11 +58,24 @@ namespace pcr
ListLikeControlWithModifyHandler( vcl::Window* _pParent, WinBits _nStyle )
: TListboxWindow( _pParent, _nStyle )
{
+ TListboxWindow::SetSelectHdl( LINK(this, ListLikeControlWithModifyHandler, OnSelect) );
}
- void SetModifyHdl( const Link<>& _rLink ) { TListboxWindow::SetSelectHdl( _rLink ); }
+ void SetModifyHdl( const Link<>& _rLink ) { aModifyHdl = _rLink;; }
+ private:
+ DECL_LINK_TYPED(OnSelect, ListBox&, void);
+ Link<> aModifyHdl;
};
+ template< class LISTBOX_WINDOW >
+ void ListLikeControlWithModifyHandler< LISTBOX_WINDOW >::LinkStubOnSelect(void * instance, ListBox& data) {
+ return static_cast<ListLikeControlWithModifyHandler< LISTBOX_WINDOW > *>(instance)->OnSelect(data);
+ }
+ template< class LISTBOX_WINDOW >
+ void ListLikeControlWithModifyHandler< LISTBOX_WINDOW >::OnSelect(ListBox& rListBox)
+ {
+ aModifyHdl.Call(&rListBox);
+ }
//= OTimeControl
diff --git a/extensions/source/scanner/sanedlg.cxx b/extensions/source/scanner/sanedlg.cxx
index 94c4c0fa2b0d..f180ac3f0626 100644
--- a/extensions/source/scanner/sanedlg.cxx
+++ b/extensions/source/scanner/sanedlg.cxx
@@ -677,9 +677,9 @@ IMPL_LINK_TYPED( SaneDlg, ClickBtnHdl, Button*, pButton, void )
}
}
-IMPL_LINK( SaneDlg, SelectHdl, ListBox*, pListBox )
+IMPL_LINK_TYPED( SaneDlg, SelectHdl, ListBox&, rListBox, void )
{
- if( pListBox == mpDeviceBox && Sane::IsSane() && Sane::CountDevices() )
+ if( &rListBox == mpDeviceBox && Sane::IsSane() && Sane::CountDevices() )
{
int nNewNumber = mpDeviceBox->GetSelectEntryPos();
int nOldNumber = mrSane.GetDeviceNumber();
@@ -693,19 +693,18 @@ IMPL_LINK( SaneDlg, SelectHdl, ListBox*, pListBox )
}
if( mrSane.IsOpen() )
{
- if( pListBox == mpQuantumRangeBox )
+ if( &rListBox == mpQuantumRangeBox )
{
OString aValue(OUStringToOString(mpQuantumRangeBox->GetSelectEntry(),
osl_getThreadTextEncoding()));
double fValue = atof(aValue.getStr());
mrSane.SetOptionValue( mnCurrentOption, fValue, mnCurrentElement );
}
- else if( pListBox == mpStringRangeBox )
+ else if( &rListBox == mpStringRangeBox )
{
mrSane.SetOptionValue( mnCurrentOption, mpStringRangeBox->GetSelectEntry() );
}
}
- return 0;
}
IMPL_LINK_TYPED( SaneDlg, OptionsBoxSelectHdl, SvTreeListBox*, pBox, void )
diff --git a/extensions/source/scanner/sanedlg.hxx b/extensions/source/scanner/sanedlg.hxx
index 17cae7604a9f..5b79a6128ced 100644
--- a/extensions/source/scanner/sanedlg.hxx
+++ b/extensions/source/scanner/sanedlg.hxx
@@ -81,7 +81,7 @@ private:
bool doScan;
DECL_LINK_TYPED( ClickBtnHdl, Button*, void );
- DECL_LINK( SelectHdl, ListBox* );
+ DECL_LINK_TYPED( SelectHdl, ListBox&, void );
DECL_LINK( ModifyHdl, Edit* );
DECL_LINK_TYPED( ReloadSaneOptionsHdl, Sane&, void );
DECL_LINK_TYPED( OptionsBoxSelectHdl, SvTreeListBox*, void );