tdf#120534 Make escape key focus to document from sidebar

from all locations other than panel content

Change-Id: I85a113d3001338dd1aff27bac75a5debd4635d59
Reviewed-on: https://gerrit.libreoffice.org/62808
Tested-by: Jenkins
Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
diff --git a/sfx2/source/sidebar/FocusManager.cxx b/sfx2/source/sidebar/FocusManager.cxx
index 9645cb1..610e28a 100644
--- a/sfx2/source/sidebar/FocusManager.cxx
+++ b/sfx2/source/sidebar/FocusManager.cxx
@@ -27,6 +27,8 @@
#include <vcl/toolbox.hxx>
#include <toolkit/helper/vclunohelper.hxx>

#include <sfx2/app.hxx>

namespace sfx2 { namespace sidebar {

FocusManager::FocusLocation::FocusLocation (const PanelComponent eComponent, const sal_Int32 nIndex)
@@ -371,6 +373,26 @@

    switch (rKeyCode.GetCode())
    {
        case KEY_ESCAPE:
            switch (aLocation.meComponent)
            {
                case PC_TabBar:
                case PC_DeckTitle:
                case PC_DeckToolBox:
                case PC_PanelTitle:
                case PC_PanelToolBox:
                {
                    vcl::Window* pFocusWin = Application::GetFocusWindow();
                    if (pFocusWin)
                        pFocusWin->GrabFocusToDocument();
                    break;
                }

                default:
                    break;
            }
            return;

        case KEY_SPACE:
            switch (aLocation.meComponent)
            {