summaryrefslogtreecommitdiff
path: root/include/vcl/accel.hxx
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2015-04-30 10:20:00 +0200
committerStephan Bergmann <sbergman@redhat.com>2015-04-30 10:20:00 +0200
commit3ead3ad52f9bb2f9d1d6cf8dfc73a0a25e6778ed (patch)
treebdfd28afe5a452060e3d985c5f01b45f4b7bc2cd /include/vcl/accel.hxx
parent57d254d42b6e1d836bd21e6fb2e968af2b511c7d (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/vcl/accel.hxx')
-rw-r--r--include/vcl/accel.hxx18
1 files changed, 9 insertions, 9 deletions
diff --git a/include/vcl/accel.hxx b/include/vcl/accel.hxx
index d7d9d296ca2d..0459f04266b3 100644
--- a/include/vcl/accel.hxx
+++ b/include/vcl/accel.hxx
@@ -36,9 +36,9 @@ class VCL_DLLPUBLIC Accelerator : public Resource
private:
ImplAccelData* mpData;
OUString maHelpStr;
- Link maActivateHdl;
- Link maDeactivateHdl;
- Link maSelectHdl;
+ Link<> maActivateHdl;
+ Link<> maDeactivateHdl;
+ Link<> maSelectHdl;
// Will be set by AcceleratorManager
vcl::KeyCode maCurKeyCode;
@@ -89,12 +89,12 @@ public:
void SetHelpText( const OUString& rHelpText ) { maHelpStr = rHelpText; }
const OUString& GetHelpText() const { return maHelpStr; }
- void SetActivateHdl( const Link& rLink ) { maActivateHdl = rLink; }
- const Link& GetActivateHdl() const { return maActivateHdl; }
- void SetDeactivateHdl( const Link& rLink ) { maDeactivateHdl = rLink; }
- const Link& GetDeactivateHdl() const { return maDeactivateHdl; }
- void SetSelectHdl( const Link& rLink ) { maSelectHdl = rLink; }
- const Link& GetSelectHdl() const { return maSelectHdl; }
+ void SetActivateHdl( const Link<>& rLink ) { maActivateHdl = rLink; }
+ const Link<>& GetActivateHdl() const { return maActivateHdl; }
+ void SetDeactivateHdl( const Link<>& rLink ) { maDeactivateHdl = rLink; }
+ const Link<>& GetDeactivateHdl() const { return maDeactivateHdl; }
+ void SetSelectHdl( const Link<>& rLink ) { maSelectHdl = rLink; }
+ const Link<>& GetSelectHdl() const { return maSelectHdl; }
Accelerator& operator=( const Accelerator& rAccel );
};