diff options
author | Noel Grandin <noel@peralex.com> | 2015-08-28 13:22:12 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2015-08-31 09:50:10 +0200 |
commit | 7b096a6da180bb11ffbff15c9a5358c63596cc34 (patch) | |
tree | f5330ead159ec348c0aae10855c770804bd4cba8 | |
parent | f144e591f5786f1cac177e4e6eb13795eeda2657 (diff) |
make Link<> typed
Change-Id: I8949a92792df892b7f360e6b9979c8f61c702ce3
-rw-r--r-- | forms/source/component/clickableimage.cxx | 3 | ||||
-rw-r--r-- | forms/source/component/clickableimage.hxx | 2 | ||||
-rw-r--r-- | include/sfx2/docfile.hxx | 4 | ||||
-rw-r--r-- | include/svtools/asynclink.hxx | 18 | ||||
-rw-r--r-- | sfx2/source/appl/fileobj.cxx | 8 | ||||
-rw-r--r-- | sfx2/source/appl/fileobj.hxx | 2 | ||||
-rw-r--r-- | sfx2/source/control/shell.cxx | 10 | ||||
-rw-r--r-- | sfx2/source/doc/docfile.cxx | 4 | ||||
-rw-r--r-- | svtools/source/control/inettbc.cxx | 8 |
9 files changed, 26 insertions, 33 deletions
diff --git a/forms/source/component/clickableimage.cxx b/forms/source/component/clickableimage.cxx index 7490d3953755..e0f8050371e7 100644 --- a/forms/source/component/clickableimage.cxx +++ b/forms/source/component/clickableimage.cxx @@ -827,11 +827,10 @@ namespace frm } - IMPL_LINK_NOARG( OClickableImageBaseModel, DownloadDoneLink ) + IMPL_LINK_NOARG_TYPED( OClickableImageBaseModel, DownloadDoneLink, void*, void ) { ::osl::MutexGuard aGuard( m_aMutex ); DownloadDone(); - return 0; } diff --git a/forms/source/component/clickableimage.hxx b/forms/source/component/clickableimage.hxx index 7a26a97f8d94..30df1ce2a9c5 100644 --- a/forms/source/component/clickableimage.hxx +++ b/forms/source/component/clickableimage.hxx @@ -77,7 +77,7 @@ namespace frm ::com::sun::star::uno::Reference< ::com::sun::star::form::submission::XSubmission > m_xSubmissionDelegate; - DECL_LINK( DownloadDoneLink, void* ); + DECL_LINK_TYPED( DownloadDoneLink, void*, void ); inline ImageProducer* GetImageProducer() { return m_pProducer; } diff --git a/include/sfx2/docfile.hxx b/include/sfx2/docfile.hxx index d5404e254404..c3c9e94bbdb6 100644 --- a/include/sfx2/docfile.hxx +++ b/include/sfx2/docfile.hxx @@ -134,8 +134,8 @@ public: const OUString& GetPhysicalName() const; SAL_WARN_UNUSED_RESULT bool IsRemote() const; SAL_WARN_UNUSED_RESULT bool IsOpen() const; // { return aStorage.Is() || pInStream; } - void Download( const Link<>& aLink = Link<>()); - void SetDoneLink( const Link<>& rLink ); + void Download( const Link<void*,void>& aLink = Link<void*,void>()); + void SetDoneLink( const Link<void*,void>& rLink ); sal_uInt32 GetErrorCode() const; sal_uInt32 GetError() const diff --git a/include/svtools/asynclink.hxx b/include/svtools/asynclink.hxx index 747b0c38678d..f0fc74cec2af 100644 --- a/include/svtools/asynclink.hxx +++ b/include/svtools/asynclink.hxx @@ -32,20 +32,20 @@ namespace svtools { class SVT_DLLPUBLIC AsynchronLink { - Link<> _aLink; - ImplSVEvent * _nEventId; - Idle* _pIdle; - bool _bInCall; - bool* _pDeleted; - void* _pArg; - ::osl::Mutex* _pMutex; + Link<void*,void> _aLink; + ImplSVEvent* _nEventId; + Idle* _pIdle; + bool _bInCall; + bool* _pDeleted; + void* _pArg; + ::osl::Mutex* _pMutex; DECL_DLLPRIVATE_LINK_TYPED( HandleCall_Idle, Idle*, void ); DECL_DLLPRIVATE_LINK_TYPED( HandleCall_PostUserEvent, void*, void ); SVT_DLLPRIVATE void Call_Impl( void* pArg ); public: - AsynchronLink( const Link<>& rLink ) + AsynchronLink( const Link<void*,void>& rLink ) : _aLink( rLink ) , _nEventId( 0 ) , _pIdle( 0 ) @@ -65,7 +65,7 @@ public: ~AsynchronLink(); void CreateMutex(); - void operator=( const Link<>& rLink ) { _aLink = rLink; } + void operator=( const Link<void*,void>& rLink ) { _aLink = rLink; } void Call( void* pObj, bool bAllowDoubles = false, bool bUseTimer = false ); void ClearPendingCall( ); }; diff --git a/sfx2/source/appl/fileobj.cxx b/sfx2/source/appl/fileobj.cxx index a70005105749..b8c28b8aba09 100644 --- a/sfx2/source/appl/fileobj.cxx +++ b/sfx2/source/appl/fileobj.cxx @@ -68,7 +68,7 @@ SvFileObject::~SvFileObject() { if (xMed.Is()) { - xMed->SetDoneLink( Link<>() ); + xMed->SetDoneLink( Link<void*,void>() ); xMed.Clear(); } if (nPostUserEventId) @@ -463,7 +463,7 @@ void SvFileObject::Edit( vcl::Window* pParent, sfx2::SvBaseLink* pLink, const Li } } -IMPL_LINK_NOARG( SvFileObject, LoadGrfReady_Impl ) +IMPL_LINK_NOARG_TYPED( SvFileObject, LoadGrfReady_Impl, void*, void ) { // When we come form here there it can not be an error no more. bLoadError = false; @@ -485,7 +485,7 @@ IMPL_LINK_NOARG( SvFileObject, LoadGrfReady_Impl ) bLoadAgain = true; if( xMed.Is() ) { - xMed->SetDoneLink( Link<>() ); + xMed->SetDoneLink( Link<void*,void>() ); pDelMed = new SfxMediumRef(xMed); nPostUserEventId = Application::PostUserEvent( LINK( this, SvFileObject, DelMedium_Impl ), @@ -493,8 +493,6 @@ IMPL_LINK_NOARG( SvFileObject, LoadGrfReady_Impl ) xMed.Clear(); } } - - return 0; } IMPL_LINK_TYPED( SvFileObject, DelMedium_Impl, void*, p, void ) diff --git a/sfx2/source/appl/fileobj.hxx b/sfx2/source/appl/fileobj.hxx index 6bdc7a15a526..c90da04e667d 100644 --- a/sfx2/source/appl/fileobj.hxx +++ b/sfx2/source/appl/fileobj.hxx @@ -55,7 +55,7 @@ class SvFileObject : public sfx2::SvLinkSource void SendStateChg_Impl( sfx2::LinkManager::LinkState nState ); DECL_LINK_TYPED( DelMedium_Impl, void*, void ); - DECL_LINK( LoadGrfReady_Impl, void* ); + DECL_LINK_TYPED( LoadGrfReady_Impl, void*, void ); DECL_LINK_TYPED( DialogClosedHdl, sfx2::FileDialogHelper*, void ); protected: diff --git a/sfx2/source/control/shell.cxx b/sfx2/source/control/shell.cxx index 5bfac57f1a4f..434bf24120c7 100644 --- a/sfx2/source/control/shell.cxx +++ b/sfx2/source/control/shell.cxx @@ -406,10 +406,9 @@ bool SfxShell::CanExecuteSlot_Impl( const SfxSlot &rSlot ) return aSet.GetItemState(nId) != SfxItemState::DISABLED; } -sal_IntPtr ShellCall_Impl( void* pObj, void* pArg ) +void ShellCall_Impl( void* pObj, void* pArg ) { static_cast<SfxShell*>(pObj)->ExecuteSlot( *static_cast<SfxRequest*>(pArg), nullptr ); - return 0; } const SfxPoolItem* SfxShell::ExecuteSlot( SfxRequest& rReq, bool bAsync ) @@ -420,7 +419,7 @@ const SfxPoolItem* SfxShell::ExecuteSlot( SfxRequest& rReq, bool bAsync ) { if( !pImp->pExecuter ) pImp->pExecuter = new svtools::AsynchronLink( - Link<>( this, ShellCall_Impl ) ); + Link<void*,void>( this, ShellCall_Impl ) ); pImp->pExecuter->Call( new SfxRequest( rReq ) ); return 0; } @@ -670,11 +669,10 @@ bool SfxShell::HasUIFeature( sal_uInt32 ) return false; } -sal_IntPtr DispatcherUpdate_Impl( void*, void* pArg ) +void DispatcherUpdate_Impl( void*, void* pArg ) { static_cast<SfxDispatcher*>(pArg)->Update_Impl( true ); static_cast<SfxDispatcher*>(pArg)->GetBindings()->InvalidateAll(false); - return 0; } void SfxShell::UIFeatureChanged() @@ -686,7 +684,7 @@ void SfxShell::UIFeatureChanged() // something my get stuck in the bunkered tools. Asynchronous call to // prevent recursion. if ( !pImp->pUpdater ) - pImp->pUpdater = new svtools::AsynchronLink( Link<>( this, DispatcherUpdate_Impl ) ); + pImp->pUpdater = new svtools::AsynchronLink( Link<void*,void>( this, DispatcherUpdate_Impl ) ); // Multiple views allowed pImp->pUpdater->Call( pFrame->GetDispatcher(), true ); diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx index c19f7d28a6e6..88a24ee9bafe 100644 --- a/sfx2/source/doc/docfile.cxx +++ b/sfx2/source/doc/docfile.cxx @@ -2378,12 +2378,12 @@ const OUString& SfxMedium::GetLongName() const return pImp->m_aLongName; } -void SfxMedium::SetDoneLink( const Link<>& rLink ) +void SfxMedium::SetDoneLink( const Link<void*,void>& rLink ) { pImp->aDoneLink = rLink; } -void SfxMedium::Download( const Link<>& aLink ) +void SfxMedium::Download( const Link<void*,void>& aLink ) { SetDoneLink( aLink ); GetInStream(); diff --git a/svtools/source/control/inettbc.cxx b/svtools/source/control/inettbc.cxx index cd04a853279c..e953c2725eed 100644 --- a/svtools/source/control/inettbc.cxx +++ b/svtools/source/control/inettbc.cxx @@ -106,7 +106,7 @@ class SvtMatchContext_Impl: public salhelper::Thread css::uno::Reference< css::ucb::XCommandProcessor > processor_; sal_Int32 commandId_; - DECL_LINK( Select_Impl, void* ); + DECL_LINK_TYPED( Select_Impl, void*, void ); virtual ~SvtMatchContext_Impl(); virtual void execute() SAL_OVERRIDE; @@ -207,14 +207,14 @@ void SvtMatchContext_Impl::execute( ) // Cancellable does not discard the information gained so far, it // inserts all collected completions into the listbox. -IMPL_LINK_NOARG( SvtMatchContext_Impl, Select_Impl ) +IMPL_LINK_NOARG_TYPED( SvtMatchContext_Impl, Select_Impl, void*, void ) { // avoid recursion through cancel button { osl::MutexGuard g(mutex_); if (stopped_) { // Completion was stopped, no display: - return 0; + return; } } @@ -273,8 +273,6 @@ IMPL_LINK_NOARG( SvtMatchContext_Impl, Select_Impl ) // the box has this control as a member so we have to set that member // to zero before deleting ourself. pBox->pCtx.clear(); - - return 0; } |