summaryrefslogtreecommitdiff
path: root/sfx2/source/notify/hintpost.cxx
diff options
context:
space:
mode:
authorDirk Völzke <dv@openoffice.org>2001-07-03 11:16:57 +0000
committerDirk Völzke <dv@openoffice.org>2001-07-03 11:16:57 +0000
commit8dcc2593b45dff7863d0187bec4750eb8ac7eaa3 (patch)
treef90f1e5595dbe65e16066e1867f508f155431ea6 /sfx2/source/notify/hintpost.cxx
parent69ae465be989498e45b75936ce714d1ed6cff115 (diff)
#89176# AsynchronLink moved to svtools
Diffstat (limited to 'sfx2/source/notify/hintpost.cxx')
-rw-r--r--sfx2/source/notify/hintpost.cxx109
1 files changed, 2 insertions, 107 deletions
diff --git a/sfx2/source/notify/hintpost.cxx b/sfx2/source/notify/hintpost.cxx
index 0bc880ec6b68..d6ce8c34f072 100644
--- a/sfx2/source/notify/hintpost.cxx
+++ b/sfx2/source/notify/hintpost.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: hintpost.cxx,v $
*
- * $Revision: 1.1.1.1 $
+ * $Revision: 1.2 $
*
- * last change: $Author: hr $ $Date: 2000-09-18 16:52:35 $
+ * last change: $Author: dv $ $Date: 2001-07-03 12:16:57 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -138,108 +138,3 @@ void SfxHintPoster::SetEventHdl( const GenLink& rLink )
aStrm << x.GetStr() << '\n'; \
}
#endif
-
-
-//--------------------------------------------------------------------
-
-void AsynchronLink::CreateMutex()
-{
- if( !_pMutex ) _pMutex = new NAMESPACE_VOS( OMutex );
-}
-
-void AsynchronLink::Call( void* pObj, BOOL bAllowDoubles, BOOL bUseTimer )
-{
-#ifdef DBG_UTIL
- if ( bUseTimer || !_bInCall )
- DBG_WARNING( "Recursives Call. Eher ueber Timer. TLX Fragen" );
-#endif
- if( _aLink.IsSet() )
- {
- _pArg = pObj;
- DBG_ASSERT( bAllowDoubles ||
- ( !_nEventId && ( !_pTimer || !_pTimer->IsActive() ) ),
- "Schon ein Call unterwegs" );
- if( _nEventId )
- {
- if( _pMutex ) _pMutex->acquire();
- LOG( String( "Remove " ) + String( _nEventId ) );
- Application::RemoveUserEvent( _nEventId );
- if( _pMutex ) _pMutex->release();
- }
- if( _pTimer )_pTimer->Stop();
- if( bUseTimer )
- {
- if( !_pTimer )
- {
- _pTimer = new Timer;
- _pTimer->SetTimeout( 0 );
- _pTimer->SetTimeoutHdl( STATIC_LINK(
- this, AsynchronLink, HandleCall) );
- }
- _pTimer->Start();
- }
- else
- {
- if( _pMutex ) _pMutex->acquire();
- Application::PostUserEvent( _nEventId, STATIC_LINK( this, AsynchronLink, HandleCall), 0 );
- LOG( String( "Posted " ) + String( _nEventId ) );
- if( _pMutex ) _pMutex->release();
- }
- }
-}
-
-AsynchronLink::~AsynchronLink()
-{
- if( _nEventId )
- {
- LOG( String( "Remove " ) + String( _nEventId ) );
- Application::RemoveUserEvent( _nEventId );
- }
- delete _pTimer;
- if( _pDeleted ) *_pDeleted = TRUE;
- delete _pMutex;
-}
-
-IMPL_STATIC_LINK( AsynchronLink, HandleCall, void*, EMPTYARG )
-{
- if( pThis->_pMutex ) pThis->_pMutex->acquire();
- pThis->_nEventId = 0;
- if( pThis->_pMutex ) pThis->_pMutex->release();
- pThis->Call_Impl( pThis->_pArg );
- return 0;
-}
-
-void AsynchronLink::ForcePendingCall()
-{
- ClearPendingCall();
- Call_Impl( _pArg );
-}
-
-void AsynchronLink::ClearPendingCall()
-{
- if( _pMutex ) _pMutex->acquire();
- if( _nEventId )
- {
- Application::RemoveUserEvent( _nEventId );
- _nEventId = 0;
- }
- if( _pMutex ) _pMutex->release();
- if( _pTimer ) _pTimer->Stop();
-}
-
-void AsynchronLink::Call_Impl( void* pArg )
-{
- _bInCall = TRUE;
- BOOL bDeleted = FALSE;
- _pDeleted = &bDeleted;
- _aLink.Call( pArg );
- if( !bDeleted )
- {
- _bInCall = FALSE;
- _pDeleted = 0;
- }
-}
-
-SV_IMPL_PTRARR( AsynchronLinkArr_Impl, AsynchronLink* );
-
-