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

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Wed Aug 4 19:49:58 UTC 2021


 include/vcl/accel.hxx        |    2 +-
 vcl/source/window/syswin.cxx |   19 +++++++++++--------
 2 files changed, 12 insertions(+), 9 deletions(-)

New commits:
commit 83b729f7ab05c55865ba2dc05af8dedff50ed3de
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Wed Aug 4 19:37:35 2021 +0100
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Wed Aug 4 21:49:22 2021 +0200

    ToggleMnemonicsOnHierarchy can be a private symbol now
    
    Change-Id: I667454c62592f7a29d9175a50c7bde9e55895d2d
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120011
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/include/vcl/accel.hxx b/include/vcl/accel.hxx
index e5eca060243a..2aa951b47293 100644
--- a/include/vcl/accel.hxx
+++ b/include/vcl/accel.hxx
@@ -29,6 +29,7 @@
 class ImplAccelData;
 class ImplAccelEntry;
 class CommandEvent;
+namespace vcl { class Window; }
 
 class UNLESS_MERGELIBS(VCL_DLLPUBLIC) Accelerator
 {
@@ -77,7 +78,6 @@ public:
 
     Accelerator&            operator=( const Accelerator& rAccel );
 
-    static bool             ToggleMnemonicsOnHierarchy(const CommandEvent& rCEvent, const vcl::Window *pWindow);
     static void             GenerateAutoMnemonicsOnHierarchy(const vcl::Window* pWindow);
 };
 
diff --git a/vcl/source/window/syswin.cxx b/vcl/source/window/syswin.cxx
index 2f3e7a9d3832..ef0f7c0af90d 100644
--- a/vcl/source/window/syswin.cxx
+++ b/vcl/source/window/syswin.cxx
@@ -156,22 +156,25 @@ namespace
     }
 }
 
-bool Accelerator::ToggleMnemonicsOnHierarchy(const CommandEvent& rCEvent, const vcl::Window *pWindow)
+namespace
 {
-    if (rCEvent.GetCommand() == CommandEventId::ModKeyChange && ImplGetSVData()->maNWFData.mbAutoAccel)
+    bool ToggleMnemonicsOnHierarchy(const CommandEvent& rCEvent, const vcl::Window *pWindow)
     {
-        const CommandModKeyData *pCData = rCEvent.GetModKeyData();
-        const bool bShowAccel = pCData && pCData->IsMod2() && pCData->IsDown();
-        processChildren(pWindow, bShowAccel);
-        return true;
+        if (rCEvent.GetCommand() == CommandEventId::ModKeyChange && ImplGetSVData()->maNWFData.mbAutoAccel)
+        {
+            const CommandModKeyData *pCData = rCEvent.GetModKeyData();
+            const bool bShowAccel = pCData && pCData->IsMod2() && pCData->IsDown();
+            processChildren(pWindow, bShowAccel);
+            return true;
+        }
+        return false;
     }
-    return false;
 }
 
 bool SystemWindow::EventNotify( NotifyEvent& rNEvt )
 {
     if (rNEvt.GetType() == MouseNotifyEvent::COMMAND)
-        Accelerator::ToggleMnemonicsOnHierarchy(*rNEvt.GetCommandEvent(), this);
+        ToggleMnemonicsOnHierarchy(*rNEvt.GetCommandEvent(), this);
 
     // capture KeyEvents for menu handling
     if (rNEvt.GetType() == MouseNotifyEvent::KEYINPUT ||


More information about the Libreoffice-commits mailing list