diff options
author | Rüdiger Timm <rt@openoffice.org> | 2006-02-09 13:09:19 +0000 |
---|---|---|
committer | Rüdiger Timm <rt@openoffice.org> | 2006-02-09 13:09:19 +0000 |
commit | 8868592ef675f3a936c0d5e2792deca00789e909 (patch) | |
tree | 37290e363cf972702491881e2666ba64b8e62bcd /sfx2/source/view/viewfrm.cxx | |
parent | c18625bf8d2ba9ea2a71a0789870695e286028cd (diff) |
INTEGRATION: CWS fwk32 (1.114.68); FILE MERGED
2006/01/31 09:37:29 as 1.114.68.2: #125432# Workaround: restore old EnableInput value instead of reseting it hardly
2006/01/20 13:38:57 mba 1.114.68.1: #128153#: sfx was not aware of exceptions thrown in ctor of ViewShells
Diffstat (limited to 'sfx2/source/view/viewfrm.cxx')
-rw-r--r-- | sfx2/source/view/viewfrm.cxx | 90 |
1 files changed, 46 insertions, 44 deletions
diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx index c11c15b44b1f..4dca1b472e34 100644 --- a/sfx2/source/view/viewfrm.cxx +++ b/sfx2/source/view/viewfrm.cxx @@ -4,9 +4,9 @@ * * $RCSfile: viewfrm.cxx,v $ * - * $Revision: 1.116 $ + * $Revision: 1.117 $ * - * last change: $Author: rt $ $Date: 2006-02-09 13:59:15 $ + * last change: $Author: rt $ $Date: 2006-02-09 14:09:19 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -264,10 +264,12 @@ struct SfxViewFrame_Impl sal_Bool bModal:1; sal_Bool bEnabled:1; sal_Bool bEventFlag:1; + sal_Bool bWindowWasEnabled:1; SfxViewFrame_Impl() : pReloader(0 ) , pMacro( 0 ) + , bWindowWasEnabled(sal_True) {} ~SfxViewFrame_Impl() @@ -1217,12 +1219,13 @@ void SfxViewFrame::ReleaseObjectShell_Impl( sal_Bool bStoreView ) DBG_ASSERT( xObjSh.Is(), "no SfxObjectShell to release!" ); GetFrame()->ReleasingComponent_Impl( sal_True ); - SfxViewShell *pDyingViewSh = GetViewShell(); - pImp->aLastType = xObjSh->Type(); - - SFX_APP()->NotifyEvent( SfxEventHint(SFX_EVENT_CLOSEVIEW, xObjSh) ); + if ( GetWindow().HasChildPathFocus( sal_True ) ) + { + DBG_ASSERT( !GetActiveChildFrame_Impl(), "Wrong active child frame!" ); + GetWindow().GrabFocus(); + } - HACK(MI weiss nicht wie !pSh sein kann - nach PlugIns isses aber so) + SfxViewShell *pDyingViewSh = GetViewShell(); if ( pDyingViewSh ) { SetRestoreView_Impl( bStoreView ); @@ -1243,49 +1246,45 @@ void SfxViewFrame::ReleaseObjectShell_Impl( sal_Bool bStoreView ) pDispatcher->Pop( *pSubShell, SFX_SHELL_POP_UNTIL | SFX_SHELL_POP_DELETE ); } pDispatcher->Pop( *pDyingViewSh ); + pDispatcher->Flush(); + pDyingViewSh->DisconnectAllClients(); + SetViewShell_Impl(0); + delete pDyingViewSh; } #ifdef DBG_UTIL else DBG_ERROR("Keine Shell"); #endif - GetDispatcher()->Flush(); - - if ( GetWindow().HasChildPathFocus( sal_True ) ) - { - DBG_ASSERT( !GetActiveChildFrame_Impl(), "Wrong active child frame!" ); - GetWindow().GrabFocus(); - } - - pDyingViewSh->DisconnectAllClients(); - SetViewShell_Impl(0); - delete pDyingViewSh; - - pDispatcher->Pop( *xObjSh ); - SfxModule* pModule = xObjSh->GetModule(); - if( pModule ) - pDispatcher->RemoveShell_Impl( *pModule ); - - pDispatcher->Flush(); - EndListening( *xObjSh ); - SFX_NOTIFY( *xObjSh, xObjSh->Type(), - SfxSimpleHint(SFX_HINT_TITLECHANGED), - TYPE(SfxSimpleHint) ); - - SFX_NOTIFY( *xObjSh, xObjSh->Type(), - SfxSimpleHint(SFX_HINT_DOCCHANGED), - TYPE(SfxSimpleHint) ); - - if ( 1 == xObjSh->GetOwnerLockCount() && pImp->bObjLocked && xObjSh->GetCreateMode() == SFX_CREATE_MODE_EMBEDDED ) - xObjSh->DoClose(); - SfxObjectShellRef xDyingObjSh = xObjSh; - xObjSh.Clear(); - if( ( GetFrameType() & SFXFRAME_HASTITLE ) && pImp->nDocViewNo ) - xDyingObjSh->GetNoSet_Impl().ReleaseIndex(pImp->nDocViewNo-1); - if ( pImp->bObjLocked ) + if ( xObjSh.Is() ) { - xDyingObjSh->OwnerLock( sal_False ); - pImp->bObjLocked = sal_False; + pImp->aLastType = xObjSh->Type(); + pDispatcher->Pop( *xObjSh ); + SfxModule* pModule = xObjSh->GetModule(); + if( pModule ) + pDispatcher->RemoveShell_Impl( *pModule ); + pDispatcher->Flush(); + EndListening( *xObjSh ); + + SFX_NOTIFY( *xObjSh, xObjSh->Type(), + SfxSimpleHint(SFX_HINT_TITLECHANGED), + TYPE(SfxSimpleHint) ); + + SFX_NOTIFY( *xObjSh, xObjSh->Type(), + SfxSimpleHint(SFX_HINT_DOCCHANGED), + TYPE(SfxSimpleHint) ); + + if ( 1 == xObjSh->GetOwnerLockCount() && pImp->bObjLocked && xObjSh->GetCreateMode() == SFX_CREATE_MODE_EMBEDDED ) + xObjSh->DoClose(); + SfxObjectShellRef xDyingObjSh = xObjSh; + xObjSh.Clear(); + if( ( GetFrameType() & SFXFRAME_HASTITLE ) && pImp->nDocViewNo ) + xDyingObjSh->GetNoSet_Impl().ReleaseIndex(pImp->nDocViewNo-1); + if ( pImp->bObjLocked ) + { + xDyingObjSh->OwnerLock( sal_False ); + pImp->bObjLocked = sal_False; + } } GetDispatcher()->SetDisableFlags( 0 ); @@ -2100,7 +2099,10 @@ void SfxViewFrame::Enable( sal_Bool bEnable ) else { Window *pWindow = &GetFrame()->GetTopFrame()->GetWindow(); - pWindow->EnableInput( bEnable, TRUE ); + if ( !bEnable ) + pImp->bWindowWasEnabled = pWindow->IsInputEnabled(); + if ( !bEnable || pImp->bWindowWasEnabled ) + pWindow->EnableInput( bEnable, TRUE ); } // cursor and focus |