[Libreoffice-commits] core.git: Branch 'libreoffice-5-1' - include/vcl vcl/source
Katarina Behrens
Katarina.Behrens at cib.de
Fri Jan 29 05:30:02 PST 2016
include/vcl/layout.hxx | 1 -
vcl/source/window/dialog.cxx | 34 +++++++++++++++++++++++++++-------
2 files changed, 27 insertions(+), 8 deletions(-)
New commits:
commit 2cbd9dffe76068c71c9de3f6525ce68d949085c3
Author: Katarina Behrens <Katarina.Behrens at cib.de>
Date: Tue Jan 19 23:07:47 2016 +0100
tdf#95587: Make rectangle control within tab pages work again
Since commit 74407aef94b6d8dfdd6, tab pages|controls are
considered to be container widgets (thus, search for the nearest
non-layout parent will never find a tab page parent, breaking
rectangle control in many dialogs). I've no idea how many
other functions' behaviour this changes in an unexpected way,
so I've reverted that bit.
That however means implementing slightly different approach to
tdf#92630 in dialogs (for a tab dialog, find current tab page
and go through its children)
Change-Id: I3ff5ac13f04b1c5c799c7a1a3769108927809f31
Reviewed-on: https://gerrit.libreoffice.org/21615
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>
(cherry picked from commit 39471da6e4d016c52c6cdf6553d7418416a160f4)
Reviewed-on: https://gerrit.libreoffice.org/21668
Reviewed-by: Miklos Vajna <vmiklos at collabora.co.uk>
diff --git a/include/vcl/layout.hxx b/include/vcl/layout.hxx
index be86c75..6bdef03 100644
--- a/include/vcl/layout.hxx
+++ b/include/vcl/layout.hxx
@@ -704,7 +704,6 @@ inline bool isContainerWindow(const vcl::Window &rWindow)
{
WindowType eType = rWindow.GetType();
return eType == WINDOW_CONTAINER || eType == WINDOW_SCROLLWINDOW ||
- eType == WINDOW_TABCONTROL || eType == WINDOW_TABPAGE ||
(eType == WINDOW_DOCKINGWINDOW && ::isLayoutEnabled(&rWindow));
}
diff --git a/vcl/source/window/dialog.cxx b/vcl/source/window/dialog.cxx
index 1793afdf5..8b70c2e 100644
--- a/vcl/source/window/dialog.cxx
+++ b/vcl/source/window/dialog.cxx
@@ -42,6 +42,8 @@
#include <vcl/button.hxx>
#include <vcl/mnemonic.hxx>
#include <vcl/dialog.hxx>
+#include <vcl/tabctrl.hxx>
+#include <vcl/tabpage.hxx>
#include <vcl/decoview.hxx>
#include <vcl/msgbox.hxx>
#include <vcl/unowrap.hxx>
@@ -236,6 +238,16 @@ void ImplWindowAutoMnemonic( vcl::Window* pWindow )
}
}
+void ImplHandleControlAccelerator( vcl::Window* pWindow, bool bShow )
+{
+ Control *pControl = dynamic_cast<Control*>(pWindow->ImplGetWindow());
+ if (pControl && pControl->GetText().indexOf('~') != -1)
+ {
+ pControl->SetShowAccelerator( bShow );
+ pControl->Invalidate(InvalidateFlags::Update);
+ }
+}
+
static VclButtonBox* getActionArea(Dialog *pDialog)
{
VclButtonBox *pButtonBox = nullptr;
@@ -590,19 +602,27 @@ bool Dialog::ImplHandleCmdEvent( const CommandEvent& rCEvent )
if (rCEvent.GetCommand() == CommandEventId::ModKeyChange)
{
const CommandModKeyData *pCData = rCEvent.GetModKeyData ();
+ bool bShowAccel = pCData && pCData->IsMod2();
Window *pGetChild = firstLogicalChildOfParent(this);
while (pGetChild)
{
- Control *pControl = dynamic_cast<Control*>(pGetChild->ImplGetWindow());
- if (pControl && pControl->GetText().indexOf('~') != -1)
+ if ( pGetChild->GetType() == WINDOW_TABCONTROL )
{
- if (pCData && pCData->IsMod2())
- pControl->SetShowAccelerator(true);
- else
- pControl->SetShowAccelerator(false);
- pControl->Invalidate(InvalidateFlags::Update);
+ // find currently shown tab page
+ TabControl* pTabControl = static_cast<TabControl*>( pGetChild );
+ TabPage* pTabPage = pTabControl->GetTabPage( pTabControl->GetCurPageId() );
+ vcl::Window* pTabPageChild = firstLogicalChildOfParent( pTabPage );
+
+ // and go through its children
+ while ( pTabPageChild )
+ {
+ ImplHandleControlAccelerator(pTabPageChild, bShowAccel);
+ pTabPageChild = nextLogicalChildOfParent(pTabPage, pTabPageChild);
+ }
}
+
+ ImplHandleControlAccelerator( pGetChild, bShowAccel );
pGetChild = nextLogicalChildOfParent(this, pGetChild);
}
return true;
More information about the Libreoffice-commits
mailing list