[Libreoffice-commits] core.git: vcl/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Thu Nov 22 21:09:29 UTC 2018


 vcl/source/window/dlgctrl.cxx |   35 +++++++++++++++++++++++++++++++++--
 1 file changed, 33 insertions(+), 2 deletions(-)

New commits:
commit af16e73d786ed22fe102bd173ea555630a49a832
Author:     Jim Raykowski <raykowj at gmail.com>
AuthorDate: Thu Nov 8 22:43:45 2018 -0900
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Thu Nov 22 22:08:58 2018 +0100

    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 at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

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;


More information about the Libreoffice-commits mailing list