diff options
author | Jim Raykowski <raykowj@gmail.com> | 2018-11-08 22:43:45 -0900 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2018-11-22 22:08:58 +0100 |
commit | af16e73d786ed22fe102bd173ea555630a49a832 (patch) | |
tree | c56b7297272ab0b91a2d7d2fa496c5b5063410f0 | |
parent | e08002d10faf26932f5f154ade4dcd1f88565af2 (diff) |
tdf#121326 Don't tab stop at toolboxes with no visible or enabled items
Change-Id: I4d20bafbda9e6b675654d0359421cf9e57712d15
Reviewed-on: https://gerrit.libreoffice.org/63457
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r-- | vcl/source/window/dlgctrl.cxx | 35 |
1 files changed, 33 insertions, 2 deletions
diff --git a/vcl/source/window/dlgctrl.cxx b/vcl/source/window/dlgctrl.cxx index 261cf32b23a6..dda51ab396a8 100644 --- a/vcl/source/window/dlgctrl.cxx +++ b/vcl/source/window/dlgctrl.cxx @@ -187,6 +187,21 @@ static vcl::Window* ImplGetNextWindow( vcl::Window* pParent, sal_uInt16 n, sal_u namespace vcl { +static bool lcl_ToolBoxTabStop( Window* pWindow ) +{ + ToolBox* pToolBoxWindow = static_cast<ToolBox*>( pWindow ); + + sal_uInt16 nId; + for ( ToolBox::ImplToolItems::size_type nPos = 0; nPos < pToolBoxWindow->GetItemCount(); nPos++ ) + { + nId = pToolBoxWindow->GetItemId( nPos ); + if ( pToolBoxWindow->IsItemVisible( nId ) && pToolBoxWindow->IsItemEnabled( nId ) ) + return true; + } + + return false; +} + vcl::Window* Window::ImplGetDlgWindow( sal_uInt16 nIndex, GetDlgWindowType nType, sal_uInt16 nFormStart, sal_uInt16 nFormEnd, sal_uInt16* pIndex ) @@ -212,7 +227,15 @@ vcl::Window* Window::ImplGetDlgWindow( sal_uInt16 nIndex, GetDlgWindowType nType if ( !pWindow ) break; if ( (i == nTemp) && (pWindow->GetStyle() & WB_TABSTOP) ) - break; + { + if ( WindowType::TOOLBOX == pWindow->GetType() ) + { + if ( lcl_ToolBoxTabStop( pWindow ) ) + break; + } + else + break; + } } while ( i != nIndex ); } @@ -245,7 +268,15 @@ vcl::Window* Window::ImplGetDlgWindow( sal_uInt16 nIndex, GetDlgWindowType nType do { if ( pWindow->GetStyle() & WB_TABSTOP ) - break; + { + if ( WindowType::TOOLBOX == pWindow->GetType() ) + { + if ( lcl_ToolBoxTabStop( pWindow ) ) + break; + } + else + break; + } if( i == nOldIndex ) // only disabled controls ? { i = nStartIndex2; |