diff options
author | Maxim Monastirsky <momonasmon@gmail.com> | 2020-03-12 01:26:51 +0200 |
---|---|---|
committer | Heiko Tietze <heiko.tietze@documentfoundation.org> | 2020-03-12 08:34:45 +0100 |
commit | 02cac3ee70760234db0fad44cb9095dfccc538a1 (patch) | |
tree | f351eb6275482eba7c50280e13396b2ce5fab7ca | |
parent | 34f91740cde8e77bd429f468ce0d797d8b0c2af4 (diff) |
tdf#95854 Same shortcut for insert and edit comment
But at the same time keep them as two separate commands for tdf#84153.
The idea is to define a global shortcut for the insert command (it's
the same shortcut in all modules anyway), and then override it as a
Calc-specific shortcut for the edit command. As a result, both menu
(or context menu) items will show the same shortcut, but what will be
actually executed by the shortcut is the edit command (as module
specific commands have higher priority). This would work, as both
commands share the same execution code. The only problem is that the
edit command is disabled when the cell doesn't have a comment, and so
can't be executed. Solve that by setting the FastCall sdi property on
it (and reuse this general solution for the lok case too).
Change-Id: I8a7280edb2aad7016ca31c63ca778b98fef85365
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90354
Tested-by: Jenkins
Tested-by: Heiko Tietze <heiko.tietze@documentfoundation.org>
Reviewed-by: Heiko Tietze <heiko.tietze@documentfoundation.org>
-rw-r--r-- | officecfg/registry/data/org/openoffice/Office/Accelerators.xcu | 139 | ||||
-rw-r--r-- | sc/sdi/cellsh.sdi | 2 | ||||
-rw-r--r-- | sc/source/ui/view/cellsh.cxx | 5 |
3 files changed, 19 insertions, 127 deletions
diff --git a/officecfg/registry/data/org/openoffice/Office/Accelerators.xcu b/officecfg/registry/data/org/openoffice/Office/Accelerators.xcu index a54c94987a36..accbc89aa8a8 100644 --- a/officecfg/registry/data/org/openoffice/Office/Accelerators.xcu +++ b/officecfg/registry/data/org/openoffice/Office/Accelerators.xcu @@ -49,6 +49,21 @@ Ctrl+Shift+e aka E_SHIFT_MOD1 under GTK/IBUS is for some emoji thing <value xml:lang="en-US">.uno:Copy</value> </prop> </node> + <node oor:name="C_MOD1_MOD2" oor:op="replace"> + <prop oor:name="Command"> + <value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value> + <value xml:lang="en-US">.uno:InsertAnnotation</value> + <!-- tdf#118269 Replace Ctrl-Alt-C with Shift-Ctrl-H for Hungarian --> + <value xml:lang="hu"></value> + </prop> + </node> + <!-- tdf#118269 Replace Ctrl-Alt-C with Shift-Ctrl-H for Hungarian --> + <node oor:name="H_SHIFT_MOD1" oor:op="replace"> + <prop oor:name="Command"> + <value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value> + <value xml:lang="hu">.uno:InsertAnnotation</value> + </prop> + </node> <node oor:name="M_SHIFT_MOD1" oor:op="replace"> <prop oor:name="Command"> <value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value> @@ -706,7 +721,7 @@ Ctrl+Shift+e aka E_SHIFT_MOD1 under GTK/IBUS is for some emoji thing <node oor:name="H_SHIFT_MOD1" oor:op="replace"> <prop oor:name="Command"> <value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value> - <value xml:lang="hu">.uno:InsertAnnotation</value> + <value xml:lang="hu">.uno:EditAnnotation</value> </prop> </node> <node oor:name="DELETE" oor:op="replace"> @@ -1367,7 +1382,7 @@ Ctrl+Shift+e aka E_SHIFT_MOD1 under GTK/IBUS is for some emoji thing <node oor:name="C_MOD1_MOD2" oor:op="replace"> <prop oor:name="Command"> <value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value> - <value xml:lang="en-US">.uno:InsertAnnotation</value> + <value xml:lang="en-US">.uno:EditAnnotation</value> <!-- tdf#118269 Replace Ctrl-Alt-C with Shift-Ctrl-H for Hungarian --> <value xml:lang="hu"></value> </prop> @@ -2455,13 +2470,6 @@ Ctrl+Shift+e aka E_SHIFT_MOD1 under GTK/IBUS is for some emoji thing <value xml:lang="de">.uno:Italic</value> </prop> </node> - <!-- tdf#118269 Replace Ctrl-Alt-C with Shift-Ctrl-H for Hungarian (Master document) --> - <node oor:name="H_SHIFT_MOD1" oor:op="replace"> - <prop oor:name="Command"> - <value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value> - <value xml:lang="hu">.uno:InsertAnnotation</value> - </prop> - </node> <node oor:name="LEFT" oor:op="replace"> <prop oor:name="Command"> <value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value> @@ -2516,14 +2524,6 @@ Ctrl+Shift+e aka E_SHIFT_MOD1 under GTK/IBUS is for some emoji thing <value xml:lang="es">.uno:Bold</value> </prop> </node> - <node oor:name="C_MOD1_MOD2" oor:op="replace"> - <prop oor:name="Command"> - <value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value> - <value xml:lang="en-US">.uno:InsertAnnotation</value> - <!-- tdf#118269 Replace Ctrl-Alt-C with Shift-Ctrl-H for Hungarian --> - <value xml:lang="hu"></value> - </prop> - </node> <node oor:name="PAGEDOWN" oor:op="replace"> <prop oor:name="Command"> <value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value> @@ -2757,14 +2757,6 @@ Ctrl+Shift+e aka E_SHIFT_MOD1 under GTK/IBUS is for some emoji thing </node> </node> <node oor:name="com.sun.star.presentation.PresentationDocument" oor:op="replace"> - <node oor:name="C_MOD1_MOD2" oor:op="replace"> - <prop oor:name="Command"> - <value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value> - <value xml:lang="en-US">.uno:InsertAnnotation</value> - <!-- tdf#118269 Replace Ctrl-Alt-C with Shift-Ctrl-H for Hungarian --> - <value xml:lang="hu"></value> - </prop> - </node> <node oor:name="PAGEDOWN" oor:op="replace"> <prop oor:name="Command"> <value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value> @@ -2877,13 +2869,6 @@ Ctrl+Shift+e aka E_SHIFT_MOD1 under GTK/IBUS is for some emoji thing <value xml:lang="de">.uno:Dismantle</value> </prop> </node> - <!-- tdf#118269 Replace Ctrl-Alt-C with Shift-Ctrl-H for Hungarian (Impress) --> - <node oor:name="H_SHIFT_MOD1" oor:op="replace"> - <prop oor:name="Command"> - <value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value> - <value xml:lang="hu">.uno:InsertAnnotation</value> - </prop> - </node> <node oor:name="DELETE" oor:op="replace"> <prop oor:name="Command"> <value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value> @@ -3895,13 +3880,6 @@ Ctrl+Shift+e aka E_SHIFT_MOD1 under GTK/IBUS is for some emoji thing <value xml:lang="de">.uno:Italic</value> </prop> </node> - <!-- tdf#118269 Replace Ctrl-Alt-C with Shift-Ctrl-H for Hungarian (Writer/Web) --> - <node oor:name="H_SHIFT_MOD1" oor:op="replace"> - <prop oor:name="Command"> - <value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value> - <value xml:lang="hu">.uno:InsertAnnotation</value> - </prop> - </node> <node oor:name="LEFT" oor:op="replace"> <prop oor:name="Command"> <value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value> @@ -3956,14 +3934,6 @@ Ctrl+Shift+e aka E_SHIFT_MOD1 under GTK/IBUS is for some emoji thing <value xml:lang="es">.uno:Bold</value> </prop> </node> - <node oor:name="C_MOD1_MOD2" oor:op="replace"> - <prop oor:name="Command"> - <value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value> - <value xml:lang="en-US">.uno:InsertAnnotation</value> - <!-- tdf#118269 Replace Ctrl-Alt-C with Shift-Ctrl-H for Hungarian --> - <value xml:lang="hu"></value> - </prop> - </node> <node oor:name="PAGEDOWN" oor:op="replace"> <prop oor:name="Command"> <value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value> @@ -4696,13 +4666,6 @@ Ctrl+Shift+e aka E_SHIFT_MOD1 under GTK/IBUS is for some emoji thing <value xml:lang="de">.uno:Italic</value> </prop> </node> - <!-- tdf#118269 Replace Ctrl-Alt-C with Shift-Ctrl-H for Hungarian (Base / Form Design) --> - <node oor:name="H_SHIFT_MOD1" oor:op="replace"> - <prop oor:name="Command"> - <value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value> - <value xml:lang="hu">.uno:InsertAnnotation</value> - </prop> - </node> <node oor:name="LEFT" oor:op="replace"> <prop oor:name="Command"> <value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value> @@ -4769,14 +4732,6 @@ Ctrl+Shift+e aka E_SHIFT_MOD1 under GTK/IBUS is for some emoji thing <value xml:lang="es">.uno:Bold</value> </prop> </node> - <node oor:name="C_MOD1_MOD2" oor:op="replace"> - <prop oor:name="Command"> - <value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value> - <value xml:lang="en-US">.uno:InsertAnnotation</value> - <!-- tdf#118269 Replace Ctrl-Alt-C with Shift-Ctrl-H for Hungarian --> - <value xml:lang="hu"></value> - </prop> - </node> <node oor:name="PAGEDOWN" oor:op="replace"> <prop oor:name="Command"> <value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value> @@ -5485,13 +5440,6 @@ Ctrl+Shift+e aka E_SHIFT_MOD1 under GTK/IBUS is for some emoji thing <value xml:lang="de">.uno:Italic</value> </prop> </node> - <!-- tdf#118269 Replace Ctrl-Alt-C with Shift-Ctrl-H for Hungarian (Base / Text report design) --> - <node oor:name="H_SHIFT_MOD1" oor:op="replace"> - <prop oor:name="Command"> - <value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value> - <value xml:lang="hu">.uno:InsertAnnotation</value> - </prop> - </node> <node oor:name="LEFT" oor:op="replace"> <prop oor:name="Command"> <value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value> @@ -5546,14 +5494,6 @@ Ctrl+Shift+e aka E_SHIFT_MOD1 under GTK/IBUS is for some emoji thing <value xml:lang="es">.uno:Bold</value> </prop> </node> - <node oor:name="C_MOD1_MOD2" oor:op="replace"> - <prop oor:name="Command"> - <value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value> - <value xml:lang="en-US">.uno:InsertAnnotation</value> - <!-- tdf#118269 Replace Ctrl-Alt-C with Shift-Ctrl-H for Hungarian --> - <value xml:lang="hu"></value> - </prop> - </node> <node oor:name="PAGEDOWN" oor:op="replace"> <prop oor:name="Command"> <value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value> @@ -5911,13 +5851,6 @@ Ctrl+Shift+e aka E_SHIFT_MOD1 under GTK/IBUS is for some emoji thing <value xml:lang="es">.uno:SearchDialog</value> </prop> </node> - <!-- tdf#118269 Replace Ctrl-Alt-C with Shift-Ctrl-H for Hungarian (Writer) --> - <node oor:name="H_SHIFT_MOD1" oor:op="replace"> - <prop oor:name="Command"> - <value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value> - <value xml:lang="hu">.uno:InsertAnnotation</value> - </prop> - </node> <node oor:name="B_SHIFT_MOD1" oor:op="replace"> <prop oor:name="Command"> <value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value> @@ -6368,14 +6301,6 @@ Ctrl+Shift+e aka E_SHIFT_MOD1 under GTK/IBUS is for some emoji thing <value xml:lang="es">.uno:Bold</value> </prop> </node> - <node oor:name="C_MOD1_MOD2" oor:op="replace"> - <prop oor:name="Command"> - <value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value> - <value xml:lang="en-US">.uno:InsertAnnotation</value> - <!-- tdf#118269 Replace Ctrl-Alt-C with Shift-Ctrl-H for Hungarian --> - <value xml:lang="hu"></value> - </prop> - </node> <node oor:name="PAGEDOWN" oor:op="replace"> <prop oor:name="Command"> <value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value> @@ -7122,13 +7047,6 @@ Ctrl+Shift+e aka E_SHIFT_MOD1 under GTK/IBUS is for some emoji thing <value xml:lang="de">.uno:Italic</value> </prop> </node> - <!-- tdf#118269 Replace Ctrl-Alt-C with Shift-Ctrl-H for Hungarian (XML Form) --> - <node oor:name="H_SHIFT_MOD1" oor:op="replace"> - <prop oor:name="Command"> - <value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value> - <value xml:lang="hu">.uno:InsertAnnotation</value> - </prop> - </node> <node oor:name="LEFT" oor:op="replace"> <prop oor:name="Command"> <value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value> @@ -7183,14 +7101,6 @@ Ctrl+Shift+e aka E_SHIFT_MOD1 under GTK/IBUS is for some emoji thing <value xml:lang="es">.uno:Bold</value> </prop> </node> - <node oor:name="C_MOD1_MOD2" oor:op="replace"> - <prop oor:name="Command"> - <value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value> - <value xml:lang="en-US">.uno:InsertAnnotation</value> - <!-- tdf#118269 Replace Ctrl-Alt-C with Shift-Ctrl-H for Hungarian --> - <value xml:lang="hu"></value> - </prop> - </node> <node oor:name="PAGEDOWN" oor:op="replace"> <prop oor:name="Command"> <value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value> @@ -7635,14 +7545,6 @@ Ctrl+Shift+e aka E_SHIFT_MOD1 under GTK/IBUS is for some emoji thing </node> </node> <node oor:name="com.sun.star.drawing.DrawingDocument" oor:op="replace"> - <node oor:name="C_MOD1_MOD2" oor:op="replace"> - <prop oor:name="Command"> - <value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value> - <value xml:lang="en-US">.uno:InsertAnnotation</value> - <!-- tdf#118269 Replace Ctrl-Alt-C with Shift-Ctrl-H for Hungarian --> - <value xml:lang="hu"></value> - </prop> - </node> <node oor:name="BACKSPACE_MOD2" oor:op="replace"> <prop oor:name="Command"> <value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value> @@ -7691,13 +7593,6 @@ Ctrl+Shift+e aka E_SHIFT_MOD1 under GTK/IBUS is for some emoji thing <value xml:lang="es">.uno:HyperlinkDialog</value> </prop> </node> - <!-- tdf#118269 Replace Ctrl-Alt-C with Shift-Ctrl-H for Hungarian (Draw) --> - <node oor:name="H_SHIFT_MOD1" oor:op="replace"> - <prop oor:name="Command"> - <value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value> - <value xml:lang="hu">.uno:InsertAnnotation</value> - </prop> - </node> <node oor:name="N_MOD1" oor:op="replace"> <prop oor:name="Command"> <value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value> diff --git a/sc/sdi/cellsh.sdi b/sc/sdi/cellsh.sdi index d5e936b06cf0..9382eea0134f 100644 --- a/sc/sdi/cellsh.sdi +++ b/sc/sdi/cellsh.sdi @@ -199,7 +199,7 @@ interface CellSelection SID_EDIT_POSTIT [ ExecMethod = ExecuteEdit; StateMethod = GetCellState; - ToolBoxConfig, MenuConfig , AccelConfig; + FastCall, ToolBoxConfig, MenuConfig, AccelConfig; ] SID_TABOP [ ExecMethod = ExecuteEdit; StateMethod = GetState; ] diff --git a/sc/source/ui/view/cellsh.cxx b/sc/source/ui/view/cellsh.cxx index ea7b3364d159..e8b47ddcef34 100644 --- a/sc/source/ui/view/cellsh.cxx +++ b/sc/source/ui/view/cellsh.cxx @@ -19,7 +19,6 @@ #include <scitems.hxx> -#include <comphelper/lok.hxx> #include <svl/slstitm.hxx> #include <svl/stritem.hxx> #include <svl/whiter.hxx> @@ -335,7 +334,6 @@ void ScCellShell::GetCellState( SfxItemSet& rSet ) ScDocument& rDoc = GetViewData()->GetDocShell()->GetDocument(); ScAddress aCursor( GetViewData()->GetCurX(), GetViewData()->GetCurY(), GetViewData()->GetTabNo() ); - bool isLOKNoTiledAnnotations = comphelper::LibreOfficeKit::isActive() && !comphelper::LibreOfficeKit::isTiledAnnotations(); SfxWhichIter aIter(rSet); sal_uInt16 nWhich = aIter.FirstWhich(); while ( nWhich ) @@ -394,8 +392,7 @@ void ScCellShell::GetCellState( SfxItemSet& rSet ) case SID_EDIT_POSTIT: { ScAddress aPos( GetViewData()->GetCurX(), GetViewData()->GetCurY(), GetViewData()->GetTabNo() ); - // Allow editing annotation by Id (without selecting the cell) for LOK - bDisable = !(isLOKNoTiledAnnotations || rDoc.GetNote(aPos)); + bDisable = rDoc.GetNote(aPos) == nullptr; } break; } |