[Libreoffice-commits] core.git: cui/source

Noel Grandin noelgrandin at gmail.com
Fri Sep 25 22:28:49 PDT 2015


 cui/source/inc/optdict.hxx     |   11 ++++++-----
 cui/source/options/optdict.cxx |   20 ++++++++++++--------
 2 files changed, 18 insertions(+), 13 deletions(-)

New commits:
commit da764e8612599eaaaed068941939adb08d23b5db
Author: Noel Grandin <noelgrandin at gmail.com>
Date:   Fri Sep 25 11:45:59 2015 +0200

    convert Link<> to typed
    
    Change-Id: I98ba7a9e8d7d7f6791045f415968738d01e9a919
    Reviewed-on: https://gerrit.libreoffice.org/18860
    Reviewed-by: Noel Grandin <noelgrandin at gmail.com>
    Tested-by: Noel Grandin <noelgrandin at gmail.com>

diff --git a/cui/source/inc/optdict.hxx b/cui/source/inc/optdict.hxx
index 1722616..fe04cab 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 dc0b99b..802763a 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)


More information about the Libreoffice-commits mailing list