summaryrefslogtreecommitdiff
path: root/vcl/source/control
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2015-10-15 08:13:49 +0200
committerNoel Grandin <noelgrandin@gmail.com>2015-10-16 09:11:29 +0000
commit6f1313b3d44ea54e9a331e0fc00871081fa662fe (patch)
treefa6d9b6da04daedcb63ea2a0bc8c414288ed8bc6 /vcl/source/control
parent14bf708ef586b15dffed66ffaf524baf4d8fcbfa (diff)
convert Link<> to typed
Change-Id: Icbba339dac0be31e30dff021bba06a219f8aecd6 Reviewed-on: https://gerrit.libreoffice.org/19405 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'vcl/source/control')
-rw-r--r--vcl/source/control/edit.cxx4
-rw-r--r--vcl/source/control/slider.cxx25
2 files changed, 13 insertions, 16 deletions
diff --git a/vcl/source/control/edit.cxx b/vcl/source/control/edit.cxx
index 8461583c1413..d287058916a4 100644
--- a/vcl/source/control/edit.cxx
+++ b/vcl/source/control/edit.cxx
@@ -2416,7 +2416,7 @@ void Edit::Modify()
if ( mpUpdateDataTimer )
mpUpdateDataTimer->Start();
- if ( ImplCallEventListenersAndHandler( VCLEVENT_EDIT_MODIFY, [this] () { maModifyHdl.Call(this); } ) )
+ if ( ImplCallEventListenersAndHandler( VCLEVENT_EDIT_MODIFY, [this] () { maModifyHdl.Call(*this); } ) )
// have been destroyed while calling into the handlers
return;
@@ -2435,7 +2435,7 @@ void Edit::Modify()
void Edit::UpdateData()
{
- maUpdateDataHdl.Call( this );
+ maUpdateDataHdl.Call( *this );
}
IMPL_LINK_NOARG_TYPED(Edit, ImplUpdateDataHdl, Timer *, void)
diff --git a/vcl/source/control/slider.cxx b/vcl/source/control/slider.cxx
index dd95df121deb..ef6bd776f40f 100644
--- a/vcl/source/control/slider.cxx
+++ b/vcl/source/control/slider.cxx
@@ -828,44 +828,41 @@ void Slider::Resize()
void Slider::SetLinkedField(VclPtr<NumericField> pField)
{
- ImplSetFieldLink(Link<>());
if (mpLinkedField)
+ {
+ mpLinkedField->SetModifyHdl(Link<Edit&,void>());
+ mpLinkedField->SetUpHdl(Link<SpinField&,void>());
+ mpLinkedField->SetDownHdl(Link<SpinField&,void>());
+ mpLinkedField->SetFirstHdl(Link<SpinField&,void>());
+ mpLinkedField->SetLastHdl(Link<SpinField&,void>());
mpLinkedField->SetLoseFocusHdl(Link<Control&,void>());
+ }
mpLinkedField = pField;
- ImplSetFieldLink(LINK(this, Slider, LinkedFieldModifyHdl));
if (mpLinkedField)
- mpLinkedField->SetLoseFocusHdl(LINK(this, Slider, LinkedFieldLoseFocusHdl));
-}
-
-void Slider::ImplSetFieldLink(const Link<>& rLink)
-{
- if (mpLinkedField != nullptr)
{
- mpLinkedField->SetModifyHdl(rLink);
+ mpLinkedField->SetModifyHdl(LINK(this, Slider, LinkedFieldModifyHdl));
mpLinkedField->SetUpHdl(LINK(this, Slider, LinkedFieldSpinnerHdl));
mpLinkedField->SetDownHdl(LINK(this, Slider, LinkedFieldSpinnerHdl));
mpLinkedField->SetFirstHdl(LINK(this, Slider, LinkedFieldSpinnerHdl));
mpLinkedField->SetLastHdl(LINK(this, Slider, LinkedFieldSpinnerHdl));
+ mpLinkedField->SetLoseFocusHdl(LINK(this, Slider, LinkedFieldLoseFocusHdl));
}
}
IMPL_LINK_NOARG_TYPED(Slider, LinkedFieldSpinnerHdl, SpinField&, void)
{
if (mpLinkedField)
- mpLinkedField->GetModifyHdl().Call(&mpLinkedField);
+ SetThumbPos(mpLinkedField->GetValue());
}
IMPL_LINK_NOARG_TYPED(Slider, LinkedFieldLoseFocusHdl, Control&, void)
{
if (mpLinkedField)
SetThumbPos(mpLinkedField->GetValue());
}
-
-IMPL_LINK(Slider, LinkedFieldModifyHdl, NumericField*, /*pField*/)
+IMPL_LINK_NOARG_TYPED(Slider, LinkedFieldModifyHdl, Edit&, void)
{
if (mpLinkedField)
SetThumbPos(mpLinkedField->GetValue());
-
- return 0;
}
void Slider::RequestHelp( const HelpEvent& rHEvt )