diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2015-04-30 10:20:00 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2015-04-30 10:20:00 +0200 |
commit | 3ead3ad52f9bb2f9d1d6cf8dfc73a0a25e6778ed (patch) | |
tree | bdfd28afe5a452060e3d985c5f01b45f4b7bc2cd /svx/source/inc | |
parent | 57d254d42b6e1d836bd21e6fb2e968af2b511c7d (diff) |
Gradually typed Link
Turn the Link class into a template abstracting over the link's argument and
return types, but provide default template arguments that keep the generic,
unsafe "void* in, sal_IntPtr out" behvior. That way, individual uses of the
Link class can be updated over time.
All the related macros are duplicated with ..._TYPED counterparts, that
additionally take the RetType (except for LINK_TYPED, which manages to infer the
relevant types from the supplied Member).
(It would have been attractive to change the "untyped" LinkStubs from taking a
void* to a properly typed ArgType parameter, too, but that would cause
-fsanitize=function to flag uses of "untyped" Link::Call.)
Change-Id: I3b0140378bad99abbf240140ebb4a46a05d2d2f8
Diffstat (limited to 'svx/source/inc')
-rw-r--r-- | svx/source/inc/delayedevent.hxx | 4 | ||||
-rw-r--r-- | svx/source/inc/fmexch.hxx | 6 | ||||
-rw-r--r-- | svx/source/inc/fmpgeimp.hxx | 6 | ||||
-rw-r--r-- | svx/source/inc/fmshimp.hxx | 2 | ||||
-rw-r--r-- | svx/source/inc/fmtextcontrolshell.hxx | 4 | ||||
-rw-r--r-- | svx/source/inc/frmselimpl.hxx | 2 | ||||
-rw-r--r-- | svx/source/inc/gridcell.hxx | 6 |
7 files changed, 15 insertions, 15 deletions
diff --git a/svx/source/inc/delayedevent.hxx b/svx/source/inc/delayedevent.hxx index 5f078aa9d3c7..b339fe9f6913 100644 --- a/svx/source/inc/delayedevent.hxx +++ b/svx/source/inc/delayedevent.hxx @@ -38,7 +38,7 @@ namespace svxform class DelayedEvent { public: - DelayedEvent( const Link& _rHandler ) + DelayedEvent( const Link<>& _rHandler ) :m_aHandler( _rHandler ) ,m_nEventId( 0 ) { @@ -62,7 +62,7 @@ namespace svxform void CancelPendingCall(); private: - Link m_aHandler; + Link<> m_aHandler; ImplSVEvent * m_nEventId; private: diff --git a/svx/source/inc/fmexch.hxx b/svx/source/inc/fmexch.hxx index 09ab923081c5..a4289d966beb 100644 --- a/svx/source/inc/fmexch.hxx +++ b/svx/source/inc/fmexch.hxx @@ -48,7 +48,7 @@ namespace svxform class SVX_DLLPUBLIC OLocalExchange : public TransferableHelper { private: - Link m_aClipboardListener; + Link<> m_aClipboardListener; bool m_bDragging : 1; bool m_bClipboardOwner : 1; @@ -67,7 +67,7 @@ namespace svxform void startDrag( vcl::Window* pWindow, sal_Int8 nDragSourceActions, const GrantAccess& ); void copyToClipboard( vcl::Window* _pWindow, const GrantAccess& ); - void setClipboardListener( const Link& _rListener ) { m_aClipboardListener = _rListener; } + void setClipboardListener( const Link<>& _rListener ) { m_aClipboardListener = _rListener; } void clear(); @@ -112,7 +112,7 @@ namespace svxform inline bool isDataExchangeActive( ) const { return isDragSource() || isClipboardOwner(); } inline void clear() { if ( isDataExchangeActive() ) m_pTransferable->clear(); } - SVX_DLLPRIVATE void setClipboardListener( const Link& _rListener ) { if ( m_pTransferable ) m_pTransferable->setClipboardListener( _rListener ); } + SVX_DLLPRIVATE void setClipboardListener( const Link<>& _rListener ) { if ( m_pTransferable ) m_pTransferable->setClipboardListener( _rListener ); } protected: SVX_DLLPRIVATE virtual OLocalExchange* createExchange() const = 0; diff --git a/svx/source/inc/fmpgeimp.hxx b/svx/source/inc/fmpgeimp.hxx index a3d52c147b8b..6e8860756f38 100644 --- a/svx/source/inc/fmpgeimp.hxx +++ b/svx/source/inc/fmpgeimp.hxx @@ -54,7 +54,7 @@ class SVX_DLLPRIVATE FmFormPageImpl ::com::sun::star::uno::WeakReference< ::com::sun::star::container::XMap > m_aControlShapeMap; FmFormPage& m_rPage; - Link m_aFormsCreationHdl; + Link<> m_aFormsCreationHdl; bool m_bFirstActivation; bool m_bAttemptedFormCreation; @@ -93,8 +93,8 @@ public: const ::com::sun::star::uno::Reference< ::com::sun::star::form::XForms>& getForms( bool _bForceCreate = true ); - void SetFormsCreationHdl( const Link& _rFormsCreationHdl ) { m_aFormsCreationHdl = _rFormsCreationHdl; } - const Link& GetFormsCreationHdl() const { return m_aFormsCreationHdl; } + void SetFormsCreationHdl( const Link<>& _rFormsCreationHdl ) { m_aFormsCreationHdl = _rFormsCreationHdl; } + const Link<>& GetFormsCreationHdl() const { return m_aFormsCreationHdl; } protected: /** finds a form with a given data source signature diff --git a/svx/source/inc/fmshimp.hxx b/svx/source/inc/fmshimp.hxx index 61ddbf23d301..c6d7404e190e 100644 --- a/svx/source/inc/fmshimp.hxx +++ b/svx/source/inc/fmshimp.hxx @@ -432,7 +432,7 @@ public: SAL_DLLPRIVATE void GetTextAttributeState( SfxItemSet& _rSet ); SAL_DLLPRIVATE bool IsActiveControl( bool _bCountRichTextOnly = false ) const; SAL_DLLPRIVATE void ForgetActiveControl(); - SAL_DLLPRIVATE void SetControlActivationHandler( const Link& _rHdl ); + SAL_DLLPRIVATE void SetControlActivationHandler( const Link<>& _rHdl ); /// classifies our host document SAL_DLLPRIVATE ::svxform::DocumentType diff --git a/svx/source/inc/fmtextcontrolshell.hxx b/svx/source/inc/fmtextcontrolshell.hxx index e00e532a5f91..fc679e30156d 100644 --- a/svx/source/inc/fmtextcontrolshell.hxx +++ b/svx/source/inc/fmtextcontrolshell.hxx @@ -108,7 +108,7 @@ namespace svx SfxViewFrame* m_pViewFrame; // invalidating slots SfxBindings& m_rBindings; - Link m_aControlActivationHandler; + Link<> m_aControlActivationHandler; AutoTimer m_aClipboardInvalidation; bool m_bNeedClipboardInvalidation; @@ -123,7 +123,7 @@ namespace svx void GetTextAttributeState( SfxItemSet& _rSet ); bool IsActiveControl( bool _bCountRichTextOnly = false ) const; void ForgetActiveControl(); - void SetControlActivationHandler( const Link& _rHdl ) { m_aControlActivationHandler = _rHdl; } + void SetControlActivationHandler( const Link<>& _rHdl ) { m_aControlActivationHandler = _rHdl; } /** to be called when a form in our document has been activated */ diff --git a/svx/source/inc/frmselimpl.hxx b/svx/source/inc/frmselimpl.hxx index 51d94e1f861b..926fbe71d0f8 100644 --- a/svx/source/inc/frmselimpl.hxx +++ b/svx/source/inc/frmselimpl.hxx @@ -120,7 +120,7 @@ struct FrameSelectorImpl : public Resource FrameSelFlags mnFlags; /// Flags for enabled frame borders. FrameBorderPtrVec maAllBorders; /// Pointers to all frame borders. FrameBorderPtrVec maEnabBorders; /// Pointers to enables frame borders. - Link maSelectHdl; /// Selection handler. + Link<> maSelectHdl; /// Selection handler. long mnCtrlSize; /// Size of the control (always square). long mnArrowSize; /// Size of an arrow image. diff --git a/svx/source/inc/gridcell.hxx b/svx/source/inc/gridcell.hxx index bd379ce49d40..7cfeeb1294b0 100644 --- a/svx/source/inc/gridcell.hxx +++ b/svx/source/inc/gridcell.hxx @@ -683,7 +683,7 @@ class DbFilterField { ::com::sun::star::uno::Sequence< OUString > m_aValueList; OUString m_aText; - Link m_aCommitLink; + Link<> m_aCommitLink; sal_Int16 m_nControlClass; bool m_bFilterList : 1; bool m_bFilterListFilled : 1; @@ -704,8 +704,8 @@ public: const OUString& GetText() const {return m_aText;} void SetText(const OUString& rText); - void SetCommitHdl( const Link& rLink ) { m_aCommitLink = rLink; } - const Link& GetCommitHdl() const { return m_aCommitLink; } + void SetCommitHdl( const Link<>& rLink ) { m_aCommitLink = rLink; } + const Link<>& GetCommitHdl() const { return m_aCommitLink; } protected: |