summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2013-08-14 20:29:02 +0100
committerCaolán McNamara <caolanm@redhat.com>2013-08-14 20:30:12 +0100
commitbb2811e8915092539294e85917667b3f36562ade (patch)
treee7adc12d54d704c39daea5b1e937128dd7db03bd /vcl
parentbfb2266c9241bad140ce3b0f0c6dbeab638e947e (diff)
make ESC dtrt for toolboxes inside containers inside dialogs
Change-Id: I08cfdffa27b856c258b55f31f6b5116bec114fb3
Diffstat (limited to 'vcl')
-rw-r--r--vcl/source/window/toolbox.cxx12
1 files changed, 8 insertions, 4 deletions
diff --git a/vcl/source/window/toolbox.cxx b/vcl/source/window/toolbox.cxx
index 76d4c71f1ba6..6c6b9929c628 100644
--- a/vcl/source/window/toolbox.cxx
+++ b/vcl/source/window/toolbox.cxx
@@ -5108,7 +5108,11 @@ void ToolBox::KeyInput( const KeyEvent& rKEvt )
KeyCode aKeyCode = rKEvt.GetKeyCode();
mnKeyModifier = aKeyCode.GetModifier();
sal_uInt16 nCode = aKeyCode.GetCode();
- sal_Bool bParentIsDialog = ( ( ImplGetParent()->GetStyle() & (WB_DIALOGCONTROL | WB_NODIALOGCONTROL) ) == WB_DIALOGCONTROL );
+
+ Window *pParent = ImplGetParent();
+ bool bOldSchoolContainer = ((pParent->GetStyle() & (WB_DIALOGCONTROL | WB_NODIALOGCONTROL)) == WB_DIALOGCONTROL);
+ bool bParentIsContainer = bOldSchoolContainer || isContainerWindow(pParent);
+
sal_Bool bForwardKey = sal_False;
sal_Bool bGrabFocusToDocument = sal_False;
@@ -5199,7 +5203,7 @@ void ToolBox::KeyInput( const KeyEvent& rKEvt )
break;
case KEY_ESCAPE:
{
- if( !ImplIsFloatingMode() && bParentIsDialog )
+ if( !ImplIsFloatingMode() && bParentIsContainer )
DockingWindow::KeyInput( rKEvt );
else
{
@@ -5266,10 +5270,10 @@ void ToolBox::KeyInput( const KeyEvent& rKEvt )
ImplRemoveDel( &aDelData );
// #107251# move focus away if this toolbox was disabled during keyinput
- if( HasFocus() && mpData->mbKeyInputDisabled && (ImplGetParent()->GetStyle() & (WB_DIALOGCONTROL | WB_NODIALOGCONTROL) ) == WB_DIALOGCONTROL)
+ if (HasFocus() && bParentIsContainer)
{
sal_uInt16 n = 0;
- Window *pFocusControl = ImplGetParent()->ImplGetDlgWindow( n, DLGWINDOW_FIRST );
+ Window *pFocusControl = pParent->ImplGetDlgWindow( n, DLGWINDOW_FIRST );
if ( pFocusControl && pFocusControl != this )
pFocusControl->ImplControlFocus( GETFOCUS_INIT );
}