bin/list-dispatch-commands.py                                  |   14 ++
 include/sfx2/sfxsids.hrc                                       |    1 
 officecfg/registry/data/org/openoffice/Office/Accelerators.xcu |   48 
++++++++++
 sfx2/sdi/frmslots.sdi                                          |    5 +
 sfx2/sdi/sfx.sdi                                               |   16 +++
 sfx2/source/control/msg.cxx                                    |    5 -
 6 files changed, 84 insertions(+), 5 deletions(-)

New commits:
commit b6af287527d42f8cf4bc43047fe0ed6130420d6b
Author:     Juergen Funk <[email protected]>
AuthorDate: Wed May 3 11:08:43 2023 +0200
Commit:     Samuel Mehrbrodt <[email protected]>
CommitDate: Thu May 4 08:15:27 2023 +0200

    tdf#153587 Display CTRL+F in the keyboard shortcuts list
    
    * Add the missing entry to Accelerators.xcu
    * Handle vnd.sun.star.findbar:-command the same as .uno commands
    
    Change-Id: I69d441d63a6b0478a07c9ef10665b7d59d3334b8
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151322
    Reviewed-by: Samuel Mehrbrodt <[email protected]>
    Tested-by: Samuel Mehrbrodt <[email protected]>

diff --git a/bin/list-dispatch-commands.py b/bin/list-dispatch-commands.py
index db8bff6e7d95..c5860c193bc4 100755
--- a/bin/list-dispatch-commands.py
+++ b/bin/list-dispatch-commands.py
@@ -101,6 +101,12 @@ def newcommand(unocommand):
            'arguments': ''}
     return cmd
 
+def get_uno(cmd):
+    if cmd.startswith('FocusToFindbar'):
+        cmd = 'vnd.sun.star.findbar:' + cmd
+    else:
+        cmd = '.uno:' + cmd
+    return cmd
 
 def analyze_xcu(all_commands):
     for filename in XCU_FILES:
@@ -115,7 +121,7 @@ def analyze_xcu(all_commands):
                 elif popups is True and line == '    </node>':
                     popups = False
                     continue
-                if '<node oor:name=".uno:' not in line:
+                if '<node oor:name=".uno:' not in line and '<node 
oor:name="vnd.' not in line:
                     continue
 
                 cmdln = ln
@@ -196,7 +202,7 @@ def analyze_hxx(all_commands):
                     line = next(fh)
                 tmp = line.split('"')
                 try:
-                    command_name = '.uno:' + tmp[1]
+                    command_name = get_uno(tmp[1])
                 except IndexError:
                     print("Warning: expected \" in line '%s' from file %s" % 
(line.strip(), filename),
                             file=sys.stderr)
@@ -275,7 +281,7 @@ def analyze_sdi(all_commands):
                 elif comment is False and square is False and command is False 
and len(line) == 0:
                     pass
                 elif command is False:
-                    command_name = '.uno:' + line.split(' ')[1]
+                    command_name = get_uno(line.split(' ')[1])
                     if command_name not in all_commands:
                         all_commands[command_name] = newcommand(command_name)
                     all_commands[command_name]['sdifile'] = 
SDI_FILES.index(filename)
@@ -305,7 +311,7 @@ def analyze_sdi(all_commands):
 def categorize(all_commands):
     # Clean black listed commands
     for command in BLACKLIST:
-        cmd = '.uno:' + command
+        cmd = get_uno(command)
         if cmd in all_commands:
             del all_commands[cmd]
     # Set category based on the file name where the command was found first
diff --git a/include/sfx2/sfxsids.hrc b/include/sfx2/sfxsids.hrc
index bb3097410c0e..7500fd9e048a 100644
--- a/include/sfx2/sfxsids.hrc
+++ b/include/sfx2/sfxsids.hrc
@@ -503,6 +503,7 @@ class SvxZoomItem;
 #define SID_GALLERY                         (SID_SFX_START + 960)
 #define SID_SEARCH_DLG                      (SID_SFX_START + 961)
 #define SID_SEARCH_QUIET                    (SID_SFX_START + 1684)
+#define SID_SEARCH                          (SID_SFX_START + 1685)
 #define SID_EXPORT_DIALOG                   (SID_SFX_START + 965)
 #define SID_IMPORT_DIALOG                   (SID_SFX_START + 966)
 
