Kaydet (Commit) 794f5af1 authored tarafından Caolán McNamara's avatar Caolán McNamara

Related: rhbz#1047174 avoid access to nonexisting parent dialog

Change-Id: I0bf9116d088adde838993ac5e909a6f3481f883e
üst ceffe835
...@@ -309,6 +309,8 @@ void GraphCtrl::KeyInput( const KeyEvent& rKEvt ) ...@@ -309,6 +309,8 @@ void GraphCtrl::KeyInput( const KeyEvent& rKEvt )
KeyCode aCode( rKEvt.GetKeyCode() ); KeyCode aCode( rKEvt.GetKeyCode() );
bool bProc = false; bool bProc = false;
Dialog* pDialog = GetParentDialog();
switch ( aCode.GetCode() ) switch ( aCode.GetCode() )
{ {
case KEY_DELETE: case KEY_DELETE:
...@@ -318,8 +320,8 @@ void GraphCtrl::KeyInput( const KeyEvent& rKEvt ) ...@@ -318,8 +320,8 @@ void GraphCtrl::KeyInput( const KeyEvent& rKEvt )
{ {
pView->DeleteMarked(); pView->DeleteMarked();
bProc = true; bProc = true;
if( !pView->AreObjectsMarked() ) if (!pView->AreObjectsMarked() && pDialog)
GetParentDialog()->GrabFocusToFirstControl(); pDialog->GrabFocusToFirstControl();
} }
} }
break; break;
...@@ -328,9 +330,11 @@ void GraphCtrl::KeyInput( const KeyEvent& rKEvt ) ...@@ -328,9 +330,11 @@ void GraphCtrl::KeyInput( const KeyEvent& rKEvt )
{ {
if ( bSdrMode ) if ( bSdrMode )
{ {
bool bGrabFocusToFirstControl = true;
if ( pView->IsAction() ) if ( pView->IsAction() )
{ {
pView->BrkAction(); pView->BrkAction();
bGrabFocusToFirstControl = false;
} }
else if ( pView->AreObjectsMarked() ) else if ( pView->AreObjectsMarked() )
{ {
...@@ -340,16 +344,11 @@ void GraphCtrl::KeyInput( const KeyEvent& rKEvt ) ...@@ -340,16 +344,11 @@ void GraphCtrl::KeyInput( const KeyEvent& rKEvt )
if(pHdl) if(pHdl)
{ {
((SdrHdlList&)rHdlList).ResetFocusHdl(); ((SdrHdlList&)rHdlList).ResetFocusHdl();
bGrabFocusToFirstControl = false;
} }
else
{
GetParentDialog()->GrabFocusToFirstControl();
}
}
else
{
GetParentDialog()->GrabFocusToFirstControl();
} }
if (bGrabFocusToFirstControl && pDialog)
pDialog->GrabFocusToFirstControl();
bProc = true; bProc = true;
} }
} }
......
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