Kaydet (Commit) 8c4bbc0a authored tarafından Michael Meeks's avatar Michael Meeks

tdf#91100 - don't Notify focus changes after dispose.

Change-Id: If870f88d1d83db8bd436ac1bb9a1c676c34605b5
üst e5ce3680
......@@ -48,8 +48,8 @@ using namespace ::com::sun::star::uno;
SingleTabDlgImpl::SingleTabDlgImpl()
: m_pSfxPage(NULL)
, m_pLine(NULL)
{
}
{
}
class SfxModelessDialog_Impl : public SfxListener
{
......@@ -335,30 +335,31 @@ void SfxModelessDialog::Init(SfxBindings *pBindinx, SfxChildWindow *pCW)
*/
bool SfxModelessDialog::Notify( NotifyEvent& rEvt )
{
if ( rEvt.GetType() == MouseNotifyEvent::GETFOCUS )
{
pBindings->SetActiveFrame( pImp->pMgr->GetFrame() );
pImp->pMgr->Activate_Impl();
}
else if ( rEvt.GetType() == MouseNotifyEvent::LOSEFOCUS && !HasChildPathFocus() )
{
pBindings->SetActiveFrame( ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > () );
pImp->pMgr->Deactivate_Impl();
}
else if( rEvt.GetType() == MouseNotifyEvent::KEYINPUT )
if ( pImp )
{
// First, allow KeyInput for Dialog functions ( TAB etc. )
if ( !ModelessDialog::Notify( rEvt ) && SfxViewShell::Current() )
// then also for valid global accelerators.
return SfxViewShell::Current()->GlobalKeyInput_Impl( *rEvt.GetKeyEvent() );
return true;
if ( rEvt.GetType() == MouseNotifyEvent::GETFOCUS )
{
pBindings->SetActiveFrame( pImp->pMgr->GetFrame() );
pImp->pMgr->Activate_Impl();
}
else if ( rEvt.GetType() == MouseNotifyEvent::LOSEFOCUS && !HasChildPathFocus() )
{
pBindings->SetActiveFrame( ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > () );
pImp->pMgr->Deactivate_Impl();
}
else if( rEvt.GetType() == MouseNotifyEvent::KEYINPUT )
{
// First, allow KeyInput for Dialog functions ( TAB etc. )
if ( !ModelessDialog::Notify( rEvt ) && SfxViewShell::Current() )
// then also for valid global accelerators.
return SfxViewShell::Current()->GlobalKeyInput_Impl( *rEvt.GetKeyEvent() );
return true;
}
}
return ModelessDialog::Notify( rEvt );
}
SfxModelessDialog::~SfxModelessDialog()
{
disposeOnce();
......@@ -369,6 +370,7 @@ void SfxModelessDialog::dispose()
if ( pImp->pMgr->GetFrame().is() && pImp->pMgr->GetFrame() == pBindings->GetActiveFrame() )
pBindings->SetActiveFrame( NULL );
delete pImp;
pImp = NULL;
ModelessDialog::dispose();
}
......@@ -423,33 +425,34 @@ bool SfxFloatingWindow::Notify( NotifyEvent& rEvt )
*/
{
if ( rEvt.GetType() == MouseNotifyEvent::GETFOCUS )
{
pBindings->SetActiveFrame( pImp->pMgr->GetFrame() );
pImp->pMgr->Activate_Impl();
}
else if ( rEvt.GetType() == MouseNotifyEvent::LOSEFOCUS )
if ( pImp )
{
if ( !HasChildPathFocus() )
if ( rEvt.GetType() == MouseNotifyEvent::GETFOCUS )
{
pBindings->SetActiveFrame( NULL );
pImp->pMgr->Deactivate_Impl();
pBindings->SetActiveFrame( pImp->pMgr->GetFrame() );
pImp->pMgr->Activate_Impl();
}
else if ( rEvt.GetType() == MouseNotifyEvent::LOSEFOCUS )
{
if ( !HasChildPathFocus() )
{
pBindings->SetActiveFrame( NULL );
pImp->pMgr->Deactivate_Impl();
}
}
else if( rEvt.GetType() == MouseNotifyEvent::KEYINPUT )
{
// First, allow KeyInput for Dialog functions
if ( !FloatingWindow::Notify( rEvt ) && SfxViewShell::Current() )
// then also for valid global accelerators.
return SfxViewShell::Current()->GlobalKeyInput_Impl( *rEvt.GetKeyEvent() );
return true;
}
}
else if( rEvt.GetType() == MouseNotifyEvent::KEYINPUT )
{
// First, allow KeyInput for Dialog functions
if ( !FloatingWindow::Notify( rEvt ) && SfxViewShell::Current() )
// then also for valid global accelerators.
return SfxViewShell::Current()->GlobalKeyInput_Impl( *rEvt.GetKeyEvent() );
return true;
}
return FloatingWindow::Notify( rEvt );
}
SfxFloatingWindow::SfxFloatingWindow( SfxBindings *pBindinx,
SfxChildWindow *pCW,
vcl::Window* pParent, WinBits nWinBits) :
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment