summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2015-09-21 08:55:52 +0200
committerNoel Grandin <noel@peralex.com>2015-09-22 20:21:55 +0200
commit6d8124e30c6ce38219ca323f9674f242c822c360 (patch)
tree2a05e63023a1ff5cb327ca844d2830c66bf9fbdb
parent3526da14b7c49adff202f32c15948fed8b9915ea (diff)
convert Link<> to typed
and remove unused UserEvent class Change-Id: Ic61c5eef75c36393dbbaa92d93163eab89021ee3
-rw-r--r--framework/inc/dispatch/closedispatcher.hxx2
-rw-r--r--framework/source/dispatch/closedispatcher.cxx8
-rw-r--r--framework/source/services/autorecovery.cxx15
-rw-r--r--include/svtools/acceleratorexecute.hxx2
-rw-r--r--include/vcl/evntpost.hxx14
-rw-r--r--svtools/source/misc/acceleratorexecute.cxx13
-rw-r--r--vcl/source/helper/evntpost.cxx11
7 files changed, 26 insertions, 39 deletions
diff --git a/framework/inc/dispatch/closedispatcher.hxx b/framework/inc/dispatch/closedispatcher.hxx
index 0617bc003927..edce4d7dac15 100644
--- a/framework/inc/dispatch/closedispatcher.hxx
+++ b/framework/inc/dispatch/closedispatcher.hxx
@@ -165,7 +165,7 @@ class CloseDispatcher : public ::cppu::WeakImplHelper<
asynchronous. Otherwise our callis kill its own environment
during they call us ...
*/
- DECL_LINK( impl_asyncCallback, void* );
+ DECL_LINK_TYPED( impl_asyncCallback, LinkParamNone*, void );
/** @short prepare m_xCloseFrame so it should be closeable without problems.
diff --git a/framework/source/dispatch/closedispatcher.cxx b/framework/source/dispatch/closedispatcher.cxx
index a59e201d5118..9e7b29f5af19 100644
--- a/framework/source/dispatch/closedispatcher.cxx
+++ b/framework/source/dispatch/closedispatcher.cxx
@@ -221,7 +221,7 @@ void SAL_CALL CloseDispatcher::dispatchWithNotification(const css::util::URL&
else
{
SolarMutexGuard g;
- m_aAsyncCallback->Post(0);
+ m_aAsyncCallback->Post();
}
}
@@ -241,7 +241,7 @@ void SAL_CALL CloseDispatcher::dispatchWithNotification(const css::util::URL&
- decide then, if we must close this frame only, establish the backing mode
or shutdown the whole application.
*/
-IMPL_LINK_NOARG(CloseDispatcher, impl_asyncCallback)
+IMPL_LINK_NOARG_TYPED(CloseDispatcher, impl_asyncCallback, LinkParamNone*, void)
{
try
{
@@ -273,7 +273,7 @@ IMPL_LINK_NOARG(CloseDispatcher, impl_asyncCallback)
// frame already dead ?!
// Nothing to do !
if (! xCloseFrame.is())
- return 0;
+ return;
bool bCloseFrame = false;
bool bEstablishBackingMode = false;
@@ -418,8 +418,6 @@ IMPL_LINK_NOARG(CloseDispatcher, impl_asyncCallback)
catch(const css::lang::DisposedException&)
{
}
-
- return 0;
}
bool CloseDispatcher::implts_prepareFrameForClosing(const css::uno::Reference< css::frame::XFrame >& xFrame ,
diff --git a/framework/source/services/autorecovery.cxx b/framework/source/services/autorecovery.cxx
index 531c443d8ba1..39110f70d5f9 100644
--- a/framework/source/services/autorecovery.cxx
+++ b/framework/source/services/autorecovery.cxx
@@ -638,7 +638,7 @@ private:
/** @short makes our dispatch() method asynchronous!
*/
- DECL_LINK(implts_asyncDispatch, void*);
+ DECL_LINK_TYPED(implts_asyncDispatch, LinkParamNone*, void);
/** @short implements the dispatch real. */
void implts_dispatch(const DispatchParams& aParams);
@@ -1389,7 +1389,7 @@ void SAL_CALL AutoRecovery::dispatch(const css::util::URL&
} /* SAFE */
if (bAsync)
- m_aAsyncDispatcher.Post(0);
+ m_aAsyncDispatcher.Post();
else
implts_dispatch(aParams);
}
@@ -2420,14 +2420,14 @@ IMPL_LINK_NOARG_TYPED(AutoRecovery, implts_timerExpired, Timer *, void)
}
}
-IMPL_LINK_NOARG(AutoRecovery, implts_asyncDispatch)
+IMPL_LINK_NOARG_TYPED(AutoRecovery, implts_asyncDispatch, LinkParamNone*, void)
{
DispatchParams aParams;
/* SAFE */ {
- osl::MutexGuard g(cppu::WeakComponentImplHelperBase::rBHelper.rMutex);
- aParams = m_aDispatchParams;
- css::uno::Reference< css::uno::XInterface > xHoldRefForMethodAlive = aParams.m_xHoldRefForAsyncOpAlive;
- m_aDispatchParams.forget(); // clears all members ... including the ref-hold object .-)
+ osl::MutexGuard g(cppu::WeakComponentImplHelperBase::rBHelper.rMutex);
+ aParams = m_aDispatchParams;
+ css::uno::Reference< css::uno::XInterface > xHoldRefForMethodAlive = aParams.m_xHoldRefForAsyncOpAlive;
+ m_aDispatchParams.forget(); // clears all members ... including the ref-hold object .-)
} /* SAFE */
try
@@ -2437,7 +2437,6 @@ IMPL_LINK_NOARG(AutoRecovery, implts_asyncDispatch)
catch (...)
{
}
- return 0;
}
void AutoRecovery::implts_registerDocument(const css::uno::Reference< css::frame::XModel >& xDocument)
diff --git a/include/svtools/acceleratorexecute.hxx b/include/svtools/acceleratorexecute.hxx
index d25df279b6a7..4b099e0169f5 100644
--- a/include/svtools/acceleratorexecute.hxx
+++ b/include/svtools/acceleratorexecute.hxx
@@ -232,7 +232,7 @@ class SVT_DLLPUBLIC AcceleratorExecute : private TMutexInit
/** @deprecated
replaced by internal class AsyncAccelExec ...
remove this resource here if we go forwards to next major */
- DECL_DLLPRIVATE_LINK(impl_ts_asyncCallback, void*);
+ DECL_DLLPRIVATE_LINK_TYPED(impl_ts_asyncCallback, LinkParamNone*, void);
};
} // namespace svt
diff --git a/include/vcl/evntpost.hxx b/include/vcl/evntpost.hxx
index 55f93685cac6..276c8879aed5 100644
--- a/include/vcl/evntpost.hxx
+++ b/include/vcl/evntpost.hxx
@@ -27,23 +27,17 @@ struct ImplSVEvent;
namespace vcl
{
- struct UserEvent
- {
- sal_uLong m_nWhich;
- void* m_pData;
- };
-
class VCL_DLLPUBLIC EventPoster
{
- ImplSVEvent * m_nId;
- Link<> m_aLink;
+ ImplSVEvent * m_nId;
+ Link<LinkParamNone*,void> m_aLink;
DECL_DLLPRIVATE_LINK_TYPED( DoEvent_Impl, void*, void );
public:
- EventPoster( const Link<>& rLink );
+ EventPoster( const Link<LinkParamNone*,void>& rLink );
~EventPoster();
- void Post( UserEvent* pEvent );
+ void Post();
};
}
diff --git a/svtools/source/misc/acceleratorexecute.cxx b/svtools/source/misc/acceleratorexecute.cxx
index f8c67f3db5bb..f5aacd0ee334 100644
--- a/svtools/source/misc/acceleratorexecute.cxx
+++ b/svtools/source/misc/acceleratorexecute.cxx
@@ -67,7 +67,7 @@ class SVT_DLLPRIVATE AsyncAccelExec
SVT_DLLPRIVATE AsyncAccelExec(const css::uno::Reference< css::frame::XDispatch >& xDispatch,
const css::util::URL& aURL );
- DECL_DLLPRIVATE_LINK(impl_ts_asyncCallback, void*);
+ DECL_DLLPRIVATE_LINK_TYPED(impl_ts_asyncCallback, LinkParamNone*, void);
private:
vcl::EventPoster m_aAsyncCallback;
@@ -425,10 +425,9 @@ css::uno::Reference< css::util::XURLTransformer > AcceleratorExecute::impl_ts_ge
}
-IMPL_LINK_NOARG(AcceleratorExecute, impl_ts_asyncCallback)
+IMPL_LINK_NOARG_TYPED(AcceleratorExecute, impl_ts_asyncCallback, LinkParamNone*, void)
{
// replaced by AsyncAccelExec!
- return 0;
}
@@ -451,14 +450,14 @@ AsyncAccelExec* AsyncAccelExec::createOnShotInstance(const css::uno::Reference<
void AsyncAccelExec::execAsync()
{
- m_aAsyncCallback.Post(0);
+ m_aAsyncCallback.Post();
}
-IMPL_LINK_NOARG(AsyncAccelExec, impl_ts_asyncCallback)
+IMPL_LINK_NOARG_TYPED(AsyncAccelExec, impl_ts_asyncCallback, LinkParamNone*, void)
{
if (! m_xDispatch.is())
- return 0;
+ return;
try
{
@@ -472,8 +471,6 @@ IMPL_LINK_NOARG(AsyncAccelExec, impl_ts_asyncCallback)
{}
delete this;
-
- return 0;
}
} // namespace svt
diff --git a/vcl/source/helper/evntpost.cxx b/vcl/source/helper/evntpost.cxx
index ce84ec74cba2..1d4a657b772b 100644
--- a/vcl/source/helper/evntpost.cxx
+++ b/vcl/source/helper/evntpost.cxx
@@ -26,7 +26,7 @@
namespace vcl
{
-EventPoster::EventPoster( const Link<>& rLink )
+EventPoster::EventPoster( const Link<LinkParamNone*,void>& rLink )
: m_aLink(rLink)
{
m_nId = 0;
@@ -39,19 +39,18 @@ EventPoster::~EventPoster()
Application::RemoveUserEvent( m_nId );
}
-void EventPoster::Post( UserEvent* pEvent )
+void EventPoster::Post()
{
DBG_TESTSOLARMUTEX();
- m_nId = Application::PostUserEvent( ( LINK( this, EventPoster, DoEvent_Impl ) ), pEvent );
+ m_nId = Application::PostUserEvent( ( LINK( this, EventPoster, DoEvent_Impl ) ), nullptr );
}
-IMPL_LINK_TYPED( EventPoster, DoEvent_Impl, void*, p, void )
+IMPL_LINK_TYPED( EventPoster, DoEvent_Impl, void*, /*p*/, void )
{
- UserEvent* pEvent = static_cast<UserEvent*>(p);
DBG_TESTSOLARMUTEX();
m_nId = 0;
- m_aLink.Call( pEvent );
+ m_aLink.Call( nullptr );
}
}