diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-09-12 16:36:29 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-09-13 09:56:59 +0200 |
commit | cbfb7f463cbf39ec59b5a4e4f9bb07e89f8c9d13 (patch) | |
tree | a5649fe0b315c5a5dd2dc4a1ba3eef3c7c11aefd /include/sfx2 | |
parent | b40f41d0cfcc355f16f4a9d5b0d805fe555dd5bf (diff) |
pass SfxRequest around by std::unique_ptr
- remove a couple of copies in the process
- need to use std::function instead of LINK to handle the unique_ptr
Change-Id: Ic760d2fc639bf2e11d5bddbfbb6f2d5f15b78fe3
Reviewed-on: https://gerrit.libreoffice.org/60397
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'include/sfx2')
-rw-r--r-- | include/sfx2/dispatch.hxx | 2 | ||||
-rw-r--r-- | include/sfx2/hintpost.hxx | 10 |
2 files changed, 7 insertions, 5 deletions
diff --git a/include/sfx2/dispatch.hxx b/include/sfx2/dispatch.hxx index 3ff8856985a2..9d91d7f60966 100644 --- a/include/sfx2/dispatch.hxx +++ b/include/sfx2/dispatch.hxx @@ -95,7 +95,7 @@ friend class SfxPopupMenuManager; friend class SfxHelp; DECL_DLLPRIVATE_LINK( EventHdl_Impl, Timer *, void ); - DECL_DLLPRIVATE_LINK( PostMsgHandler, SfxRequest *, void ); + void PostMsgHandler(std::unique_ptr<SfxRequest>); SAL_DLLPRIVATE void Call_Impl( SfxShell& rShell, const SfxSlot &rSlot, SfxRequest &rReq, bool bRecord ); SAL_DLLPRIVATE void Update_Impl_( bool,bool,bool,SfxWorkWindow*); diff --git a/include/sfx2/hintpost.hxx b/include/sfx2/hintpost.hxx index cfbc60d87631..ce5f5ac8f0e2 100644 --- a/include/sfx2/hintpost.hxx +++ b/include/sfx2/hintpost.hxx @@ -21,6 +21,8 @@ #include <tools/link.hxx> #include <tools/ref.hxx> +#include <functional> +#include <memory> class SfxRequest; @@ -39,7 +41,7 @@ class SfxRequest; class SfxHintPoster : public SvRefBase { private: - Link<SfxRequest*,void> m_Link; + std::function<void (std::unique_ptr<SfxRequest>)> m_Link; DECL_LINK( DoEvent_Impl, void*, void ); @@ -47,10 +49,10 @@ protected: virtual ~SfxHintPoster() override; public: - SfxHintPoster(const Link<SfxRequest*,void>& rLink); + SfxHintPoster(const std::function<void (std::unique_ptr<SfxRequest>)>& rLink); - void Post( SfxRequest* pHint ); - void SetEventHdl(const Link<SfxRequest*,void>& rLink); + void Post( std::unique_ptr<SfxRequest> pHint ); + void SetEventHdl(const std::function<void (std::unique_ptr<SfxRequest>)>& rLink); }; #endif |