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

Jim Raykowski raykowj at gmail.com
Tue Mar 13 23:34:10 UTC 2018


 include/vcl/toolbox.hxx              |    2 ++
 sfx2/source/sidebar/FocusManager.cxx |    6 +++++-
 sw/source/uibase/cctrl/actctrl.cxx   |   15 +++++++++++++--
 vcl/source/window/toolbox.cxx        |    5 +++++
 4 files changed, 25 insertions(+), 3 deletions(-)

New commits:
commit 6d2f6f2f01a4fbf244ba16c355d2f43a2ddf671e
Author: Jim Raykowski <raykowj at gmail.com>
Date:   Thu Feb 8 18:27:56 2018 -0900

    tdf#115565 Change tab key behavior to navigate out of gotopage control
    
    ...in Writer Sidebar Navigator deck helper toolbox
    
    Change-Id: Ieeabcb30f421aa0ce2a5f841e45fff5f57358215
    Reviewed-on: https://gerrit.libreoffice.org/50295
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>

diff --git a/include/vcl/toolbox.hxx b/include/vcl/toolbox.hxx
index 700da27363fb..92382df66bce 100644
--- a/include/vcl/toolbox.hxx
+++ b/include/vcl/toolbox.hxx
@@ -510,6 +510,8 @@ public:
     static Size         GetDefaultImageSize(ToolBoxButtonSize eToolBoxButtonSize);
     Size                GetDefaultImageSize() const;
     void                ChangeHighlight( ImplToolItems::size_type nPos );
+    bool                ChangeHighlightUpDn( bool bUp, bool bNoCyle = false );
+
 
     void SetToolbarLayoutMode( ToolBoxLayoutMode eLayout );
     void statusChanged(const css::frame::FeatureStateEvent& rEvent);
diff --git a/sfx2/source/sidebar/FocusManager.cxx b/sfx2/source/sidebar/FocusManager.cxx
index 78cb149ba0bf..9872e34817e6 100644
--- a/sfx2/source/sidebar/FocusManager.cxx
+++ b/sfx2/source/sidebar/FocusManager.cxx
@@ -571,13 +571,17 @@ IMPL_LINK(FocusManager, ChildEventListener, VclWindowEvent&, rEvent, void)
                         break;
 
                     case KEY_TAB:
+                        {
+                        WindowType aWindowType = pSource->GetType();
                         if (mpFirstFocusedContentControl!=nullptr
-                            && mpLastFocusedWindow == mpFirstFocusedContentControl)
+                            && ( mpLastFocusedWindow == mpFirstFocusedContentControl
+                                 && !( WindowType::EDIT == aWindowType || WindowType::SPINFIELD == aWindowType ) ))
                         {
                             // Move focus back to panel (or deck)
                             // title.
                             FocusPanel(aLocation.mnIndex, true);
                         }
+                        }
                         break;
 
                     default:
diff --git a/sw/source/uibase/cctrl/actctrl.cxx b/sw/source/uibase/cctrl/actctrl.cxx
index 7e97dab5ce97..0c7afd70a8f6 100644
--- a/sw/source/uibase/cctrl/actctrl.cxx
+++ b/sw/source/uibase/cctrl/actctrl.cxx
@@ -20,6 +20,7 @@
 #include <comphelper/string.hxx>
 #include <vcl/builderfactory.hxx>
 #include <actctrl.hxx>
+#include <vcl/toolbox.hxx>
 
 bool NumEditAction::EventNotify( NotifyEvent& rNEvt )
 {
@@ -29,14 +30,24 @@ bool NumEditAction::EventNotify( NotifyEvent& rNEvt )
     {
         const KeyEvent* pKEvt = rNEvt.GetKeyEvent();
         const vcl::KeyCode aKeyCode = pKEvt->GetKeyCode();
+        const sal_uInt16 aCode = aKeyCode.GetCode();
         const sal_uInt16 nModifier = aKeyCode.GetModifier();
-        if( aKeyCode.GetCode() == KEY_RETURN &&
+        if( aCode == KEY_RETURN &&
                 !nModifier)
         {
             aActionLink.Call( *this );
             bHandled = true;
         }
-
+        else
+        {
+            vcl::Window* pParent = GetParent();
+            if ( pParent != nullptr && aCode == KEY_TAB &&
+                 pParent->GetType() == WindowType::TOOLBOX )
+            {
+                static_cast<ToolBox*>(pParent)->ChangeHighlightUpDn( aKeyCode.IsShift() );
+                bHandled = true;
+            }
+        }
     }
     if(!bHandled)
         NumericField::EventNotify(rNEvt);
diff --git a/vcl/source/window/toolbox.cxx b/vcl/source/window/toolbox.cxx
index 35c8e3a7c2af..5e7b424c1392 100644
--- a/vcl/source/window/toolbox.cxx
+++ b/vcl/source/window/toolbox.cxx
@@ -4890,6 +4890,11 @@ static bool ImplIsValidItem( const ImplToolItem* pItem, bool bNotClipped )
     return bValid;
 }
 
+bool ToolBox::ChangeHighlightUpDn( bool bUp, bool bNoCyle )
+{
+    return ImplChangeHighlightUpDn(bUp, bNoCyle);
+}
+
 bool ToolBox::ImplChangeHighlightUpDn( bool bUp, bool bNoCycle )
 {
     ImplToolItem* pToolItem = ImplGetItem( mnHighItemId );


More information about the Libreoffice-commits mailing list