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

Jim Raykowski (via logerrit) logerrit at kemper.freedesktop.org
Tue May 28 06:05:30 UTC 2019


 sfx2/source/sidebar/SidebarDockingWindow.cxx |   44 +++++++++++++++++----------
 1 file changed, 29 insertions(+), 15 deletions(-)

New commits:
commit d0d9acc7c6095e0bc640e073b9d8e2e19aaa8993
Author:     Jim Raykowski <raykowj at gmail.com>
AuthorDate: Mon May 27 17:10:28 2019 -0800
Commit:     Jim Raykowski <raykowj at gmail.com>
CommitDate: Tue May 28 08:04:54 2019 +0200

    tdf#125525 Allow shortcut keys from sidebar docking window
    
    Fix for tdf#115434 prevents key presses being passed through to document
    window from the sidebar docking window. This patch only prevents left,
    right, down, up, page down/up, home, end, backspace, delete, insert and
    return keys from being passed.
    
    Change-Id: I97ab60a214cb9910f526a475f3134784728b7d9a
    Reviewed-on: https://gerrit.libreoffice.org/73073
    Tested-by: Jenkins
    Reviewed-by: Jim Raykowski <raykowj at gmail.com>

diff --git a/sfx2/source/sidebar/SidebarDockingWindow.cxx b/sfx2/source/sidebar/SidebarDockingWindow.cxx
index 7e4d98e78d77..1784180a9e9f 100644
--- a/sfx2/source/sidebar/SidebarDockingWindow.cxx
+++ b/sfx2/source/sidebar/SidebarDockingWindow.cxx
@@ -126,25 +126,39 @@ bool SidebarDockingWindow::EventNotify(NotifyEvent& rEvent)
     if (MouseNotifyEvent::KEYINPUT == nType)
     {
         const vcl::KeyCode& rKeyCode = rEvent.GetKeyEvent()->GetKeyCode();
-        if (!(rKeyCode.GetCode() == KEY_F10 && rKeyCode.GetModifier() &&
-            rKeyCode.IsShift() && rKeyCode.IsMod1()))
+        switch (rKeyCode.GetCode())
         {
-            if (!mpAccel)
+            case KEY_UP:
+            case KEY_DOWN:
+            case KEY_PAGEUP:
+            case KEY_PAGEDOWN:
+            case KEY_HOME:
+            case KEY_END:
+            case KEY_LEFT:
+            case KEY_RIGHT:
+            case KEY_BACKSPACE:
+            case KEY_DELETE:
+            case KEY_INSERT:
+            case KEY_RETURN:
             {
-                mpAccel = svt::AcceleratorExecute::createAcceleratorHelper();
-                mpAccel->init(comphelper::getProcessComponentContext(), mpSidebarController->getXFrame());
-            }
-            const OUString aCommand(mpAccel->findCommand(svt::AcceleratorExecute::st_VCLKey2AWTKey(rKeyCode)));
-            if (".uno:DesignerDialog" == aCommand)
-            {
-                std::shared_ptr<PanelDescriptor> xPanelDescriptor =
-                    mpSidebarController->GetResourceManager()->GetPanelDescriptor( "StyleListPanel" );
-                if ( xPanelDescriptor && mpSidebarController->IsDeckVisible( xPanelDescriptor->msDeckId ) )
-                    Close();
                 return true;
             }
-            if (".uno:Sidebar" != aCommand)
-                return true;
+            default:
+            break;
+        }
+        if (!mpAccel)
+        {
+            mpAccel = svt::AcceleratorExecute::createAcceleratorHelper();
+            mpAccel->init(comphelper::getProcessComponentContext(), mpSidebarController->getXFrame());
+        }
+        const OUString aCommand(mpAccel->findCommand(svt::AcceleratorExecute::st_VCLKey2AWTKey(rKeyCode)));
+        if (".uno:DesignerDialog" == aCommand)
+        {
+            std::shared_ptr<PanelDescriptor> xPanelDescriptor =
+                    mpSidebarController->GetResourceManager()->GetPanelDescriptor( "StyleListPanel" );
+            if ( xPanelDescriptor && mpSidebarController->IsDeckVisible( xPanelDescriptor->msDeckId ) )
+                Close();
+            return true;
         }
     }
     else if (MouseNotifyEvent::MOUSEBUTTONDOWN == nType)


More information about the Libreoffice-commits mailing list