diff options
author | Caolán McNamara <caolanm@redhat.com> | 2014-01-08 11:22:25 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-01-08 13:45:01 +0000 |
commit | 794f5af121906668870a58700aed25b660381240 (patch) | |
tree | 50fb78234c123cba37db426f8f2c5aff5cde1f98 /svx | |
parent | ceffe83515be125df6c3811760ec59b95942a978 (diff) |
Related: rhbz#1047174 avoid access to nonexisting parent dialog
Change-Id: I0bf9116d088adde838993ac5e909a6f3481f883e
Diffstat (limited to 'svx')
-rw-r--r-- | svx/source/dialog/graphctl.cxx | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/svx/source/dialog/graphctl.cxx b/svx/source/dialog/graphctl.cxx index 5e87d51cc376..381418925a42 100644 --- a/svx/source/dialog/graphctl.cxx +++ b/svx/source/dialog/graphctl.cxx @@ -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; } } |