summaryrefslogtreecommitdiff
path: root/include/svx/fmsrcimp.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/svx/fmsrcimp.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/svx/fmsrcimp.hxx')
-rw-r--r--include/svx/fmsrcimp.hxx12
1 files changed, 6 insertions, 6 deletions
diff --git a/include/svx/fmsrcimp.hxx b/include/svx/fmsrcimp.hxx
index c94731e7d695..5bb785c4ea38 100644
--- a/include/svx/fmsrcimp.hxx
+++ b/include/svx/fmsrcimp.hxx
@@ -45,14 +45,14 @@ class FmSearchEngine;
class SAL_WARN_UNUSED FmSearchThread : public ::osl::Thread
{
FmSearchEngine* m_pEngine;
- Link m_aTerminationHdl;
+ Link<> m_aTerminationHdl;
virtual void SAL_CALL run() SAL_OVERRIDE;
virtual void SAL_CALL onTerminated() SAL_OVERRIDE;
public:
FmSearchThread(FmSearchEngine* pEngine) : m_pEngine(pEngine) { }
- void setTerminationHandler(Link aHdl) { m_aTerminationHdl = aHdl; }
+ void setTerminationHandler(Link<> aHdl) { m_aTerminationHdl = aHdl; }
};
/**
@@ -84,12 +84,12 @@ struct FmSearchProgress
class SAL_WARN_UNUSED FmRecordCountListener : public ::cppu::WeakImplHelper1< ::com::sun::star::beans::XPropertyChangeListener>
{
// attribute
- Link m_lnkWhoWantsToKnow;
+ Link<> m_lnkWhoWantsToKnow;
::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > m_xListening;
// attribute access
public:
- Link SetPropChangeHandler(const Link& lnk);
+ Link<> SetPropChangeHandler(const Link<>& lnk);
// methods
public:
@@ -211,7 +211,7 @@ class SVX_DLLPUBLIC SAL_WARN_UNUSED FmSearchEngine
SEARCH_RESULT m_srResult; // backward direction
// The link we broadcast the progress and the result to
- Link m_aProgressHandler;
+ Link<> m_aProgressHandler;
bool m_bSearchingCurrently : 1; // is an (asynchronous) search running?
bool m_bCancelAsynchRequest : 1; // should be cancelled?
::osl::Mutex m_aCancelAsynchAccess; // access to_bCancelAsynchRequest (technically only
@@ -312,7 +312,7 @@ public:
a FmSearchProgress structure
the handler should be in any case thread-safe
*/
- void SetProgressHandler(Link aHdl) { m_aProgressHandler = aHdl; }
+ void SetProgressHandler(Link<> aHdl) { m_aProgressHandler = aHdl; }
/// search for the next appearance (for nDirection values check DIRECTION_*-defines)
void SearchNext(const OUString& strExpression);