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

Caolán McNamara caolanm at redhat.com
Tue May 10 13:47:41 UTC 2016


 vcl/source/window/menubarwindow.cxx |    9 +++++++++
 vcl/source/window/menubarwindow.hxx |    1 +
 vcl/source/window/taskpanelist.cxx  |   10 +++-------
 3 files changed, 13 insertions(+), 7 deletions(-)

New commits:
commit b04664511e297b796c8882d05a4fac91924169d3
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue May 10 14:46:28 2016 +0100

    separate this piece of goo out into a standalone thing
    
    no logic change
    
    Change-Id: Ib03a2516c9b3cf6bedf52760d8f7cb68cc70464f

diff --git a/vcl/source/window/menubarwindow.cxx b/vcl/source/window/menubarwindow.cxx
index 8f496ea..4b72e0b 100644
--- a/vcl/source/window/menubarwindow.cxx
+++ b/vcl/source/window/menubarwindow.cxx
@@ -1178,4 +1178,13 @@ bool MenuBarWindow::HandleMenuButtonEvent( sal_uInt16 i_nButtonId )
     return false;
 }
 
+bool MenuBarWindow::CanGetFocus() const
+{
+    /* #i83908# do not use the menubar if it is native and invisible
+       this relies on MenuBar::ImplCreate setting the height of the menubar
+       to 0 in this case
+    */
+    return GetSizePixel().Height() > 0;
+}
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/window/menubarwindow.hxx b/vcl/source/window/menubarwindow.hxx
index 8565eb0..57127b1 100644
--- a/vcl/source/window/menubarwindow.hxx
+++ b/vcl/source/window/menubarwindow.hxx
@@ -148,6 +148,7 @@ public:
     bool GetMBWHideAccel() const { return mbHideAccel; }
     void SetMBWMenuKey(bool val) { mbMenuKey = val; }
     bool GetMBWMenuKey() const { return mbMenuKey; }
+    bool CanGetFocus() const;
 };
 
 #endif // INCLUDED_VCL_SOURCE_WINDOW_MENUBARWINDOW_HXX
diff --git a/vcl/source/window/taskpanelist.cxx b/vcl/source/window/taskpanelist.cxx
index 238f8fa..3b9a3d9 100644
--- a/vcl/source/window/taskpanelist.cxx
+++ b/vcl/source/window/taskpanelist.cxx
@@ -23,6 +23,7 @@
 #include <vcl/taskpanelist.hxx>
 
 #include <svdata.hxx>
+#include "menubarwindow.hxx"
 
 #include <functional>
 #include <algorithm>
@@ -161,9 +162,7 @@ bool TaskPaneList::HandleKeyEvent(const KeyEvent& rKeyEvent)
     bool bForward = !aKeyCode.IsShift();
     if( aKeyCode.GetCode() == KEY_F6 && ! aKeyCode.IsMod2() ) // F6
     {
-        bool bSplitterOnly;
-
-        bSplitterOnly = aKeyCode.IsMod1() && aKeyCode.IsShift();
+        bool bSplitterOnly = aKeyCode.IsMod1() && aKeyCode.IsShift();
 
         // is the focus in the list ?
         auto p = mTaskPanes.begin();
@@ -280,12 +279,9 @@ vcl::Window* TaskPaneList::FindNextFloat( vcl::Window *pWindow, bool bForward )
                 if( p == mTaskPanes.end() )
                     break; // do not wrap, send focus back to document at end of list
                 /* #i83908# do not use the menubar if it is native and invisible
-                   this relies on MenuBar::ImplCreate setting the height of the menubar
-                   to 0 in this case
                 */
                 if( (*p)->IsReallyVisible() && !(*p)->ImplIsSplitter() &&
-                    ( (*p)->GetType() != WINDOW_MENUBARWINDOW || (*p)->GetSizePixel().Height() > 0 )
-                    )
+                    ( (*p)->GetType() != WINDOW_MENUBARWINDOW || static_cast<MenuBarWindow*>(p->get())->CanGetFocus() ) )
                 {
                     pWindow = *p;
                     break;


More information about the Libreoffice-commits mailing list