From 3552e250f442f4b7da207233faf8e7b8bdbcf049 Mon Sep 17 00:00:00 2001 From: Justin Luth Date: Sat, 11 Jul 2026 19:27:04 -0400 Subject: [PATCH] tdf#102307 quick find: add hard coded keyboard shortcut to label The quick find (Ctrl-F) toolbar has a few hard-coded keyboard shortcuts to find next or find previous. However, those were undiscoverable to the user. So, manually add one to the translatable label. Hmm, this can be done automatically (the 'right' way) via officecfg/registry/data/org/openoffice/Office/Accelerators.xcu. However, these are not available to be set via the customize menu. Nor do they work outside of the Find toolbar. These are not user-customizable shortcuts. They are hard-coded keys combinations in svx/source/tbxctrls/tbunosearchcontrollers.cxx, and thus are not language dependent. An alternative would be to display Ctrl+G. I chose F3 because it is a standard for both Windows and Linux (KDE and Gnome). [Gnome ALSO standardizes Ctrl+G, and that is what MacOS uses. LO assigns Ctrl-G to .uno:RepeatSearch for macosx.] make UITest_sw_findBar Change-Id: If4b16d2e0c4abdd7656d58625a51ac7f40bdb242 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/207972 Reviewed-by: Justin Luth Tested-by: Jenkins --- .../data/org/openoffice/Office/UI/GenericCommands.xcu | 4 ++-- sw/qa/uitest/findBar/findbar.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu b/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu index 3201ea718c92..32ff7aa225b8 100644 --- a/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu +++ b/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu @@ -1802,7 +1802,7 @@ bit 3 (0x8): #define UICOMMANDDESCRIPTION_PROPERTIES_TOGGLEBUTTON 8 - Find Next + Find Next (F3) 1 @@ -1810,7 +1810,7 @@ bit 3 (0x8): #define UICOMMANDDESCRIPTION_PROPERTIES_TOGGLEBUTTON 8 - Find Previous + Find Previous (Shift+F3) 1 diff --git a/sw/qa/uitest/findBar/findbar.py b/sw/qa/uitest/findBar/findbar.py index f22b99f1964c..ec42d7736c16 100644 --- a/sw/qa/uitest/findBar/findbar.py +++ b/sw/qa/uitest/findBar/findbar.py @@ -54,14 +54,14 @@ class FindBar(UITestCase): # Press on Find Next in the Find Bar xfind_bar.executeAction("CLICK", mkPropertyValues({"POS": "3"})) # 3 is Find Next pos self.assertEqual(get_state_as_dict(xfind_bar)["CurrSelectedItemID"], "4") - self.assertEqual(get_state_as_dict(xfind_bar)["CurrSelectedItemText"], "Find Next") + self.assertEqual(get_state_as_dict(xfind_bar)["CurrSelectedItemText"], "Find Next (F3)") self.assertEqual(get_state_as_dict(xfind_bar)["CurrSelectedItemCommand"], ".uno:DownSearch") self.assertEqual(get_state_as_dict(xWriterEdit)["SelectedText"], "Libre") # Press on Find Previous in the Find Bar xfind_bar.executeAction("CLICK", mkPropertyValues({"POS": "2"})) # 2 is Find Previous pos self.assertEqual(get_state_as_dict(xfind_bar)["CurrSelectedItemID"], "3") - self.assertEqual(get_state_as_dict(xfind_bar)["CurrSelectedItemText"], "Find Previous") + self.assertEqual(get_state_as_dict(xfind_bar)["CurrSelectedItemText"], "Find Previous (Shift+F3)") self.assertEqual(get_state_as_dict(xfind_bar)["CurrSelectedItemCommand"], ".uno:UpSearch") self.assertEqual(get_state_as_dict(xWriterEdit)["SelectedText"], "libre")