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

Noel Grandin noelgrandin at gmail.com
Wed Sep 23 06:05:15 PDT 2015


 sw/source/ui/index/cnttab.cxx       |   24 +++++++++++-------------
 sw/source/uibase/inc/swuicnttab.hxx |    2 +-
 2 files changed, 12 insertions(+), 14 deletions(-)

New commits:
commit 4842877a91622f69ed0a861b202cf8e345119549
Author: Noel Grandin <noelgrandin at gmail.com>
Date:   Tue Sep 22 21:43:00 2015 +0200

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

diff --git a/sw/source/ui/index/cnttab.cxx b/sw/source/ui/index/cnttab.cxx
index 2f41944..e663612 100644
--- a/sw/source/ui/index/cnttab.cxx
+++ b/sw/source/ui/index/cnttab.cxx
@@ -1516,9 +1516,9 @@ IMPL_LINK_TYPED(SwTOXSelectTabPage, MenuExecuteHdl, Menu*, pMenu, bool)
 
 class SwTOXEdit : public Edit
 {
-    SwFormToken aFormToken;
-    Link<>      aPrevNextControlLink;
-    bool     bNextControl;
+    SwFormToken           aFormToken;
+    Link<SwTOXEdit&,void> aPrevNextControlLink;
+    bool                  bNextControl;
     VclPtr<SwTokenWindow> m_pParent;
 public:
     SwTOXEdit( vcl::Window* pParent, SwTokenWindow* pTokenWin,
@@ -1536,7 +1536,7 @@ public:
     virtual void    RequestHelp( const HelpEvent& rHEvt ) SAL_OVERRIDE;
 
     bool    IsNextControl() const {return bNextControl;}
-    void SetPrevNextLink( const Link<>& rLink ) {aPrevNextControlLink = rLink;}
+    void SetPrevNextLink( const Link<SwTOXEdit&,void>& rLink ) {aPrevNextControlLink = rLink;}
 
     const SwFormToken& GetFormToken()
         {
@@ -1586,7 +1586,7 @@ void SwTOXEdit::KeyInput( const KeyEvent& rKEvt )
             }
         }
         if(bCall && aPrevNextControlLink.IsSet())
-            aPrevNextControlLink.Call(this);
+            aPrevNextControlLink.Call(*this);
 
     }
     Edit::KeyInput(rKEvt);
@@ -3463,21 +3463,21 @@ IMPL_LINK(SwTokenWindow, EditResize, Edit*, pEdit)
     return 0;
 }
 
-IMPL_LINK(SwTokenWindow, NextItemHdl, SwTOXEdit*,  pEdit)
+IMPL_LINK_TYPED(SwTokenWindow, NextItemHdl, SwTOXEdit&, rEdit, void)
 {
-    ctrl_iterator it = std::find(aControlList.begin(),aControlList.end(),pEdit);
+    ctrl_iterator it = std::find(aControlList.begin(),aControlList.end(),&rEdit);
 
     if (it == aControlList.end())
-        return 0;
+        return;
 
     ctrl_iterator itTest = it;
     ++itTest;
 
-    if ((it != aControlList.begin() && !pEdit->IsNextControl()) ||
-        (itTest != aControlList.end() && pEdit->IsNextControl()))
+    if ((it != aControlList.begin() && !rEdit.IsNextControl()) ||
+        (itTest != aControlList.end() && rEdit.IsNextControl()))
     {
         ctrl_iterator iterFocus = it;
-        pEdit->IsNextControl() ? ++iterFocus : --iterFocus;
+        rEdit.IsNextControl() ? ++iterFocus : --iterFocus;
 
         Control *pCtrlFocus = *iterFocus;
         pCtrlFocus->GrabFocus();
@@ -3485,8 +3485,6 @@ IMPL_LINK(SwTokenWindow, NextItemHdl, SwTOXEdit*,  pEdit)
 
         AdjustScrolling();
     }
-
-    return 0;
 }
 
 IMPL_LINK(SwTokenWindow, TbxFocusHdl, SwTOXEdit*, pEdit)
diff --git a/sw/source/uibase/inc/swuicnttab.hxx b/sw/source/uibase/inc/swuicnttab.hxx
index f65bc91..e395ad2 100644
--- a/sw/source/uibase/inc/swuicnttab.hxx
+++ b/sw/source/uibase/inc/swuicnttab.hxx
@@ -268,7 +268,7 @@ class SwTokenWindow : public VclHBox, public VclBuilderContainer
     VclPtr<SwTOXEntryTabPage>  m_pParent;
 
     DECL_LINK(EditResize, Edit*);
-    DECL_LINK(NextItemHdl, SwTOXEdit* );
+    DECL_LINK_TYPED(NextItemHdl, SwTOXEdit&, void );
     DECL_LINK(TbxFocusHdl, SwTOXEdit* );
     DECL_LINK(NextItemBtnHdl, SwTOXButton* );
     DECL_LINK(TbxFocusBtnHdl, SwTOXButton* );


More information about the Libreoffice-commits mailing list