summaryrefslogtreecommitdiff
path: root/basctl
diff options
context:
space:
mode:
authorIvo Hinkelmann <ihi@openoffice.org>2009-04-24 18:34:24 +0000
committerIvo Hinkelmann <ihi@openoffice.org>2009-04-24 18:34:24 +0000
commit8b57344c103a578befdb19ab27c32d9a86980fb5 (patch)
tree6b39ed24403b545ff1a81fe74575c34538c4edab /basctl
parentda47a391b83827eedb4b6cbce3e97b142b2a9605 (diff)
CWS-TOOLING: integrate CWS dba31m_DEV300
2009-04-08 21:06:02 +0200 fs r270660 : #i100956# hold the assigned events in the ModelImpl, not in the DatabaseDocument, so they survive the model being destroyed 2009-04-08 12:40:13 +0200 b_michaelsen r270635 : #i100928# Opening the Tools->Options->Improvement Program Tabpage on first start accidently activates Usage Tracking 2009-04-07 12:56:29 +0200 fs r270594 : #i100866# don't call into the StatusIndicator with our mutex locked 2009-04-07 10:31:02 +0200 fs r270581 : #i100866# impl_import_throw -> impl_import_nolck_throw 2009-04-06 22:53:10 +0200 fs r270575 : #i100866# some more mutex lock tweaking 2009-04-06 22:01:51 +0200 fs r270573 : #i100861# load the Show/Hide strings from the proper (an existing, in particular) resource 2009-04-06 12:43:16 +0200 fs r270537 : #i100866# notifyEvent: instantiate the ScriptDocument only when required. 2009-04-06 12:42:03 +0200 fs r270536 : #i100866# rework how and when it is determined whether the DBDoc or sub documents contain scripts/macros. In particular, cache this information in the ODatabaseDocument implementation, so that queryInterface does not need to lock the mutex 2009-04-03 10:21:02 +0200 oj r270465 : #i100789# surround uno call with try catch 2009-04-03 09:18:37 +0200 oj r270453 : #i100789# check token is not null
Diffstat (limited to 'basctl')
-rw-r--r--basctl/source/basicide/doceventnotifier.cxx23
1 files changed, 18 insertions, 5 deletions
diff --git a/basctl/source/basicide/doceventnotifier.cxx b/basctl/source/basicide/doceventnotifier.cxx
index ab116898d..f03b0e994 100644
--- a/basctl/source/basicide/doceventnotifier.cxx
+++ b/basctl/source/basicide/doceventnotifier.cxx
@@ -140,8 +140,7 @@ namespace basctl
//--------------------------------------------------------------------
void SAL_CALL DocumentEventNotifier_Impl::notifyEvent( const EventObject& _rEvent ) throw (RuntimeException)
{
- ::vos::OGuard aSolarGuard( Application::GetSolarMutex() );
- ::osl::MutexGuard aGuard( m_aMutex );
+ ::osl::ClearableMutexGuard aGuard( m_aMutex );
OSL_PRECOND( !impl_isDisposed_nothrow(), "DocumentEventNotifier_Impl::notifyEvent: disposed, but still getting events?" );
if ( impl_isDisposed_nothrow() )
@@ -151,7 +150,6 @@ namespace basctl
OSL_ENSURE( xDocument.is(), "DocumentEventNotifier_Impl::notifyEvent: illegal source document!" );
if ( !xDocument.is() )
return;
- ScriptDocument aDocument( xDocument );
struct EventEntry
{
@@ -172,8 +170,24 @@ namespace basctl
for ( size_t i=0; i < sizeof( aEvents ) / sizeof( aEvents[0] ); ++i )
{
- if ( _rEvent.EventName.equalsAscii( aEvents[i].pEventName ) )
+ if ( !_rEvent.EventName.equalsAscii( aEvents[i].pEventName ) )
+ continue;
+
+ ScriptDocument aDocument( xDocument );
+ {
+ // the listener implementations usually require the SolarMutex, so lock it here.
+ // But ensure the proper order of locking the solar and the own mutex
+ aGuard.clear();
+ ::vos::OClearableGuard aSolarGuard( Application::GetSolarMutex() );
+ ::osl::MutexGuard aGuard2( m_aMutex );
+
+ if ( impl_isDisposed_nothrow() )
+ // somebody took the chance to dispose us -> bail out
+ return;
+
(m_pListener->*aEvents[i].listenerMethod)( aDocument );
+ }
+ break;
}
}
@@ -250,7 +264,6 @@ namespace basctl
//--------------------------------------------------------------------
void DocumentEventNotifier::dispose()
{
- ::vos::OGuard aSolarGuard( Application::GetSolarMutex() );
m_pImpl->dispose();
}