summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2016-05-10 14:46:28 +0100
committerCaolán McNamara <caolanm@redhat.com>2016-05-10 14:47:12 +0100
commitb04664511e297b796c8882d05a4fac91924169d3 (patch)
tree9cf8c40aed601b6ea9cb86c6c2ac5336d509dfee
parentfcbd824f1b45ae7242cd7b86e98b5d947441759e (diff)
separate this piece of goo out into a standalone thing
no logic change Change-Id: Ib03a2516c9b3cf6bedf52760d8f7cb68cc70464f
-rw-r--r--vcl/source/window/menubarwindow.cxx9
-rw-r--r--vcl/source/window/menubarwindow.hxx1
-rw-r--r--vcl/source/window/taskpanelist.cxx10
3 files changed, 13 insertions, 7 deletions
diff --git a/vcl/source/window/menubarwindow.cxx b/vcl/source/window/menubarwindow.cxx
index 8f496ea25dc6..4b72e0b5bbf9 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 8565eb03b7bf..57127b1fbaac 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 238f8fa739d0..3b9a3d9e62a0 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;