Bug 119665 - Introduce UNO command to go to next/previous heading
Summary: Introduce UNO command to go to next/previous heading
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
6.0.3.2 release
Hardware: x86-64 (AMD64) All
: medium enhancement
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: UNO-Command-New Shortcuts-Accelerators
  Show dependency treegraph
 
Reported: 2018-09-03 13:31 UTC by Richard Salsbury
Modified: 2022-10-30 17:38 UTC (History)
7 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Richard Salsbury 2018-09-03 13:31:06 UTC
Using the "Tools -> Customize -> Keyboard" interface, there is no way to assign keyboard shortcuts for next/previous heading. 

I'm hoping these will be easy to add, because the functions themselves are already available through other means. I'm primarily a keyboard user and would like to be able to assign them to shortcuts.
Comment 1 V Stuart Foote 2018-09-03 20:09:29 UTC
WFM

Given we have multiple element classes to navigate in general, we can *not* define dedicated shortcuts/.uno actions for each. 

Rather, set a Keyboard shortcut for each of the Navigation block commands--Next Element and Previous Element.

Then from Navigator--set the Navigation mode to Headers, and the Next Element / Previous Element will then reposition between Headers a using the assigned shortcuts.

Also, this method allows any of the element types to be reached by shortcut by meerely changing the Navigation mode.

IMHO => WF
Comment 2 Heiko Tietze 2018-09-04 09:38:07 UTC
I can follow Stuart's reasoning. Do you agree, Richard?
Comment 3 Richard Salsbury 2018-09-04 11:37:10 UTC
Stuart's suggestion is a reasonable workaround, but it requires me to select the type of navigation I want every time I open LibreOffice.

Element navigation supports 18 different types of navigation, 11 of which already have defined next/previous shortcut functions. It seems odd that the very useful 'next/previous heading' should be missing, while I do have access to things as obscure as 'next/previous wrong table formula'.

I won't be terribly upset if you decide not to add this, but it seems to me a logical extension to LibreOffice's customization features.
Comment 4 Xisco Faulí 2018-09-05 10:56:30 UTC
Putting back to UNCONFIRMED until the UX Team decides what to do...
Comment 5 Heiko Tietze 2018-09-06 07:59:57 UTC
It's on the agenda for next week.
Comment 6 Cor Nouws 2018-09-12 15:36:53 UTC
(In reply to Richard Salsbury from comment #3)
> Stuart's suggestion is a reasonable workaround, but it requires me to select
> the type of navigation I want every time I open LibreOffice.

Maybe it's possible to retain the selected type, until changed by the user.
And there also in the Navigation tool bar. (not sure what it should do - there was a time that it poped up every time the cursor was in a header or numbered item :\ - but now it doesn't do anything for me.)
Comment 7 Heiko Tietze 2018-09-13 06:31:09 UTC
(In reply to Richard Salsbury from comment #3)
> Element navigation supports 18 different types of navigation...

Guess you count commands with "Next". But those do not have a shortcut assigned. Point is that you need an UNO command in order to customize yourself and after discussing the issue in the design meeting we agree on this idea. I changed the summary accordingly.
Comment 8 Jim Raykowski 2022-10-30 17:38:52 UTC
Here are steps that can be used to add UNO commands and hook them up to the core functions for this request:

1. Decide on names for the UNO commands. Perhaps .uno:GoToNextHeading and .uno:GoToPrevHeading

2. Add the commands to the commands section in the WriterCommands.xcu file[1][2]
   These commands will be used to connect the UI element (menu item, toolbar item) to code base functions through the framework Dispatch API[3]

3. Define slot IDs for the new commands[3][4]. The end of the "Region: Traveling & Selection" section seems to be the appropriate place for these.

4. Add method slot definitions and interface definitions to the sdi (slot definition interface)? files[5][6].

5. Add cases for the defined commands in the SwTextShell::ExecMoveMisc function[7]. Core functions that move the cursor to the previous/next heading are SwCursorShell::GotoPrevOutline and SwCursorShell::GotoNextOutline[8]. 

6. "How to add, replace or remove a User Interface Command" and "Images" sections[9]. 

[1] officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu
[2] officecfg/registry/schema/org/openoffice/Office/UI/Commands.xcs
[3] https://wiki.openoffice.org/wiki/Framework/Article/Implementation_of_the_Dispatch_API_In_SFX2
[4] sw/inc/cmdid.h
[5] sw/sdi/_textsh.sdi
[6] sw/sdi/swriter.sdi
[7] sw/source/uibase/shells/txtcrsr.cxx
[8] sw/source/core/crsr/crstrvl.cxx
[9] https://wiki.openoffice.org/wiki/Framework/Article/General_Architecture_Of_The_Framework_User_Interface_Implementation#Maintenance_of_Menus.2C_Toolbars_and_User_Interface_Commands