From b56850ecbc9c10c6226cdae0d42443933b24dff7 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Thu, 17 Sep 2015 09:49:07 +0200 Subject: convert Link<> to typed Change-Id: I93988860f409e13d99aaec06a0b0833b3814da24 --- formula/source/ui/dlg/formula.cxx | 18 ++++++++---------- formula/source/ui/dlg/parawin.cxx | 4 ++-- formula/source/ui/dlg/parawin.hxx | 9 ++++----- 3 files changed, 14 insertions(+), 17 deletions(-) (limited to 'formula') diff --git a/formula/source/ui/dlg/formula.cxx b/formula/source/ui/dlg/formula.cxx index eb1b6a7171e5..a435d1caad57 100644 --- a/formula/source/ui/dlg/formula.cxx +++ b/formula/source/ui/dlg/formula.cxx @@ -121,8 +121,8 @@ public: const FormulaHelper& GetFormulaHelper() const { return m_aFormulaHelper;} uno::Reference< sheet::XFormulaOpCodeMapper > GetFormulaOpCodeMapper() const; - DECL_LINK( ModifyHdl, ParaWin* ); - DECL_LINK( FxHdl, ParaWin* ); + DECL_LINK_TYPED( ModifyHdl, ParaWin&, void ); + DECL_LINK_TYPED( FxHdl, ParaWin&, void ); DECL_LINK_TYPED( MatrixHdl, Button*, void ); DECL_LINK(FormulaHdl, void *); @@ -1239,16 +1239,16 @@ void FormulaDlg_Impl::SaveArg( sal_uInt16 nEd ) } } -IMPL_LINK( FormulaDlg_Impl, FxHdl, ParaWin*, pPtr ) +IMPL_LINK_TYPED( FormulaDlg_Impl, FxHdl, ParaWin&, rPtr, void ) { - if(pPtr==pParaWin) + if(&rPtr==pParaWin) { m_pBtnForward->Enable(true); //@ In order to be able to input another function. m_pTabCtrl->SetCurPageId(TP_FUNCTION); OUString aUndoStr = m_pHelper->getCurrentFormula(); // it will be added before a ";" FormEditData* pData = m_pHelper->getFormEditData(); - if (!pData) return 0; + if (!pData) return; sal_uInt16 nArgNo = pParaWin->GetActiveLine(); nEdFocus=nArgNo; @@ -1271,12 +1271,11 @@ IMPL_LINK( FormulaDlg_Impl, FxHdl, ParaWin*, pPtr ) FillDialog(false); pFuncPage->SetFocus(); //There Parawin is not visible anymore } - return 0; } -IMPL_LINK( FormulaDlg_Impl, ModifyHdl, ParaWin*, pPtr ) +IMPL_LINK_TYPED( FormulaDlg_Impl, ModifyHdl, ParaWin&, rPtr, void ) { - if(pPtr==pParaWin) + if(&rPtr==pParaWin) { SaveArg(pParaWin->GetActiveLine()); UpdateValues(); @@ -1284,7 +1283,6 @@ IMPL_LINK( FormulaDlg_Impl, ModifyHdl, ParaWin*, pPtr ) UpdateSelection(); CalcStruct(pMEdit->GetText()); } - return 0; } IMPL_LINK_NOARG(FormulaDlg_Impl, FormulaHdl) @@ -1508,7 +1506,7 @@ void FormulaDlg_Impl::RefInputDoneAfter( bool bForced ) sal_uInt16 nPrivActiv = pParaWin->GetActiveLine(); pParaWin->SetArgument( nPrivActiv, m_pEdRef->GetText() ); - ModifyHdl( pParaWin ); + ModifyHdl( *pParaWin ); pTheRefEdit = NULL; } m_pParent->SetText( aTitle1 ); diff --git a/formula/source/ui/dlg/parawin.cxx b/formula/source/ui/dlg/parawin.cxx index de55090f6528..05a0b71ef646 100644 --- a/formula/source/ui/dlg/parawin.cxx +++ b/formula/source/ui/dlg/parawin.cxx @@ -538,12 +538,12 @@ void ParaWin::SliderMoved() void ParaWin::ArgumentModified() { - aArgModifiedLink.Call(this); + aArgModifiedLink.Call(*this); } void ParaWin::FxClick() { - aFxLink.Call(this); + aFxLink.Call(*this); } diff --git a/formula/source/ui/dlg/parawin.hxx b/formula/source/ui/dlg/parawin.hxx index fc0241fc9e8a..894b7de2ec9c 100644 --- a/formula/source/ui/dlg/parawin.hxx +++ b/formula/source/ui/dlg/parawin.hxx @@ -45,8 +45,8 @@ class ParaWin : public TabPage { private: OModuleClient m_aModuleClient; - Link<> aFxLink; - Link<> aArgModifiedLink; + Link aFxLink; + Link aArgModifiedLink; ::std::vector aVisibleArgMapping; const IFunctionDescription* pFuncDesc; @@ -147,9 +147,8 @@ public: sal_uInt16 GetSliderPos(); void SetSliderPos(sal_uInt16 nSliderPos); - void SetArgModifiedHdl( const Link<>& rLink ) { aArgModifiedLink = rLink; } - - void SetFxHdl( const Link<>& rLink ) { aFxLink = rLink; } + void SetArgModifiedHdl( const Link& rLink ) { aArgModifiedLink = rLink; } + void SetFxHdl( const Link& rLink ) { aFxLink = rLink; } }; -- cgit