diff options
author | Dennis Francis <dennisfrancis.in@gmail.com> | 2016-02-27 13:56:51 +0530 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2016-02-27 12:02:02 +0000 |
commit | dab16a16fa3b853f7e139fc91817752b38dc9171 (patch) | |
tree | 15786caeb536c0534de6385ffe693a1d5bdcd64a /sc | |
parent | b78209ae74af5bf4fc5dacde8c9b7e709cbb1a70 (diff) |
tdf#97906 : Toggle reference and show data sources shortcuts
In Default mode :
F4 = Toggle reference
Shift F4 = Toggle reference
Ctrl+Shift+F4 = Show data sources (both Mac and non Mac)
In Legacy mode :
F4 = Show data sources
Shift F4 = Toggle reference
Change-Id: Ifb53bfa671f212d73ebb8c3f80ed5c498d517d4d
Reviewed-on: https://gerrit.libreoffice.org/22728
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/ui/docshell/docsh.cxx | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx index 21eb4ede3bd6..5d03e98bd946 100644 --- a/sc/source/ui/docshell/docsh.cxx +++ b/sc/source/ui/docshell/docsh.cxx @@ -2976,7 +2976,7 @@ void ScDocShell::ResetKeyBindings( ScOptionsUtil::KeyBindingType eType ) return; vector<const awt::KeyEvent*> aKeys; - aKeys.reserve(4); + aKeys.reserve(7); // Backspace key awt::KeyEvent aBackspace; @@ -3002,6 +3002,24 @@ void ScDocShell::ResetKeyBindings( ScOptionsUtil::KeyBindingType eType ) aAltDown.Modifiers = awt::KeyModifier::MOD2; aKeys.push_back(&aAltDown); + // F4 + awt::KeyEvent aF4; + aF4.KeyCode = awt::Key::F4; + aF4.Modifiers = 0; + aKeys.push_back(&aF4); + + // CTRL+SHIFT+F4 + awt::KeyEvent aCtrlShiftF4; + aCtrlShiftF4.KeyCode = awt::Key::F4; + aCtrlShiftF4.Modifiers = awt::KeyModifier::MOD1 | awt::KeyModifier::SHIFT; + aKeys.push_back(&aCtrlShiftF4); + + // CTRL+SHIFT+F4 Mac + awt::KeyEvent aCtrlShiftF4Mac; + aCtrlShiftF4Mac.KeyCode = awt::Key::F4; + aCtrlShiftF4Mac.Modifiers = awt::KeyModifier::MOD3 | awt::KeyModifier::SHIFT; + aKeys.push_back(&aCtrlShiftF4Mac); + // Remove all involved keys first, because swapping commands don't work // well without doing this. removeKeysIfExists(xScAccel, aKeys); @@ -3014,11 +3032,15 @@ void ScDocShell::ResetKeyBindings( ScOptionsUtil::KeyBindingType eType ) xScAccel->setKeyEvent(aBackspace, ".uno:Delete"); xScAccel->setKeyEvent(aCtrlD, ".uno:FillDown"); xScAccel->setKeyEvent(aAltDown, ".uno:DataSelect"); + xScAccel->setKeyEvent(aF4, ".uno:ToggleRelative"); + xScAccel->setKeyEvent(aCtrlShiftF4, ".uno:ViewDataSourceBrowser"); + xScAccel->setKeyEvent(aCtrlShiftF4Mac, ".uno:ViewDataSourceBrowser"); break; case ScOptionsUtil::KEY_OOO_LEGACY: xScAccel->setKeyEvent(aDelete, ".uno:Delete"); xScAccel->setKeyEvent(aBackspace, ".uno:ClearContents"); xScAccel->setKeyEvent(aCtrlD, ".uno:DataSelect"); + xScAccel->setKeyEvent(aF4, ".uno:ViewDataSourceBrowser"); break; default: ; |