Kaydet (Commit) 9004eeae authored tarafından Noel Grandin's avatar Noel Grandin

convert Link<> to typed

Change-Id: I206430e6cb32235b0ac47781fe586c3e374bfc17
üst a7fde38a
......@@ -705,7 +705,7 @@ void FmSearchDialog::OnFound(const css::uno::Any& aCursorPos, sal_Int16 nFieldPo
m_pcmbSearchText->GrabFocus();
}
IMPL_LINK(FmSearchDialog, OnSearchProgress, FmSearchProgress*, pProgress)
IMPL_LINK_TYPED(FmSearchDialog, OnSearchProgress, const FmSearchProgress*, pProgress, void)
{
SolarMutexGuard aGuard;
// make this single method thread-safe (it's an overkill to block the whole application for this,
......@@ -761,8 +761,6 @@ IMPL_LINK(FmSearchDialog, OnSearchProgress, FmSearchProgress*, pProgress)
}
m_pftRecord->SetText(OUString::number(1 + pProgress->nCurrentRecord));
return 0L;
}
void FmSearchDialog::LoadParams()
......
......@@ -171,7 +171,7 @@ private:
DECL_LINK( OnContextSelection, ListBox* );
DECL_LINK( OnSearchProgress, FmSearchProgress* );
DECL_LINK_TYPED( OnSearchProgress, const FmSearchProgress*, void );
DECL_LINK_TYPED( OnDelayedPaint, Timer*, void ); ///< see EnableSearchUI
......
......@@ -44,15 +44,15 @@
class FmSearchEngine;
class SAL_WARN_UNUSED FmSearchThread : public ::osl::Thread
{
FmSearchEngine* m_pEngine;
Link<> m_aTerminationHdl;
FmSearchEngine* m_pEngine;
Link<FmSearchThread*,void> 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<FmSearchThread*,void> 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<sal_Int32,void> m_lnkWhoWantsToKnow;
::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > m_xListening;
// attribute access
public:
Link<> SetPropChangeHandler(const Link<>& lnk);
Link<sal_Int32,void> SetPropChangeHandler(const Link<sal_Int32,void>& lnk);
// methods
public:
......@@ -203,7 +203,7 @@ class SVX_DLLPUBLIC SAL_WARN_UNUSED FmSearchEngine
// Data for the decision in which field a "Found" is accepted
::com::sun::star::uno::Any m_aPreviousLocBookmark; // position of the last finding
FieldCollection::iterator m_iterPreviousLocField; // field of the last finding
FieldCollection::iterator m_iterPreviousLocField; // field of the last finding
// Communication with the thread that does the actual searching
OUString m_strSearchExpression; // forward direction
......@@ -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<const FmSearchProgress*,void> 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<const FmSearchProgress*,void> aHdl) { m_aProgressHandler = aHdl; }
/// search for the next appearance (for nDirection values check DIRECTION_*-defines)
void SearchNext(const OUString& strExpression);
......@@ -380,9 +380,9 @@ private:
SVX_DLLPRIVATE bool HasPreviousLoc() { return m_aPreviousLocBookmark.hasValue(); }
DECL_LINK(OnSearchTerminated, FmSearchThread*);
DECL_LINK_TYPED(OnSearchTerminated, FmSearchThread*, void);
// is used by SearchThread, after the return from this handler the thread removes itself
DECL_LINK(OnNewRecordCount, void*);
DECL_LINK_TYPED(OnNewRecordCount, sal_Int32, void);
};
#endif // INCLUDED_SVX_FMSRCIMP_HXX
......
......@@ -107,9 +107,9 @@ FmRecordCountListener::FmRecordCountListener(const Reference< ::com::sun::star::
}
Link<> FmRecordCountListener::SetPropChangeHandler(const Link<>& lnk)
Link<sal_Int32,void> FmRecordCountListener::SetPropChangeHandler(const Link<sal_Int32,void>& lnk)
{
Link<> lnkReturn = m_lnkWhoWantsToKnow;
Link<sal_Int32,void> lnkReturn = m_lnkWhoWantsToKnow;
m_lnkWhoWantsToKnow = lnk;
if (m_xListening.is())
......@@ -145,8 +145,8 @@ void FmRecordCountListener::NotifyCurrentCount()
if (m_lnkWhoWantsToKnow.IsSet())
{
DBG_ASSERT(m_xListening.is(), "FmRecordCountListener::NotifyCurrentCount : I have no propset ... !?");
void* pTheCount = reinterpret_cast<void*>(::comphelper::getINT32(m_xListening->getPropertyValue(FM_PROP_ROWCOUNT)));
m_lnkWhoWantsToKnow.Call(pTheCount);
sal_Int32 theCount = ::comphelper::getINT32(m_xListening->getPropertyValue(FM_PROP_ROWCOUNT));
m_lnkWhoWantsToKnow.Call(theCount);
}
}
......@@ -1063,10 +1063,10 @@ void FmSearchEngine::SearchNextImpl()
}
IMPL_LINK(FmSearchEngine, OnSearchTerminated, FmSearchThread*, /*pThread*/)
IMPL_LINK_NOARG_TYPED(FmSearchEngine, OnSearchTerminated, FmSearchThread*, void)
{
if (!m_aProgressHandler.IsSet())
return 0L;
return;
FmSearchProgress aProgress;
try
......@@ -1101,21 +1101,18 @@ IMPL_LINK(FmSearchEngine, OnSearchTerminated, FmSearchThread*, /*pThread*/)
m_aProgressHandler.Call(&aProgress);
m_bSearchingCurrently = false;
return 0L;
}
IMPL_LINK(FmSearchEngine, OnNewRecordCount, void*, pCounterAsVoid)
IMPL_LINK_TYPED(FmSearchEngine, OnNewRecordCount, sal_Int32, theCounter, void)
{
if (!m_aProgressHandler.IsSet())
return 0L;
return;
FmSearchProgress aProgress;
aProgress.nCurrentRecord = reinterpret_cast<sal_uIntPtr>(pCounterAsVoid);
aProgress.nCurrentRecord = theCounter;
aProgress.aSearchState = FmSearchProgress::STATE_PROGRESS_COUNTING;
m_aProgressHandler.Call(&aProgress);
return 0L;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment