svx/source/dialog/graphctl.cxx | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-)
New commits: commit c4e10ad83fe1fa92a115327c1909218f5dc8c8bd Author: Caolán McNamara <caol...@redhat.com> Date: Wed Jan 8 11:22:25 2014 +0000 Resolves: rhbz#1096486 avoid access to nonexisting parent dialog was Related: rhbz#1047174 (cherry picked from commit 794f5af121906668870a58700aed25b660381240) Change-Id: I0bf9116d088adde838993ac5e909a6f3481f883e Reviewed-on: https://gerrit.libreoffice.org/9326 Reviewed-by: Eike Rathke <er...@redhat.com> Tested-by: Eike Rathke <er...@redhat.com> diff --git a/svx/source/dialog/graphctl.cxx b/svx/source/dialog/graphctl.cxx index 4fc18b7..d70bb3d 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; } }
_______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits