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

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Tue Sep 1 19:57:34 UTC 2020


 include/vcl/keycod.hxx       |    6 ++----
 vcl/source/window/keycod.cxx |   17 +++--------------
 2 files changed, 5 insertions(+), 18 deletions(-)

New commits:
commit edf46578b8cba12cc72f3463fee2ceb45a041c67
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Tue Sep 1 09:44:25 2020 +0100
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Tue Sep 1 21:56:54 2020 +0200

    reduce KeyFuncType down to just the used categories
    
    Change-Id: I97608bcabb30eba94278562254f7f9954af080f8
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101837
    Tested-by: Caolán McNamara <caolanm at redhat.com>
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/include/vcl/keycod.hxx b/include/vcl/keycod.hxx
index 63bbf372f382..6219897b55cb 100644
--- a/include/vcl/keycod.hxx
+++ b/include/vcl/keycod.hxx
@@ -26,11 +26,9 @@
 
 namespace vcl { class Window; }
 
-enum class KeyFuncType : sal_Int32 { DONTKNOW, NEW, OPEN, SAVE,
-                   SAVEAS, PRINT, CLOSE, QUIT,
+enum class KeyFuncType : sal_Int32 { DONTKNOW,
                    CUT, COPY, PASTE, UNDO,
-                   REDO, DELETE, REPEAT, FIND,
-                   FINDBACKWARD, PROPERTIES, FRONT };
+                   REDO, DELETE, REPEAT };
 
 namespace vcl
 {
diff --git a/vcl/source/window/keycod.cxx b/vcl/source/window/keycod.cxx
index 0c8939ae0979..193115f5a6a1 100644
--- a/vcl/source/window/keycod.cxx
+++ b/vcl/source/window/keycod.cxx
@@ -26,27 +26,16 @@
 #include <vcl/window.hxx>
 #include <vcl/keycod.hxx>
 
-const sal_uInt16 aImplKeyFuncTab[(static_cast<int>(KeyFuncType::FRONT)+1)*4] =
+const sal_uInt16 aImplKeyFuncTab[(static_cast<int>(KeyFuncType::REPEAT)+1)*4] =
 {
     0, 0, 0, 0,                                                    // KeyFuncType::DONTKNOW
-    KEY_N | KEY_MOD1, 0, 0, 0,                                     // KeyFuncType::NEW
-    KEY_O | KEY_MOD1, KEY_OPEN, 0, 0,                              // KeyFuncType::OPEN
-    KEY_S | KEY_MOD1, 0, 0, 0,                                     // KeyFuncType::SAVE
-    KEY_S | KEY_SHIFT | KEY_MOD1, 0, 0, 0,                         // KeyFuncType::SAVEAS
-    KEY_P | KEY_MOD1, 0, 0, 0,                                     // KeyFuncType::PRINT
-    KEY_W | KEY_MOD1, KEY_F4 | KEY_MOD1, 0, 0,                     // KeyFuncType::CLOSE
-    KEY_Q | KEY_MOD1, KEY_F4 | KEY_MOD2, 0, 0,                     // KeyFuncType::QUIT
     KEY_X | KEY_MOD1, KEY_DELETE | KEY_SHIFT, KEY_CUT, 0,          // KeyFuncType::CUT
     KEY_C | KEY_MOD1, KEY_INSERT | KEY_MOD1, KEY_COPY, 0,          // KeyFuncType::COPY
     KEY_V | KEY_MOD1, KEY_INSERT | KEY_SHIFT, KEY_PASTE, 0,        // KeyFuncType::PASTE
     KEY_Z | KEY_MOD1, KEY_BACKSPACE | KEY_MOD2, KEY_UNDO, 0,       // KeyFuncType::UNDO
     KEY_Y | KEY_MOD1, KEY_UNDO | KEY_SHIFT, 0, 0,                  // KeyFuncType::REDO
     KEY_DELETE, 0, 0, 0,                                           // KeyFuncType::DELETE
-    KEY_REPEAT, 0, 0, 0,                                           // KeyFuncType::REPEAT
-    KEY_F | KEY_MOD1, KEY_FIND, 0, 0,                              // KeyFuncType::FIND
-    KEY_F | KEY_SHIFT | KEY_MOD1, KEY_SHIFT | KEY_FIND, 0, 0,      // KeyFuncType::FINDBACKWARD
-    KEY_RETURN | KEY_MOD2, 0, 0, 0,                                // KeyFuncType::PROPERTIES
-    0, 0, 0, 0                                                     // KeyFuncType::FRONT
+    KEY_REPEAT, 0, 0, 0                                            // KeyFuncType::REPEAT
 };
 
 bool ImplGetKeyCode( KeyFuncType eFunc, sal_uInt16& rCode1, sal_uInt16& rCode2, sal_uInt16& rCode3, sal_uInt16& rCode4 )
@@ -90,7 +79,7 @@ KeyFuncType vcl::KeyCode::GetFunction() const
     sal_uInt16 nCompCode = GetModifier() | GetCode();
     if ( nCompCode )
     {
-        for ( sal_uInt16 i = sal_uInt16(KeyFuncType::NEW); i < sal_uInt16(KeyFuncType::FRONT); i++ )
+        for ( sal_uInt16 i = sal_uInt16(KeyFuncType::CUT); i <= sal_uInt16(KeyFuncType::REPEAT); i++ )
         {
             sal_uInt16 nKeyCode1;
             sal_uInt16 nKeyCode2;


More information about the Libreoffice-commits mailing list