diff options
Diffstat (limited to 'sd/source/ui/accessibility/AccessibleOutlineEditSource.cxx')
-rw-r--r-- | sd/source/ui/accessibility/AccessibleOutlineEditSource.cxx | 28 |
1 files changed, 24 insertions, 4 deletions
diff --git a/sd/source/ui/accessibility/AccessibleOutlineEditSource.cxx b/sd/source/ui/accessibility/AccessibleOutlineEditSource.cxx index 8b4ec2819db2..2b9e977b073f 100644 --- a/sd/source/ui/accessibility/AccessibleOutlineEditSource.cxx +++ b/sd/source/ui/accessibility/AccessibleOutlineEditSource.cxx @@ -56,6 +56,7 @@ namespace accessibility { // register as listener - need to broadcast state change messages rOutliner.SetNotifyHdl( LINK(this, AccessibleOutlineEditSource, NotifyHdl) ); + StartListening(rOutliner); } AccessibleOutlineEditSource::~AccessibleOutlineEditSource() @@ -177,13 +178,32 @@ namespace accessibility return Point(); } - void AccessibleOutlineEditSource::Notify( SfxBroadcaster&, const SfxHint& rHint ) + void AccessibleOutlineEditSource::Notify( SfxBroadcaster& rBroadcaster, const SfxHint& rHint ) { - const SdrHint* pSdrHint = dynamic_cast< const SdrHint* >( &rHint ); + bool bDispose = false; - if( pSdrHint && ( pSdrHint->GetKind() == HINT_MODELCLEARED ) ) + if( &rBroadcaster == mpOutliner ) + { + const SfxSimpleHint* pHint = dynamic_cast< const SfxSimpleHint * >( &rHint ); + if( pHint && (pHint->GetId() == SFX_HINT_DYING) ) + { + bDispose = true; + mpOutliner = NULL; + } + } + else + { + const SdrHint* pSdrHint = dynamic_cast< const SdrHint* >( &rHint ); + + if( pSdrHint && ( pSdrHint->GetKind() == HINT_MODELCLEARED ) ) + { + // model is dying under us, going defunc + bDispose = true; + } + } + + if( bDispose ) { - // model is dying under us, going defunc if( mpOutliner ) mpOutliner->SetNotifyHdl( Link() ); mpOutliner = NULL; |