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