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 /include/svl/svdde.hxx | |
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 'include/svl/svdde.hxx')
-rw-r--r-- | include/svl/svdde.hxx | 48 |
1 files changed, 24 insertions, 24 deletions
diff --git a/include/svl/svdde.hxx b/include/svl/svdde.hxx index f272b72b72ca..598aa3d7c384 100644 --- a/include/svl/svdde.hxx +++ b/include/svl/svdde.hxx @@ -98,8 +98,8 @@ protected: short nType; sal_IntPtr nId; sal_IntPtr nTime; - Link aData; - Link aDone; + Link<> aData; + Link<> aDone; bool bBusy; DdeTransaction( DdeConnection&, SAL_UNUSED_PARAMETER const OUString&, SAL_UNUSED_PARAMETER long = 0 ); @@ -112,11 +112,11 @@ public: void Execute(); - void SetDataHdl( const Link& rLink ) { aData = rLink; } - const Link& GetDataHdl() const { return aData; } + void SetDataHdl( const Link<>& rLink ) { aData = rLink; } + const Link<>& GetDataHdl() const { return aData; } - void SetDoneHdl( const Link& rLink ) { aDone = rLink; } - const Link& GetDoneHdl() const { return aDone; } + void SetDoneHdl( const Link<>& rLink ) { aDone = rLink; } + const Link<>& GetDoneHdl() const { return aDone; } void SetFormat( SotClipboardFormatId nFmt ) { aDdeData.SetFormat( nFmt ); } SotClipboardFormatId GetFormat() const { return aDdeData.GetFormat(); } @@ -138,14 +138,14 @@ private: class SVL_DLLPUBLIC DdeLink : public DdeTransaction { - Link aNotify; + Link<> aNotify; public: DdeLink( DdeConnection&, const OUString&, long = 0 ); virtual ~DdeLink(); - void SetNotifyHdl( const Link& rLink ) { aNotify = rLink; } - const Link& GetNotifyHdl() const { return aNotify; } + void SetNotifyHdl( const Link<>& rLink ) { aNotify = rLink; } + const Link<>& GetNotifyHdl() const { return aNotify; } virtual void Notify(); }; @@ -310,11 +310,11 @@ private: DdeString* pName; OUString aItem; std::vector<DdeItem*> aItems; - Link aConnectLink; - Link aDisconnectLink; - Link aGetLink; - Link aPutLink; - Link aExecLink; + Link<> aConnectLink; + Link<> aDisconnectLink; + Link<> aGetLink; + Link<> aPutLink; + Link<> aExecLink; public: DdeTopic( SAL_UNUSED_PARAMETER const OUString& ); @@ -323,16 +323,16 @@ public: const OUString GetName() const; long GetConvId(); - void SetConnectHdl( const Link& rLink ) { aConnectLink = rLink; } - const Link& GetConnectHdl() const { return aConnectLink; } - void SetDisconnectHdl( const Link& rLink ) { aDisconnectLink = rLink; } - const Link& GetDisconnectHdl() const { return aDisconnectLink; } - void SetGetHdl( const Link& rLink ) { aGetLink = rLink; } - const Link& GetGetHdl() const { return aGetLink; } - void SetPutHdl( const Link& rLink ) { aPutLink = rLink; } - const Link& GetPutHdl() const { return aPutLink; } - void SetExecuteHdl( const Link& rLink ) { aExecLink = rLink; } - const Link& GetExecuteHdl() const { return aExecLink; } + void SetConnectHdl( const Link<>& rLink ) { aConnectLink = rLink; } + const Link<>& GetConnectHdl() const { return aConnectLink; } + void SetDisconnectHdl( const Link<>& rLink ) { aDisconnectLink = rLink; } + const Link<>& GetDisconnectHdl() const { return aDisconnectLink; } + void SetGetHdl( const Link<>& rLink ) { aGetLink = rLink; } + const Link<>& GetGetHdl() const { return aGetLink; } + void SetPutHdl( const Link<>& rLink ) { aPutLink = rLink; } + const Link<>& GetPutHdl() const { return aPutLink; } + void SetExecuteHdl( const Link<>& rLink ) { aExecLink = rLink; } + const Link<>& GetExecuteHdl() const { return aExecLink; } void NotifyClient( const OUString& ); bool IsSystemTopic(); |