[Libreoffice-commits] core.git: editeng/source include/editeng sc/source sd/source sw/inc sw/source

Noel Grandin noelgrandin at gmail.com
Tue Sep 22 11:55:25 PDT 2015


 editeng/source/editeng/editview.cxx           |   10 +++++-----
 editeng/source/outliner/outlvw.cxx            |    2 +-
 include/editeng/editview.hxx                  |    2 +-
 include/editeng/outliner.hxx                  |    2 +-
 sc/source/ui/inc/gridwin.hxx                  |    2 +-
 sc/source/ui/view/gridwin.cxx                 |    7 +++----
 sd/source/ui/annotations/annotationwindow.hxx |    2 +-
 sd/source/ui/docshell/docshell.cxx            |    5 ++---
 sd/source/ui/inc/DrawDocShell.hxx             |    4 ++--
 sd/source/ui/view/drviews4.cxx                |    2 +-
 sd/source/ui/view/outlnvsh.cxx                |    2 +-
 sw/inc/view.hxx                               |    2 +-
 sw/source/uibase/docvw/SidebarTxtControl.cxx  |    7 +++----
 sw/source/uibase/docvw/SidebarTxtControl.hxx  |    2 +-
 sw/source/uibase/uiview/viewdraw.cxx          |    7 +++----
 15 files changed, 27 insertions(+), 31 deletions(-)

New commits:
commit a19f981ea1c31a9a3af4a9368dc50f045701a047
Author: Noel Grandin <noelgrandin at gmail.com>
Date:   Tue Sep 22 12:26:29 2015 +0200

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

diff --git a/editeng/source/editeng/editview.cxx b/editeng/source/editeng/editview.cxx
index c9f1e42..57ec994 100644
--- a/editeng/source/editeng/editview.cxx
+++ b/editeng/source/editeng/editview.cxx
@@ -760,7 +760,7 @@ bool EditView::IsWrongSpelledWordAtPos( const Point& rPosPixel, bool bMarkIfWron
     return pImpEditView->IsWrongSpelledWord( aPaM , bMarkIfWrong );
 }
 
-void EditView::ExecuteSpellPopup( const Point& rPosPixel, Link<>* pCallBack )
+void EditView::ExecuteSpellPopup( const Point& rPosPixel, Link<SpellCallbackInfo&,void>* pCallBack )
 {
 
     Point aPos ( pImpEditView->GetWindow()->PixelToLogic( rPosPixel ) );
@@ -938,7 +938,7 @@ void EditView::ExecuteSpellPopup( const Point& rPosPixel, Link<>* pCallBack )
             if ( pCallBack )
             {
                 SpellCallbackInfo aInf( SpellCallbackCommand::IGNOREWORD, aWord );
-                pCallBack->Call( &aInf );
+                pCallBack->Call( aInf );
             }
             SetSelection( aOldSel );
         }
@@ -967,7 +967,7 @@ void EditView::ExecuteSpellPopup( const Point& rPosPixel, Link<>* pCallBack )
             if ( pCallBack )
             {
                 SpellCallbackInfo aInf( ( nId == MN_WORDLANGUAGE ) ? SpellCallbackCommand::WORDLANGUAGE : SpellCallbackCommand::PARALANGUAGE, nLangToUse );
-                pCallBack->Call( &aInf );
+                pCallBack->Call( aInf );
             }
             SetSelection( aOldSel );
         }
@@ -986,7 +986,7 @@ void EditView::ExecuteSpellPopup( const Point& rPosPixel, Link<>* pCallBack )
             else
             {
                 SpellCallbackInfo aInf( SpellCallbackCommand::STARTSPELLDLG, OUString() );
-                pCallBack->Call( &aInf );
+                pCallBack->Call( aInf );
             }
         }
         else if ( nId >= MN_DICTSTART || nId == MN_INSERT_SINGLE )
