tdf#120086: Patch for TAB-ing order of Gallery sidebar panel

The current TAB-ing order of Gallery sidebar panel is not sequential
and the order needed to be changed. This patch fixes the TAB-ing order
of the gallery sidebar panel to a more sequential and convenient one.
It also fixes the reverse TAB-ing order (Shift+TAB).

Change-Id: Ib0b22ccef1fa4676e535f42a794fb7c836741d0b
Reviewed-on: https://gerrit.libreoffice.org/65907
Reviewed-by: Jim Raykowski <raykowj@gmail.com>
Tested-by: Mike Kaganski <mike.kaganski@collabora.com>
diff --git a/svx/source/gallery2/GalleryControl.cxx b/svx/source/gallery2/GalleryControl.cxx
old mode 100644
new mode 100755
index d41c3e8..f54034a
--- a/svx/source/gallery2/GalleryControl.cxx
+++ b/svx/source/gallery2/GalleryControl.cxx
@@ -185,25 +185,35 @@ bool GalleryControl::GalleryKeyInput( const KeyEvent& rKEvt )
    {
        if( !rKEvt.GetKeyCode().IsShift() )
        {
            if( mpBrowser1->mpThemes->HasChildPathFocus( true ) )
                mpBrowser2->GetViewWindow()->GrabFocus();
            else if( mpBrowser2->GetViewWindow()->HasFocus() )
            if( mpBrowser1->maNewTheme->HasFocus() )
                mpBrowser1->mpThemes->GrabFocus();
            else if( mpBrowser1->mpThemes->HasChildPathFocus( true ) )
                mpBrowser2->maViewBox->GrabFocus();
            else if( mpBrowser2->maViewBox->HasFocus() )
                mpBrowser1->maNewTheme->GrabFocus();
                mpBrowser2->GetViewWindow()->GrabFocus();
            else
                mpBrowser1->mpThemes->GrabFocus();
            {
                if( mpBrowser1->maNewTheme->IsEnabled() )
                    mpBrowser1->maNewTheme->GrabFocus();
                else
                    mpBrowser1->mpThemes->GrabFocus();
            }
        }
        else
        {
            if( mpBrowser1->mpThemes->HasChildPathFocus( true ) )
                mpBrowser1->maNewTheme->GrabFocus();
            else if( mpBrowser1->maNewTheme->HasFocus() )
            if( mpBrowser2->GetViewWindow()->HasFocus() )
                mpBrowser2->maViewBox->GrabFocus();
            else if( mpBrowser2->maViewBox->HasFocus() )
                mpBrowser2->GetViewWindow()->GrabFocus();
            else
                mpBrowser1->mpThemes->GrabFocus();
            else if( mpBrowser1->mpThemes->HasChildPathFocus( true ) )
            {
                if( mpBrowser1->maNewTheme->IsEnabled() )
                    mpBrowser1->maNewTheme->GrabFocus();
                else
                    mpBrowser2->GetViewWindow()->GrabFocus();
            }
            else
                mpBrowser2->GetViewWindow()->GrabFocus();
        }
    }

diff --git a/svx/source/gallery2/galbrws1.cxx b/svx/source/gallery2/galbrws1.cxx
old mode 100644
new mode 100755
index 416fa67..8c54ac5
--- a/svx/source/gallery2/galbrws1.cxx
+++ b/svx/source/gallery2/galbrws1.cxx
@@ -410,7 +410,9 @@ void GalleryBrowser1::Resize()
void GalleryBrowser1::GetFocus()
{
    Control::GetFocus();
    if( mpThemes )
    if( maNewTheme->IsEnabled() )
        maNewTheme->GrabFocus();
    else
        mpThemes->GrabFocus();
}