diff options
author | Oliver Bolte <obo@openoffice.org> | 2005-04-11 13:14:21 +0000 |
---|---|---|
committer | Oliver Bolte <obo@openoffice.org> | 2005-04-11 13:14:21 +0000 |
commit | 5c86d50513826c774d8974627440a5a7f8bbe4e7 (patch) | |
tree | 59ec20fef0ee6080b4f454c0d51ca0f3f4386f8b /vcl/source/app/session.cxx | |
parent | ccd810e4ad4b0780460388d5eb7db2d0c5e081a0 (diff) |
INTEGRATION: CWS vclshowstop02 (1.3.14); FILE MERGED
2005/04/07 17:47:12 pl 1.3.14.1: #i46947# answer to session manager even if no listener is present
Diffstat (limited to 'vcl/source/app/session.cxx')
-rw-r--r-- | vcl/source/app/session.cxx | 33 |
1 files changed, 25 insertions, 8 deletions
diff --git a/vcl/source/app/session.cxx b/vcl/source/app/session.cxx index 974552b8bc64..ecdaf02b0a6d 100644 --- a/vcl/source/app/session.cxx +++ b/vcl/source/app/session.cxx @@ -2,9 +2,9 @@ * * $RCSfile: session.cxx,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * - * last change: $Author: rt $ $Date: 2005-03-29 14:52:06 $ + * last change: $Author: obo $ $Date: 2005-04-11 14:14:21 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -58,7 +58,6 @@ * * ************************************************************************/ - #ifndef _SV_SVAPP_HXX #include <svapp.hxx> #endif @@ -201,6 +200,15 @@ void VCLSession::callSaveRequested( bool bShutdown, bool bCancelable ) // without session we assume UI is always possible, // so it was reqeusted and granted m_bInteractionRequested = m_bInteractionGranted = m_pSession ? false : true; + + // answer the session manager even if no listeners available anymore + DBG_ASSERT( ! aListeners.empty(), "saveRequested but no listeners !" ); + if( aListeners.empty() ) + { + if( m_pSession ) + m_pSession->saveDone(); + return; + } } ULONG nAcquireCount = Application::ReleaseSolarMutex(); @@ -215,17 +223,26 @@ void VCLSession::callInteractionGranted( bool bInteractionGranted ) { osl::MutexGuard aGuard( m_aMutex ); // copy listener list since calling a listener may remove it. - aListeners = m_aListeners; + for( std::list< Listener >::const_iterator it = m_aListeners.begin(); it != m_aListeners.end(); ++it ) + if( it->m_bInteractionRequested ) + aListeners.push_back( *it ); m_bInteractionGranted = bInteractionGranted; + + // answer the session manager even if no listeners available anymore + DBG_ASSERT( ! aListeners.empty(), "interactionGranted but no listeners !" ); + if( aListeners.empty() ) + { + if( m_pSession ) + m_pSession->interactionDone(); + return; + } } ULONG nAcquireCount = Application::ReleaseSolarMutex(); for( std::list< Listener >::const_iterator it = aListeners.begin(); it != aListeners.end(); ++it ) - { - if( it->m_bInteractionRequested ) - it->m_xListener->approveInteraction( bInteractionGranted ); - } + it->m_xListener->approveInteraction( bInteractionGranted ); + Application::AcquireSolarMutex( nAcquireCount ); } |