@@ -1014,7 +1014,7 @@ void EditView::ExecuteSpellPopup( const Point& rPosPixel, Link<>* pCallBack )
             if ( pCallBack )
             {
                 SpellCallbackInfo aInf( SpellCallbackCommand::ADDTODICTIONARY, aSelected );
-                pCallBack->Call( &aInf );
+                pCallBack->Call( aInf );
             }
             SetSelection( aOldSel );
         }
diff --git a/editeng/source/outliner/outlvw.cxx b/editeng/source/outliner/outlvw.cxx
index edf617f..966efed 100644
--- a/editeng/source/outliner/outlvw.cxx
+++ b/editeng/source/outliner/outlvw.cxx
@@ -1385,7 +1385,7 @@ bool OutlinerView::IsWrongSpelledWordAtPos( const Point& rPosPixel, bool bMarkIf
     return pEditView->IsWrongSpelledWordAtPos( rPosPixel, bMarkIfWrong );
 }
 
-void OutlinerView::ExecuteSpellPopup( const Point& rPosPixel, Link<>* pStartDlg )
+void OutlinerView::ExecuteSpellPopup( const Point& rPosPixel, Link<SpellCallbackInfo&,void>* pStartDlg )
 {
     pEditView->ExecuteSpellPopup( rPosPixel, pStartDlg );
 }
diff --git a/include/editeng/editview.hxx b/include/editeng/editview.hxx
index 0467638..210e816 100644
--- a/include/editeng/editview.hxx
+++ b/include/editeng/editview.hxx
@@ -217,7 +217,7 @@ public:
 
     bool            IsCursorAtWrongSpelledWord( bool bMarkIfWrong = false );
     bool            IsWrongSpelledWordAtPos( const Point& rPosPixel, bool bMarkIfWrong = false );
-    void            ExecuteSpellPopup( const Point& rPosPixel, Link<>* pCallBack = 0 );
+    void            ExecuteSpellPopup( const Point& rPosPixel, Link<SpellCallbackInfo&,void>* pCallBack = 0 );
 
     void                InsertField( const SvxFieldItem& rFld );
     const SvxFieldItem* GetFieldUnderMousePointer() const;
diff --git a/include/editeng/outliner.hxx b/include/editeng/outliner.hxx
index 16ab77c..c7cc676 100644
--- a/include/editeng/outliner.hxx
+++ b/include/editeng/outliner.hxx
@@ -368,7 +368,7 @@ public:
 
     bool        IsCursorAtWrongSpelledWord( bool bMarkIfWrong = false );
     bool        IsWrongSpelledWordAtPos( const Point& rPosPixel, bool bMarkIfWrong = false );
-    void        ExecuteSpellPopup( const Point& rPosPixel, Link<>* pCallBack = 0 );
+    void        ExecuteSpellPopup( const Point& rPosPixel, Link<SpellCallbackInfo&,void>* pCallBack = 0 );
 
     void        SetInvalidateMore( sal_uInt16 nPixel );
     sal_uInt16  GetInvalidateMore() const;
diff --git a/sc/source/ui/inc/gridwin.hxx b/sc/source/ui/inc/gridwin.hxx
index 5bcbac5..b9af88a 100644
--- a/sc/source/ui/inc/gridwin.hxx
+++ b/sc/source/ui/inc/gridwin.hxx
@@ -201,7 +201,7 @@ class ScGridWindow : public vcl::Window, public DropTargetHelper, public DragSou
     bool                    bListValButton:1;
 
     DECL_LINK_TYPED( PopupModeEndHdl, FloatingWindow*, void );
-    DECL_LINK( PopupSpellingHdl, SpellCallbackInfo* );
+    DECL_LINK_TYPED( PopupSpellingHdl, SpellCallbackInfo&, void );
 
     bool            TestMouse( const MouseEvent& rMEvt, bool bAction );
 
diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx
index d8bbe92..cf5d7b6 100644
--- a/sc/source/ui/view/gridwin.cxx
+++ b/sc/source/ui/view/gridwin.cxx
@@ -584,11 +584,10 @@ IMPL_LINK_NOARG_TYPED(ScGridWindow, PopupModeEndHdl, FloatingWindow*, void)
     GrabFocus();
 }
 
-IMPL_LINK( ScGridWindow, PopupSpellingHdl, SpellCallbackInfo*, pInfo )
+IMPL_LINK_TYPED( ScGridWindow, PopupSpellingHdl, SpellCallbackInfo&, rInfo, void )
 {
-    if( pInfo->nCommand == SpellCallbackCommand::STARTSPELLDLG )
+    if( rInfo.nCommand == SpellCallbackCommand::STARTSPELLDLG )
         pViewData->GetDispatcher().Execute( SID_SPELL_DIALOG, SfxCallMode::ASYNCHRON );
-    return 0;
 }
 
 void ScGridWindow::ExecPageFieldSelect( SCCOL nCol, SCROW nRow, bool bHasSelection, const OUString& rStr )
@@ -3180,7 +3179,7 @@ void ScGridWindow::Command( const CommandEvent& rCEvt )
                 if (pHdl)
                     pHdl->SetModified();
 
-                Link<> aLink = LINK( this, ScGridWindow, PopupSpellingHdl );
+                Link<SpellCallbackInfo&,void> aLink = LINK( this, ScGridWindow, PopupSpellingHdl );
                 pEditView->ExecuteSpellPopup( aMenuPos, &aLink );
 
                 bDone = true;
diff --git a/sd/source/ui/annotations/annotationwindow.hxx b/sd/source/ui/annotations/annotationwindow.hxx
index 640f3d4..de129e1 100644
--- a/sd/source/ui/annotations/annotationwindow.hxx
+++ b/sd/source/ui/annotations/annotationwindow.hxx
@@ -135,7 +135,7 @@ class AnnotationWindow : public FloatingWindow
 
         void            ToggleInsMode();
 
-        DECL_LINK( OnlineSpellCallback, SpellCallbackInfo*);
+        DECL_LINK_TYPED( OnlineSpellCallback, SpellCallbackInfo&, void );
 
         virtual void    Deactivate() SAL_OVERRIDE;
         virtual void    Paint( vcl::RenderContext& /*rRenderContext*/, const Rectangle& rRect) SAL_OVERRIDE;
diff --git a/sd/source/ui/docshell/docshell.cxx b/sd/source/ui/docshell/docshell.cxx
index ca32796..b936ca7 100644
--- a/sd/source/ui/docshell/docshell.cxx
+++ b/sd/source/ui/docshell/docshell.cxx
@@ -421,7 +421,7 @@ void DrawDocShell::SetModified( bool bSet /* = true */ )
  */
 // ExecuteSpellPopup now handled by DrawDocShell. This is necessary
 // to get hands on the outliner and the text object.
-IMPL_LINK(DrawDocShell, OnlineSpellCallback, SpellCallbackInfo*, pInfo)
+IMPL_LINK_TYPED(DrawDocShell, OnlineSpellCallback, SpellCallbackInfo&, rInfo, void)
 {
     SdrObject* pObj = NULL;
     SdrOutliner* pOutl = NULL;
@@ -432,8 +432,7 @@ IMPL_LINK(DrawDocShell, OnlineSpellCallback, SpellCallbackInfo*, pInfo)
         pObj = GetViewShell()->GetView()->GetTextEditObject();
     }
 
-    mpDoc->ImpOnlineSpellCallback(pInfo, pObj, pOutl);
-    return 0;
+    mpDoc->ImpOnlineSpellCallback(&rInfo, pObj, pOutl);
 }
 
 void DrawDocShell::ClearUndoBuffer()
diff --git a/sd/source/ui/inc/DrawDocShell.hxx b/sd/source/ui/inc/DrawDocShell.hxx
index 5b82479..6ba5aee 100644
--- a/sd/source/ui/inc/DrawDocShell.hxx
+++ b/sd/source/ui/inc/DrawDocShell.hxx
@@ -199,8 +199,8 @@ public:
 
     DECL_LINK( RenameSlideHdl, AbstractSvxNameDialog* );
 
-                            // ExecuteSpellPopup now handled by DrawDocShell
-                            DECL_LINK( OnlineSpellCallback, SpellCallbackInfo* );
+    // ExecuteSpellPopup now handled by DrawDocShell
+    DECL_LINK_TYPED( OnlineSpellCallback, SpellCallbackInfo&, void );
 
     void                    ClearUndoBuffer();
 
diff --git a/sd/source/ui/view/drviews4.cxx b/sd/source/ui/view/drviews4.cxx
index 43dab6b..f02fefc 100644
--- a/sd/source/ui/view/drviews4.cxx
+++ b/sd/source/ui/view/drviews4.cxx
@@ -609,7 +609,7 @@ void DrawViewShell::Command(const CommandEvent& rCEvt, ::sd::Window* pWin)
                                     ( !rCEvt.IsMouseEvent() && pOutlinerView->IsCursorAtWrongSpelledWord() ) )
                                 {
                                     // Popup for Online-Spelling now handled by DrawDocShell
-                                    Link<> aLink = LINK(GetDocSh(), DrawDocShell, OnlineSpellCallback);
+                                    Link<SpellCallbackInfo&,void> aLink = LINK(GetDocSh(), DrawDocShell, OnlineSpellCallback);
 
                                     if( !rCEvt.IsMouseEvent() )
                                     {
diff --git a/sd/source/ui/view/outlnvsh.cxx b/sd/source/ui/view/outlnvsh.cxx
index a690de1..4f2c9f6 100644
--- a/sd/source/ui/view/outlnvsh.cxx
+++ b/sd/source/ui/view/outlnvsh.cxx
@@ -1374,7 +1374,7 @@ void OutlineViewShell::Command( const CommandEvent& rCEvt, ::sd::Window* pWin )
         if (pOLV && pOLV->IsWrongSpelledWordAtPos(aPos))
         {
             // Popup for Online-Spelling now handled by DrawDocShell
-            Link<> aLink = LINK(GetDocSh(), DrawDocShell, OnlineSpellCallback);
+            Link<SpellCallbackInfo&,void> aLink = LINK(GetDocSh(), DrawDocShell, OnlineSpellCallback);
 
             pOLV->ExecuteSpellPopup(aPos, &aLink);
         }
diff --git a/sw/inc/view.hxx b/sw/inc/view.hxx
index d4227e2..8a2d5b7 100644
--- a/sw/inc/view.hxx
+++ b/sw/inc/view.hxx
@@ -433,7 +433,7 @@ public:
     void                ExecFieldPopup( const Point& rPt, sw::mark::IFieldmark *fieldBM );
     bool            ExecSmartTagPopup( const Point& rPt );
 
-    DECL_LINK( OnlineSpellCallback, SpellCallbackInfo*);
+    DECL_LINK_TYPED( OnlineSpellCallback, SpellCallbackInfo&, void );
     bool            ExecDrwTextSpellPopup(const Point& rPt);
 
     void            SetTabColFromDocPos( const Point &rPt ) { m_aTabColFromDocPos = rPt; }
diff --git a/sw/source/uibase/docvw/SidebarTxtControl.cxx b/sw/source/uibase/docvw/SidebarTxtControl.cxx
index 1393fba..d9d84f1 100644
--- a/sw/source/uibase/docvw/SidebarTxtControl.cxx
+++ b/sw/source/uibase/docvw/SidebarTxtControl.cxx
@@ -317,13 +317,12 @@ void SidebarTextControl::MouseButtonUp( const MouseEvent& rMEvt )
         GetTextView()->MouseButtonUp( rMEvt );
 }
 
-IMPL_LINK( SidebarTextControl, OnlineSpellCallback, SpellCallbackInfo*, pInfo )
+IMPL_LINK_TYPED( SidebarTextControl, OnlineSpellCallback, SpellCallbackInfo&, rInfo, void )
 {
-    if ( pInfo->nCommand == SpellCallbackCommand::STARTSPELLDLG )
+    if ( rInfo.nCommand == SpellCallbackCommand::STARTSPELLDLG )
     {
         mrDocView.GetViewFrame()->GetDispatcher()->Execute( FN_SPELL_GRAMMAR_DIALOG, SfxCallMode::ASYNCHRON);
     }
-    return 0;
 }
 
 IMPL_LINK_TYPED( SidebarTextControl, Select, Menu*, pSelMenu, bool )
@@ -340,7 +339,7 @@ void SidebarTextControl::Command( const CommandEvent& rCEvt )
              GetTextView() &&
              GetTextView()->IsWrongSpelledWordAtPos( rCEvt.GetMousePosPixel(), true ))
         {
-            Link<> aLink = LINK(this, SidebarTextControl, OnlineSpellCallback);
+            Link<SpellCallbackInfo&,void> aLink = LINK(this, SidebarTextControl, OnlineSpellCallback);
             GetTextView()->ExecuteSpellPopup(rCEvt.GetMousePosPixel(),&aLink);
         }
         else
