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

Caolán McNamara caolanm at redhat.com
Fri Jul 29 15:37:09 UTC 2016


 include/vcl/accel.hxx        |    3 +++
 vcl/source/window/syswin.cxx |   14 +++++++-------
 2 files changed, 10 insertions(+), 7 deletions(-)

New commits:
commit f305b882868a03295f1b3108976d14354fa1553c
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri Jul 29 15:44:06 2016 +0100

    unhook the alt handling thing from SystemWindow
    
    so it could be used from things that aren't dialogs
    
    Change-Id: I649c5a05ad9c0634be9cef2bbe16a4643e58fc12

diff --git a/include/vcl/accel.hxx b/include/vcl/accel.hxx
index 7db25e4..295e2db 100644
--- a/include/vcl/accel.hxx
+++ b/include/vcl/accel.hxx
@@ -28,6 +28,7 @@
 
 class ImplAccelData;
 class ImplAccelEntry;
+class CommandEvent;
 
 class VCL_DLLPUBLIC Accelerator : public Resource
 {
@@ -79,6 +80,8 @@ public:
     void                    SetSelectHdl( const Link<Accelerator&,void>& rLink ) { maSelectHdl = rLink; }
 
     Accelerator&            operator=( const Accelerator& rAccel );
+
+    static bool             ToggleMnemonicsOnHierarchy(const CommandEvent& rCEvent, vcl::Window *pWindow);
 };
 
 #endif // INCLUDED_VCL_ACCEL_HXX
diff --git a/vcl/source/window/syswin.cxx b/vcl/source/window/syswin.cxx
index 8e8e5fb..836bca9 100644
--- a/vcl/source/window/syswin.cxx
+++ b/vcl/source/window/syswin.cxx
@@ -129,14 +129,14 @@ void ImplHandleControlAccelerator( vcl::Window* pWindow, bool bShow )
     }
 }
 
-bool SystemWindow::ImplHandleCmdEvent( const CommandEvent& rCEvent )
+bool Accelerator::ToggleMnemonicsOnHierarchy(const CommandEvent& rCEvent, vcl::Window *pWindow)
 {
     if (rCEvent.GetCommand() == CommandEventId::ModKeyChange)
     {
-        const CommandModKeyData *pCData = rCEvent.GetModKeyData ();
-        bool bShowAccel =  pCData && pCData->IsMod2();
+        const CommandModKeyData *pCData = rCEvent.GetModKeyData();
+        const bool bShowAccel =  pCData && pCData->IsMod2();
 
-        Window *pGetChild = firstLogicalChildOfParent(this);
+        vcl::Window *pGetChild = firstLogicalChildOfParent(pWindow);
         while (pGetChild)
         {
             if ( pGetChild->GetType() == WINDOW_TABCONTROL )
@@ -144,7 +144,7 @@ bool SystemWindow::ImplHandleCmdEvent( const CommandEvent& rCEvent )
                  // find currently shown tab page
                  TabControl* pTabControl = static_cast<TabControl*>( pGetChild );
                  TabPage* pTabPage = pTabControl->GetTabPage( pTabControl->GetCurPageId() );
-                 vcl::Window* pTabPageChild =  firstLogicalChildOfParent( pTabPage );
+                 vcl::Window* pTabPageChild = firstLogicalChildOfParent( pTabPage );
 
                  // and go through its children
                  while ( pTabPageChild )
@@ -155,7 +155,7 @@ bool SystemWindow::ImplHandleCmdEvent( const CommandEvent& rCEvent )
             }
 
             ImplHandleControlAccelerator( pGetChild, bShowAccel );
-            pGetChild = nextLogicalChildOfParent(this, pGetChild);
+            pGetChild = nextLogicalChildOfParent(pWindow, pGetChild);
         }
         return true;
     }
@@ -187,7 +187,7 @@ bool SystemWindow::Notify( NotifyEvent& rNEvt )
             return true;
         if (rNEvt.GetType() == MouseNotifyEvent::COMMAND)
         {
-            if (ImplHandleCmdEvent( *rNEvt.GetCommandEvent()))
+            if (Accelerator::ToggleMnemonicsOnHierarchy(*rNEvt.GetCommandEvent(), this))
                 return true;
         }
     }


More information about the Libreoffice-commits mailing list