officecfg/registry/data/org/openoffice/Office/Accelerators.xcu | 12 +++ sd/source/ui/inc/NotesPanelViewShell.hxx | 15 +++ sd/source/ui/view/NotesPanelViewShell.cxx | 39 +++++++++- 3 files changed, 64 insertions(+), 2 deletions(-)
New commits: commit b6a4f372f971a1664bd63158c2b0d41fc9d6c33b Author: Sarper Akdemir <sarper.akde...@allotropia.de> AuthorDate: Tue Apr 8 14:38:02 2025 +0200 Commit: Sarper Akdemir <sarper.akde...@allotropia.de> CommitDate: Wed Apr 9 11:47:52 2025 +0200 tdf#163426 sd: notes pane: use ctrl+pgup/down for slide navigation notes pane uses pgup & pgdown for scrolling the text inside the pane. which blocks regular slide switching hotkeys for impress. add a new impress shortcut ctrl+pgup / ctrl+pgdown for going to the next or previous slide. for consistency sake this shortcut is not specific to notes pane but works everywhere on impress. make notes pane do not consume these keys so the default keys from accelerator config takes effect. Change-Id: I2221f90556683d1c00747ea855a7fe3a11d1a2a5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183849 Reviewed-by: Sarper Akdemir <sarper.akde...@allotropia.de> Tested-by: Jenkins diff --git a/officecfg/registry/data/org/openoffice/Office/Accelerators.xcu b/officecfg/registry/data/org/openoffice/Office/Accelerators.xcu index bcb97f01a706..a28e028ab9b6 100644 --- a/officecfg/registry/data/org/openoffice/Office/Accelerators.xcu +++ b/officecfg/registry/data/org/openoffice/Office/Accelerators.xcu @@ -2983,6 +2983,12 @@ Ctrl+Shift+u aka U_SHIFT_MOD1 under GTK/IBUS is for unicode key input <value xml:lang="en-US">.uno:NextPage</value> </prop> </node> + <node oor:name="PAGEDOWN_MOD1" oor:op="replace"> + <prop oor:name="Command"> + <value xml:lang="x-no-translate">L10N SHORTCUTS - NO TRANSLATE</value> + <value xml:lang="en-US">.uno:NextPage</value> + </prop> + </node> <node oor:name="PAGEDOWN_MOD1_MOD2" oor:op="replace"> <prop oor:name="Command"> <value xml:lang="x-no-translate">L10N SHORTCUTS - NO TRANSLATE</value> @@ -2995,6 +3001,12 @@ Ctrl+Shift+u aka U_SHIFT_MOD1 under GTK/IBUS is for unicode key input <value xml:lang="en-US">.uno:PreviousPage</value> </prop> </node> + <node oor:name="PAGEUP_MOD1" oor:op="replace"> + <prop oor:name="Command"> + <value xml:lang="x-no-translate">L10N SHORTCUTS - NO TRANSLATE</value> + <value xml:lang="en-US">.uno:PreviousPage</value> + </prop> + </node> <node oor:name="PAGEUP_MOD1_MOD2" oor:op="replace"> <prop oor:name="Command"> <value xml:lang="x-no-translate">L10N SHORTCUTS - NO TRANSLATE</value> diff --git a/sd/source/ui/inc/NotesPanelViewShell.hxx b/sd/source/ui/inc/NotesPanelViewShell.hxx index 39901d6e4faa..377ad68d550d 100644 --- a/sd/source/ui/inc/NotesPanelViewShell.hxx +++ b/sd/source/ui/inc/NotesPanelViewShell.hxx @@ -10,6 +10,7 @@ #pragma once #include "ViewShell.hxx" +#include "fuoltext.hxx" #include <glob.hxx> class SdPage; @@ -98,6 +99,20 @@ private: void Construct(); }; +class FuNotesPane : public FuSimpleOutlinerText +{ +public: + static rtl::Reference<FuPoor> Create(ViewShell* pViewSh, ::sd::Window* pWin, + ::sd::SimpleOutlinerView* pView, SdDrawDocument* pDoc, + SfxRequest& rReq); + + virtual bool KeyInput(const KeyEvent& rKEvt) override; + +protected: + FuNotesPane(ViewShell* pViewShell, ::sd::Window* pWin, ::sd::SimpleOutlinerView* pView, + SdDrawDocument* pDoc, SfxRequest& rReq); +}; + } // end of namespace sd /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/sd/source/ui/view/NotesPanelViewShell.cxx b/sd/source/ui/view/NotesPanelViewShell.cxx index 2834a895b712..9936a9cb81b1 100644 --- a/sd/source/ui/view/NotesPanelViewShell.cxx +++ b/sd/source/ui/view/NotesPanelViewShell.cxx @@ -336,8 +336,8 @@ void NotesPanelViewShell::FuPermanent(SfxRequest& rReq) rOutl.GetUndoManager().Clear(); rOutl.UpdateFields(); - SetCurrentFunction(FuSimpleOutlinerText::Create( - this, GetActiveWindow(), mpNotesPanelView.get(), GetDoc(), rReq)); + SetCurrentFunction(FuNotesPane::Create(this, GetActiveWindow(), mpNotesPanelView.get(), + GetDoc(), rReq)); rReq.Done(); } @@ -1470,6 +1470,41 @@ bool NotesPanelViewShell::KeyInput(const KeyEvent& rKEvt, ::sd::Window* pWin) return bReturn; } +// FuNotesPane +rtl::Reference<FuPoor> FuNotesPane::Create(ViewShell* pViewSh, ::sd::Window* pWin, + ::sd::SimpleOutlinerView* pView, SdDrawDocument* pDoc, + SfxRequest& rReq) +{ + rtl::Reference<FuPoor> xFunc(new FuNotesPane(pViewSh, pWin, pView, pDoc, rReq)); + xFunc->DoExecute(rReq); + return xFunc; +} + +bool FuNotesPane::KeyInput(const KeyEvent& rKEvt) +{ + sal_uInt16 nCode = rKEvt.GetKeyCode().GetCode(); + switch (nCode) + { + case KEY_PAGEUP: + case KEY_PAGEDOWN: + { + // do not consume the input and let Accelerators handle Ctrl+PgUp/PgDown + if (rKEvt.GetKeyCode().IsMod1()) + return false; + break; + } + default: + break; + } + return FuSimpleOutlinerText::KeyInput(rKEvt); +} + +FuNotesPane::FuNotesPane(ViewShell* pViewShell, ::sd::Window* pWin, ::sd::SimpleOutlinerView* pView, + SdDrawDocument* pDoc, SfxRequest& rReq) + : sd::FuSimpleOutlinerText(pViewShell, pWin, pView, pDoc, rReq) +{ +} + } // end of namespace sd /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */