diff options
author | Thorsten Behrens <thb@openoffice.org> | 2002-06-04 17:44:27 +0000 |
---|---|---|
committer | Thorsten Behrens <thb@openoffice.org> | 2002-06-04 17:44:27 +0000 |
commit | 08845a79bb8f19298a54f3c2a9a82b8da698fbf2 (patch) | |
tree | f5abcc3191c296a4dcb0eff7a2d71a22b0444221 /svx/source/unodraw | |
parent | 77c61241e8e9352ce6140ce00a8347ff5b534194 (diff) |
#99840# Fixed various focus problems
Diffstat (limited to 'svx/source/unodraw')
-rw-r--r-- | svx/source/unodraw/unoshtxt.cxx | 51 |
1 files changed, 33 insertions, 18 deletions
diff --git a/svx/source/unodraw/unoshtxt.cxx b/svx/source/unodraw/unoshtxt.cxx index 68768875bce6..bf3ec38fc568 100644 --- a/svx/source/unodraw/unoshtxt.cxx +++ b/svx/source/unodraw/unoshtxt.cxx @@ -2,9 +2,9 @@ * * $RCSfile: unoshtxt.cxx,v $ * - * $Revision: 1.33 $ + * $Revision: 1.34 $ * - * last change: $Author: thb $ $Date: 2002-05-29 16:07:34 $ + * last change: $Author: thb $ $Date: 2002-06-04 18:43:44 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -173,6 +173,7 @@ private: BOOL mbNeedsUpdate; BOOL mbOldUndoMode; BOOL mbForwarderIsEditMode; // have to reflect that, since ENDEDIT can happen more often + BOOL mbNotificationsDisabled; // prevent EditEngine/Outliner notifications (e.g. when setting up forwarder) SvxTextForwarder* GetBackgroundTextForwarder(); SvxTextForwarder* GetEditModeTextForwarder(); @@ -231,7 +232,8 @@ SvxTextEditSourceImpl::SvxTextEditSourceImpl( SdrObject* pObject ) mbIsLocked ( FALSE ), mbNeedsUpdate ( FALSE ), mbOldUndoMode ( FALSE ), - mbForwarderIsEditMode ( FALSE ) + mbForwarderIsEditMode ( FALSE ), + mbNotificationsDisabled ( FALSE ) { DBG_ASSERT( mpObject, "invalid pObject!" ); @@ -255,7 +257,8 @@ SvxTextEditSourceImpl::SvxTextEditSourceImpl( SdrObject& rObject, SdrView& rView mbIsLocked ( FALSE ), mbNeedsUpdate ( FALSE ), mbOldUndoMode ( FALSE ), - mbForwarderIsEditMode ( FALSE ) + mbForwarderIsEditMode ( FALSE ), + mbNotificationsDisabled ( FALSE ) { if( mpModel ) StartListening( *mpModel ); @@ -356,26 +359,32 @@ void SvxTextEditSourceImpl::Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) } case HINT_BEGEDIT: - // invalidate old forwarder - if( !mbForwarderIsEditMode ) + if( mpObject == pSdrHint->GetObject() ) { - delete mpTextForwarder; - mpTextForwarder = NULL; - } + // invalidate old forwarder + if( !mbForwarderIsEditMode ) + { + delete mpTextForwarder; + mpTextForwarder = NULL; + } - // register as listener - need to broadcast state change messages - if( mpView && mpView->GetTextEditOutliner() ) - mpView->GetTextEditOutliner()->SetNotifyHdl( LINK(this, SvxTextEditSourceImpl, NotifyHdl) ); + // register as listener - need to broadcast state change messages + if( mpView && mpView->GetTextEditOutliner() ) + mpView->GetTextEditOutliner()->SetNotifyHdl( LINK(this, SvxTextEditSourceImpl, NotifyHdl) ); - Broadcast( *pSdrHint ); + Broadcast( *pSdrHint ); + } break; case HINT_ENDEDIT: - // remove as listener - outliner might outlive ourselves - if( mpView && mpView->GetTextEditOutliner() ) - mpView->GetTextEditOutliner()->SetNotifyHdl( Link() ); + if( mpObject == pSdrHint->GetObject() ) + { + // remove as listener - outliner might outlive ourselves + if( mpView && mpView->GetTextEditOutliner() ) + mpView->GetTextEditOutliner()->SetNotifyHdl( Link() ); - Broadcast( *pSdrHint ); + Broadcast( *pSdrHint ); + } break; } } @@ -433,6 +442,9 @@ SvxTextForwarder* SvxTextEditSourceImpl::GetBackgroundTextForwarder() { sal_Bool bCreated = sal_False; + // #99840#: prevent EE/Outliner notifications during setup + mbNotificationsDisabled = sal_True; + if (!mpTextForwarder) { if( mpOutliner == NULL ) @@ -555,6 +567,9 @@ SvxTextForwarder* SvxTextEditSourceImpl::GetBackgroundTextForwarder() mpOutliner->SetNotifyHdl( LINK(this, SvxTextEditSourceImpl, NotifyHdl) ); } + // #99840#: prevent EE/Outliner notifications during setup + mbNotificationsDisabled = sal_False; + return mpTextForwarder; } @@ -804,7 +819,7 @@ Point SvxTextEditSourceImpl::PixelToLogic( const Point& rPoint, const MapMode& r IMPL_LINK(SvxTextEditSourceImpl, NotifyHdl, EENotify*, aNotify) { - if( aNotify ) + if( aNotify && !mbNotificationsDisabled ) { ::std::auto_ptr< SfxHint > aHint( SvxEditSourceHintTranslator::EENotification2Hint( aNotify) ); |