diff --git a/officecfg/registry/data/org/openoffice/Office/Accelerators.xcu 
b/officecfg/registry/data/org/openoffice/Office/Accelerators.xcu
index a26b90b298d6..f2facf38577c 100644
--- a/officecfg/registry/data/org/openoffice/Office/Accelerators.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/Accelerators.xcu
@@ -1002,6 +1002,12 @@ Ctrl+Shift+e aka E_SHIFT_MOD1 under GTK/IBUS is for some 
emoji thing
             <value xml:lang="en-US" 
install:module="unxwnt">.uno:RepeatSearch</value>
           </prop>
         </node>
+        <node oor:name="F_MOD1" oor:op="replace">
+          <prop oor:name="Command">
+            <value xml:lang="x-no-translate">I10N SHORTCUTS - NO 
TRANSLATE</value>
+            <value xml:lang="en-US">vnd.sun.star.findbar:FocusToFindbar</value>
+          </prop>
+        </node>
         <node oor:name="F_MOD1_MOD2" oor:op="replace">
           <prop oor:name="Command">
             <value xml:lang="x-no-translate">I10N SHORTCUTS - NO 
TRANSLATE</value>
@@ -2520,6 +2526,12 @@ Ctrl+Shift+e aka E_SHIFT_MOD1 under GTK/IBUS is for some 
emoji thing
             <value xml:lang="en-US">.uno:UpdateInputFields</value>
           </prop>
         </node>
+        <node oor:name="F_MOD1" oor:op="replace">
+          <prop oor:name="Command">
+            <value xml:lang="x-no-translate">I10N SHORTCUTS - NO 
TRANSLATE</value>
+            <value xml:lang="en-US">vnd.sun.star.findbar:FocusToFindbar</value>
+          </prop>
+        </node>
         <node oor:name="F_MOD1_MOD2" oor:op="replace">
           <prop oor:name="Command">
             <value xml:lang="x-no-translate">I10N SHORTCUTS - NO 
TRANSLATE</value>
@@ -3183,6 +3195,12 @@ Ctrl+Shift+e aka E_SHIFT_MOD1 under GTK/IBUS is for some 
emoji thing
             <value xml:lang="en-US">.uno:TextFitToSize</value>
           </prop>
         </node>
+        <node oor:name="F_MOD1" oor:op="replace">
+          <prop oor:name="Command">
+            <value xml:lang="x-no-translate">I10N SHORTCUTS - NO 
TRANSLATE</value>
+            <value xml:lang="en-US">vnd.sun.star.findbar:FocusToFindbar</value>
+          </prop>
+        </node>
         <node oor:name="F_MOD1_MOD2" oor:op="replace">
           <prop oor:name="Command">
             <value xml:lang="x-no-translate">I10N SHORTCUTS - NO 
TRANSLATE</value>
@@ -4000,6 +4018,12 @@ Ctrl+Shift+e aka E_SHIFT_MOD1 under GTK/IBUS is for some 
emoji thing
             <value xml:lang="en-US">.uno:UpdateInputFields</value>
           </prop>
         </node>
+        <node oor:name="F_MOD1" oor:op="replace">
+          <prop oor:name="Command">
+            <value xml:lang="x-no-translate">I10N SHORTCUTS - NO 
TRANSLATE</value>
+            <value xml:lang="en-US">vnd.sun.star.findbar:FocusToFindbar</value>
+          </prop>
+        </node>
         <node oor:name="F_MOD1_MOD2" oor:op="replace">
           <prop oor:name="Command">
             <value xml:lang="x-no-translate">I10N SHORTCUTS - NO 
TRANSLATE</value>
@@ -4781,6 +4805,12 @@ Ctrl+Shift+e aka E_SHIFT_MOD1 under GTK/IBUS is for some 
emoji thing
             <value xml:lang="en-US">.uno:UpdateInputFields</value>
           </prop>
         </node>
+        <node oor:name="F_MOD1" oor:op="replace">
+          <prop oor:name="Command">
+            <value xml:lang="x-no-translate">I10N SHORTCUTS - NO 
TRANSLATE</value>
+            <value xml:lang="en-US">vnd.sun.star.findbar:FocusToFindbar</value>
+          </prop>
+        </node>
         <node oor:name="F_MOD1_MOD2" oor:op="replace">
           <prop oor:name="Command">
             <value xml:lang="x-no-translate">I10N SHORTCUTS - NO 
TRANSLATE</value>
@@ -5568,6 +5598,12 @@ Ctrl+Shift+e aka E_SHIFT_MOD1 under GTK/IBUS is for some 
emoji thing
             <value xml:lang="en-US" 
install:module="unxwnt">.uno:RepeatSearch</value>
           </prop>
         </node>
+        <node oor:name="F_MOD1" oor:op="replace">
+          <prop oor:name="Command">
+            <value xml:lang="x-no-translate">I10N SHORTCUTS - NO 
TRANSLATE</value>
+            <value xml:lang="en-US">vnd.sun.star.findbar:FocusToFindbar</value>
+          </prop>
+        </node>
         <node oor:name="F_MOD1_MOD2" oor:op="replace">
           <prop oor:name="Command">
             <value xml:lang="x-no-translate">I10N SHORTCUTS - NO 
TRANSLATE</value>
@@ -6407,6 +6443,12 @@ Ctrl+Shift+e aka E_SHIFT_MOD1 under GTK/IBUS is for some 
emoji thing
             <value xml:lang="en-US">.uno:UpdateInputFields</value>
           </prop>
         </node>
+        <node oor:name="F_MOD1" oor:op="replace">
+          <prop oor:name="Command">
+            <value xml:lang="x-no-translate">I10N SHORTCUTS - NO 
TRANSLATE</value>
+            <value xml:lang="en-US">vnd.sun.star.findbar:FocusToFindbar</value>
+          </prop>
+        </node>
         <node oor:name="F_MOD1_MOD2" oor:op="replace">
           <prop oor:name="Command">
             <value xml:lang="x-no-translate">I10N SHORTCUTS - NO 
TRANSLATE</value>
@@ -7255,6 +7297,12 @@ Ctrl+Shift+e aka E_SHIFT_MOD1 under GTK/IBUS is for some 
emoji thing
             <value xml:lang="en-US">.uno:UpdateInputFields</value>
           </prop>
         </node>
+        <node oor:name="F_MOD1" oor:op="replace">
+          <prop oor:name="Command">
+            <value xml:lang="x-no-translate">I10N SHORTCUTS - NO 
TRANSLATE</value>
+            <value xml:lang="en-US">vnd.sun.star.findbar:FocusToFindbar</value>
+          </prop>
+        </node>
         <node oor:name="F_MOD1_MOD2" oor:op="replace">
           <prop oor:name="Command">
             <value xml:lang="x-no-translate">I10N SHORTCUTS - NO 
TRANSLATE</value>
diff --git a/sfx2/sdi/frmslots.sdi b/sfx2/sdi/frmslots.sdi
index 1126a0f195a0..b10f05a4ffbd 100644
--- a/sfx2/sdi/frmslots.sdi
+++ b/sfx2/sdi/frmslots.sdi
@@ -156,6 +156,11 @@ interface Window
     [
     ]
 
+    // Only for Accelerator-Command field
+    SID_SEARCH
+    [
+    ]
+
     // Only for Designers: Slot must be present
     SID_STYLE_DRAGHIERARCHIE
     [
diff --git a/sfx2/sdi/sfx.sdi b/sfx2/sdi/sfx.sdi
index 16e75ded94dc..4adb0f1b94fe 100644
--- a/sfx2/sdi/sfx.sdi
+++ b/sfx2/sdi/sfx.sdi
@@ -3912,6 +3912,22 @@ SfxVoidItem ScrollBodyPageDown 
SID_MAIL_SCROLLBODY_PAGEDOWN
     GroupId = SfxGroupId::Explorer;
 ]
 
+SfxBoolItem FocusToFindbar SID_SEARCH
+[
+    AutoUpdate = TRUE,
+    FastCall = FALSE,
+    ReadOnlyDoc = TRUE,
+    Toggle = FALSE,
+    Container = FALSE,
+    RecordAbsolute = FALSE,
+    RecordPerSet;
+
+    AccelConfig = TRUE,
+    MenuConfig = TRUE,
+    ToolBoxConfig = TRUE,
+    GroupId = SfxGroupId::Edit;
+]
+
 
 SfxBoolItem SearchDialog SID_SEARCH_DLG
 [
diff --git a/sfx2/source/control/msg.cxx b/sfx2/source/control/msg.cxx
index 27a3d0abdd07..0b484fd614af 100644
--- a/sfx2/source/control/msg.cxx
+++ b/sfx2/source/control/msg.cxx
@@ -45,7 +45,10 @@ sal_uInt16 SfxSlot::GetWhich( const SfxItemPool &rPool ) 
const
 
 OUString SfxSlot::GetCommand() const
 {
-    return ".uno:" + pUnoName;
+    if("FocusToFindbar" == pUnoName)
+        return "vnd.sun.star.findbar:" + pUnoName;
+    else
+        return ".uno:" + pUnoName;
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Reply via email to