diff --git a/sw/source/uibase/docvw/SidebarTxtControl.hxx b/sw/source/uibase/docvw/SidebarTxtControl.hxx
index 7474585..99992b4 100644
--- a/sw/source/uibase/docvw/SidebarTxtControl.hxx
+++ b/sw/source/uibase/docvw/SidebarTxtControl.hxx
@@ -64,7 +64,7 @@ class SidebarTextControl : public Control
 
         OutlinerView* GetTextView() const;
 
-        DECL_LINK( OnlineSpellCallback, SpellCallbackInfo*);
+        DECL_LINK_TYPED( OnlineSpellCallback, SpellCallbackInfo&, void );
 
         virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > CreateAccessible() SAL_OVERRIDE;
 
diff --git a/sw/source/uibase/uiview/viewdraw.cxx b/sw/source/uibase/uiview/viewdraw.cxx
index d342512..5001cee 100644
--- a/sw/source/uibase/uiview/viewdraw.cxx
+++ b/sw/source/uibase/uiview/viewdraw.cxx
@@ -725,11 +725,10 @@ bool SwView::HasOnlyObj(SdrObject *pSdrObj, sal_uInt32 eObjInventor) const
 }
 
 //#i87414# mod
-IMPL_LINK(SwView, OnlineSpellCallback, SpellCallbackInfo*, pInfo)
+IMPL_LINK_TYPED(SwView, OnlineSpellCallback, SpellCallbackInfo&, rInfo, void)
 {
-    if (pInfo->nCommand == SpellCallbackCommand::STARTSPELLDLG)
+    if (rInfo.nCommand == SpellCallbackCommand::STARTSPELLDLG)
         GetViewFrame()->GetDispatcher()->Execute( FN_SPELL_GRAMMAR_DIALOG, SfxCallMode::ASYNCHRON);
-    return 0;
 }
 
 bool SwView::ExecDrwTextSpellPopup(const Point& rPt)
@@ -742,7 +741,7 @@ bool SwView::ExecDrwTextSpellPopup(const Point& rPt)
     if (pOLV->IsWrongSpelledWordAtPos( aPos ))
     {
         bRet = true;
-        Link<> aLink = LINK(this, SwView, OnlineSpellCallback);
+        Link<SpellCallbackInfo&,void> aLink = LINK(this, SwView, OnlineSpellCallback);
         pOLV->ExecuteSpellPopup( aPos,&aLink );
     }
     return bRet;


More information about the Libreoffice-commits mailing list