summaryrefslogtreecommitdiff
path: root/cui
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2015-09-25 11:45:59 +0200
committerNoel Grandin <noelgrandin@gmail.com>2015-09-26 05:28:18 +0000
commitda764e8612599eaaaed068941939adb08d23b5db (patch)
tree3adc8b7b29caf3c6fdfd3deee35c42c343ab2355 /cui
parent73b158e00177b7abd3f0c43dfdc3c3de1321e212 (diff)
convert Link<> to typed
Change-Id: I98ba7a9e8d7d7f6791045f415968738d01e9a919 Reviewed-on: https://gerrit.libreoffice.org/18860 Reviewed-by: Noel Grandin <noelgrandin@gmail.com> Tested-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'cui')
-rw-r--r--cui/source/inc/optdict.hxx11
-rw-r--r--cui/source/options/optdict.cxx20
2 files changed, 18 insertions, 13 deletions
diff --git a/cui/source/inc/optdict.hxx b/cui/source/inc/optdict.hxx
index 17226165297d..fe04cab545cd 100644
--- a/cui/source/inc/optdict.hxx
+++ b/cui/source/inc/optdict.hxx
@@ -78,8 +78,8 @@ public:
class SvxDictEdit : public Edit
{
- Link<> aActionLink;
- bool bSpaces;
+ Link<SvxDictEdit&,bool> aActionLink;
+ bool bSpaces;
public:
SvxDictEdit(vcl::Window* pParent, const ResId& rResId) :
@@ -87,7 +87,7 @@ class SvxDictEdit : public Edit
SvxDictEdit(vcl::Window* pParent, WinBits aWB) :
Edit(pParent, aWB), bSpaces(false){}
- void SetActionHdl( const Link<>& rLink )
+ void SetActionHdl( const Link<SvxDictEdit&,bool>& rLink )
{ aActionLink = rLink;}
void SetSpaces(bool bSet)
@@ -132,9 +132,10 @@ private:
DECL_LINK(SelectBookHdl_Impl, void *);
DECL_LINK(SelectLangHdl_Impl, void *);
DECL_LINK_TYPED(SelectHdl, SvTreeListBox*, void);
- DECL_LINK_TYPED(NewDelHdl, Button*, void);
- DECL_LINK(NewDelActionHdl, PushButton*);
+ DECL_LINK_TYPED(NewDelButtonHdl, Button*, void);
+ DECL_LINK_TYPED(NewDelActionHdl, SvxDictEdit&, bool);
DECL_LINK(ModifyHdl, Edit*);
+ bool NewDelHdl(void*);
void ShowWords_Impl( sal_uInt16 nId );
diff --git a/cui/source/options/optdict.cxx b/cui/source/options/optdict.cxx
index dc0b99b1af0d..802763a5ca2e 100644
--- a/cui/source/options/optdict.cxx
+++ b/cui/source/options/optdict.cxx
@@ -261,9 +261,9 @@ SvxEditDictionaryDialog::SvxEditDictionaryDialog(
nWidth=pWordED->GetSizePixel().Width();
// install handler
pNewReplacePB->SetClickHdl(
- LINK( this, SvxEditDictionaryDialog, NewDelHdl));
+ LINK( this, SvxEditDictionaryDialog, NewDelButtonHdl));
pDeletePB->SetClickHdl(
- LINK( this, SvxEditDictionaryDialog, NewDelHdl));
+ LINK( this, SvxEditDictionaryDialog, NewDelButtonHdl));
pLangLB->SetSelectHdl(
LINK( this, SvxEditDictionaryDialog, SelectLangHdl_Impl ) );
@@ -591,12 +591,16 @@ IMPL_LINK_TYPED(SvxEditDictionaryDialog, SelectHdl, SvTreeListBox*, pBox, void)
-IMPL_LINK_TYPED(SvxEditDictionaryDialog, NewDelHdl, Button*, pBtn, void)
+IMPL_LINK_TYPED(SvxEditDictionaryDialog, NewDelButtonHdl, Button*, pBtn, void)
{
- NewDelActionHdl(static_cast<PushButton*>(pBtn));
+ NewDelHdl(static_cast<PushButton*>(pBtn));
}
-IMPL_LINK(SvxEditDictionaryDialog, NewDelActionHdl, PushButton*, pBtn)
+IMPL_LINK_TYPED(SvxEditDictionaryDialog, NewDelActionHdl, SvxDictEdit&, rDictEdit, bool)
+{
+ return NewDelHdl(&rDictEdit);
+}
+bool SvxEditDictionaryDialog::NewDelHdl(void* pBtn)
{
SvTreeListEntry* pEntry = pWordsLB->FirstSelected();
@@ -686,10 +690,10 @@ IMPL_LINK(SvxEditDictionaryDialog, NewDelActionHdl, PushButton*, pBtn)
{
// this can only be an enter in one of the two edit fields
// which means EndDialog() - has to be evaluated in KeyInput
- return 0;
+ return false;
}
ModifyHdl(pWordED);
- return 1;
+ return true;
}
@@ -804,7 +808,7 @@ void SvxDictEdit::KeyInput( const KeyEvent& rKEvt )
{
// if there's nothing done on enter, call the
// base class after all to close the dialog
- if(!nModifier && !aActionLink.Call(this))
+ if(!nModifier && !aActionLink.Call(*this))
Edit::KeyInput(rKEvt);
}
else if(bSpaces || aKeyCode.GetCode() != KEY_SPACE)