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

Caolán McNamara caolanm at redhat.com
Mon Jul 11 12:25:39 UTC 2016


 include/vcl/dialog.hxx        |    1 
 include/vcl/syswin.hxx        |    1 
 sc/source/ui/src/scstring.src |    2 -
 vcl/source/window/dialog.cxx  |   48 ---------------------------------------
 vcl/source/window/syswin.cxx  |   51 ++++++++++++++++++++++++++++++++++++++++++
 vcl/source/window/winproc.cxx |   17 +++++++++-----
 6 files changed, 64 insertions(+), 56 deletions(-)

New commits:
commit 545d5157f26b7fd3c5648ae6e727b1e1addca68f
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Jul 11 13:01:52 2016 +0100

    Resolves: tdf#95729 move 'alt' accel enable/disable down to systemwindow
    
    from dialog and send the 'alt' to the active floating window, if there
    is one, before trying the menubar.
    
    so popups like the calc autofilter one can display their accelerators
    when alt is pressed
    
    Change-Id: I52e45b72885b1b0a7362cecc30e41d218a48a58d

diff --git a/include/vcl/dialog.hxx b/include/vcl/dialog.hxx
index ecf086d8..466b3e3 100644
--- a/include/vcl/dialog.hxx
+++ b/include/vcl/dialog.hxx
@@ -105,7 +105,6 @@ public:
 private:
     bool            ImplStartExecuteModal();
     static void     ImplEndExecuteModal();
-    bool            ImplHandleCmdEvent ( const CommandEvent& rCEvent );
 public:
 
     // Dialog::Execute replacement API
diff --git a/include/vcl/syswin.hxx b/include/vcl/syswin.hxx
index 3ea4dcb..eb2e82a 100644
--- a/include/vcl/syswin.hxx
+++ b/include/vcl/syswin.hxx
@@ -179,6 +179,7 @@ public:
 private:
     SAL_DLLPRIVATE void ImplMoveToScreen( long& io_rX, long& io_rY, long i_nWidth, long i_nHeight, vcl::Window* i_pConfigureWin );
     virtual void setPosSizeOnContainee(Size aSize, Window &rBox);
+    bool            ImplHandleCmdEvent ( const CommandEvent& rCEvent );
     DECL_DLLPRIVATE_LINK_TYPED( ImplHandleLayoutTimerHdl, Idle*, void );
 
 protected:
diff --git a/sc/source/ui/src/scstring.src b/sc/source/ui/src/scstring.src
index 82e5e62..2da99e2 100644
--- a/sc/source/ui/src/scstring.src
+++ b/sc/source/ui/src/scstring.src
@@ -98,7 +98,7 @@ String SCSTR_MULTIPLE
 
 String SCSTR_STDFILTER
 {
-    Text [ en-US ] = "~Standard Filter..." ;
+    Text [ en-US ] = "Standard Filter..." ;
 };
 
 String SCSTR_TOP10FILTER
diff --git a/vcl/source/window/dialog.cxx b/vcl/source/window/dialog.cxx
index 9a872bd..63657f5 100644
--- a/vcl/source/window/dialog.cxx
+++ b/vcl/source/window/dialog.cxx
@@ -240,16 +240,6 @@ 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;
@@ -597,39 +587,6 @@ IMPL_LINK_NOARG_TYPED(Dialog, ImplAsyncCloseHdl, void*, void)
     Close();
 }
 
-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)
-        {
-            if ( pGetChild->GetType() == WINDOW_TABCONTROL )
-            {
-                 // 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;
-    }
-    return false;
-}
-
 bool Dialog::Notify( NotifyEvent& rNEvt )
 {
     // first call the base class due to Tab control
@@ -672,11 +629,6 @@ bool Dialog::Notify( NotifyEvent& rNEvt )
 
             }
         }
-        else if (rNEvt.GetType() == MouseNotifyEvent::COMMAND)
-        {
-            if (ImplHandleCmdEvent( *rNEvt.GetCommandEvent()))
-                return true;
-        }
     }
 
     return bRet;
diff --git a/vcl/source/window/syswin.cxx b/vcl/source/window/syswin.cxx
index 242b98a..8e8e5fb 100644
--- a/vcl/source/window/syswin.cxx
+++ b/vcl/source/window/syswin.cxx
@@ -31,6 +31,9 @@
 #include <vcl/syswin.hxx>
 #include <vcl/taskpanelist.hxx>
 #include <vcl/unowrap.hxx>
+#include <vcl/tabctrl.hxx>
+#include <vcl/tabpage.hxx>
+#include <vcl/mnemonic.hxx>
 
 #include <rtl/strbuf.hxx>
 
@@ -116,6 +119,49 @@ void SystemWindow::dispose()
     Window::dispose();
 }
 
+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);
+    }
+}
+
+bool SystemWindow::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)
+        {
+            if ( pGetChild->GetType() == WINDOW_TABCONTROL )
+            {
+                 // 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;
+    }
+    return false;
+}
+
 bool SystemWindow::Notify( NotifyEvent& rNEvt )
 {
     // capture KeyEvents for menu handling
@@ -139,6 +185,11 @@ bool SystemWindow::Notify( NotifyEvent& rNEvt )
         }
         if (bDone)
             return true;
+        if (rNEvt.GetType() == MouseNotifyEvent::COMMAND)
+        {
+            if (ImplHandleCmdEvent( *rNEvt.GetCommandEvent()))
+                return true;
+        }
     }
 
     return Window::Notify( rNEvt );
diff --git a/vcl/source/window/winproc.cxx b/vcl/source/window/winproc.cxx
index f3da016..720ee3a 100644
--- a/vcl/source/window/winproc.cxx
+++ b/vcl/source/window/winproc.cxx
@@ -2091,14 +2091,19 @@ static void ImplHandleSalKeyMod( vcl::Window* pWindow, SalKeyModEvent* pEvent )
     // Alt pressed or released => give SystemWindow a chance to handle auto-accelerator
     if ( pEvent->mnCode == KEY_MOD2 || (pEvent->mnModKeyCode & MODKEY_MOD2) != 0 )
     {
-        // find window - first look to see if the system window is available
-        pChild = pWindow->ImplGetWindowImpl()->mpFirstChild;
+        // find window - first look to see a popup is open and send it there
+        pChild = pSVData->maWinData.mpFirstFloat.get();
 
-        while ( pChild )
+        if (!pChild)
         {
-            if ( pChild->ImplGetWindowImpl()->mbSysWin )
-                break;
-            pChild = pChild->ImplGetWindowImpl()->mpNext;
+            // find window - then look to see if the system window is available
+            pChild = pWindow->ImplGetWindowImpl()->mpFirstChild;
+            while ( pChild )
+            {
+                if ( pChild->ImplGetWindowImpl()->mbSysWin )
+                    break;
+                pChild = pChild->ImplGetWindowImpl()->mpNext;
+            }
         }
     }
 


More information about the Libreoffice-commits mailing list