Bug 126464 - Remove "Numbering on/off" UNO command
Summary: Remove "Numbering on/off" UNO command
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium normal
Assignee: Ahmed Hamed
URL:
Whiteboard: reviewed:2022 target:24.8.0
Keywords: difficultyMedium, easyHack, skillCpp, topicCleanup
: 140600 143737 (view as bug list)
Depends on:
Blocks: UNO-Command-Removal
  Show dependency treegraph
 
Reported: 2019-07-18 18:27 UTC by TorrAB
Modified: 2024-03-06 10:22 UTC (History)
8 users (show)

See Also:
Crash report or crash signature:


Attachments
file with numbered parags (13.84 KB, application/vnd.oasis.opendocument.text)
2019-07-18 18:27 UTC, TorrAB
Details

Note You need to log in before you can comment on or make changes to this bug.
Description TorrAB 2019-07-18 18:27:53 UTC
Created attachment 152865 [details]
file with numbered parags

Open Num3.odt; Tools>Customize>Keyboard, Category: Numbering;
choose Function 'Numbering off', assign it to ^$(ctrl-shift)2;
assign 'Numbering on/off' to ^$3.
Click any numbered parag, hit ^$2: it works; hit ^$3: it does nothing.
Comment 1 Regina Henschel 2019-07-18 22:02:13 UTC
I found no version, neither in OpenOffice.org nor in LibreOffice, where this command has any effect. It should be removed.
Comment 2 Maxim Monastirsky 2021-02-23 16:18:05 UTC
*** Bug 140600 has been marked as a duplicate of this bug. ***
Comment 3 Maxim Monastirsky 2021-02-23 16:19:42 UTC
As Regina pointed out, this command is broken since forever, and as such should be safe to remove - including the underlying code.

But - I looked at the code to understand what this command used to do, and it seems to toggle the bullet/number without turning off the list completely. It is then exported to odf as text:list-header. Same effect can be achieved by placing the cursor at the beginning of a numbered paragraph and pressing backspace (or shift+backspace to toggle it back). The advantage of the command is that it can be made to work when the cursor is anywhere in the paragraph. So I wonder whether it would be better to fix the command (I can do it), and rename it accordingly, instead of removing it? I don't know how useful this function is to deserve its own command.
Comment 4 sdc.blanco 2021-02-24 16:01:40 UTC
(In reply to Maxim Monastirsky from comment #3)
 (thanks for explanation, and I have added the Ctrl+Backspace tip to a help page)

> I don't know how useful this function is to deserve its own command.
In effect, you are describing a "Toggle List Label" command, which can be used to toggle list items between having a "list-label" or not.

In practical terms, if you used "Insert Unnumbered Entry", then changed your mind and wanted the entry to be numbered (or bulleted), then instead of Backspace, Enter, you would use this command to add the list label to the "unnumbered entry". Similarly, if you want to "unnumber" an entry, this "Toggle List Label" could be used (instead of Backspace at the beginning of the line).

It would appear in the same place as Insert Unnumbered entry and Restart Numbering  (i.e., Text | List context menu, Format | List submenu, and Bullets and Numbering toolbar).  

No opinion for or against -- just an interpretation of its function.
Comment 5 Heiko Tietze 2021-02-25 10:32:31 UTC
(In reply to Maxim Monastirsky from comment #3)
> But - I looked at the code to understand what this command used to do, and
> it seems to toggle the bullet/number without turning off the list...

Cannot confirm. 
<OL Style=NUmbering 123>
<LI>1
<LI>2
<LI>3
</OL>

The command's state is enabled in the list but clicking the button (I customized it into the standard toolbar) does nothing. Pressing backspace before the "2" empties the List Label String on this paragraph.

.uno:NumberOrNoNumber/FN_NUM_OR_NONUM
https://opengrok.libreoffice.org/xref/core/sw/source/uibase/shells/listsh.cxx?r=c456f839#197

What's your opinion, Michael & Miklos?
Comment 6 Miklos Vajna 2021-02-25 10:37:28 UTC
Sounds like Maxim says what this command could do, and what you say Heiko is what it does, perhaps you talk past each other. :-)
Comment 7 sdc.blanco 2021-02-25 13:51:38 UTC
Will combine the relevant documentation issues here as well, because it will interact with any decisions taken here.

1. If this command is not "resurrected", then "Numbering Off" entry should be removed from the Bullets and Numbering Bar help page.

https://help.libreoffice.org/7.2/en-US/text/swriter/main0206.html 

(perhaps Numbering Off was removed from Bullets and Numbering bar because it was not working?)

2. https://help.libreoffice.org/7.2/en-US/text/swriter/02/06040000.html
should be removed.

3. The first paragraph in this page should be removed, because there is no "Numbering Off" icon.  Its icon (lc_removebullets.png) has been moved over to "No List" , which is probably why Numbering On/Off has no icon in the Customize dialog.

https://help.libreoffice.org/7.2/en-US/text/shared/guide/numbering_stop.html

If "Numbering Off" never worked, then it would be hard to appreciate the difference between Numbering On/Off (F12)  (which loses both number and position) and "Numbering Off" which keeps position.
Comment 8 Maxim Monastirsky 2021-02-25 15:04:40 UTC
(In reply to Miklos Vajna from comment #6)
> Sounds like Maxim says what this command could do
Exactly. This command wants to do the same as pressing backspace/shift+backspace, but it doesn't work because it has an inverted condition when setting bDelete. There is also the obsolete SfxRequest::IsAPI() check, which always returns false now, and that prevents the command from working when the cursor isn't in the beginning of a paragraph.

(In reply to sdc.blanco from comment #7)
> 1. If this command is not "resurrected", then "Numbering Off" entry should
> be removed from the Bullets and Numbering Bar help page.
> 
> https://help.libreoffice.org/7.2/en-US/text/swriter/main0206.html 
> 
> (perhaps Numbering Off was removed from Bullets and Numbering bar because it
> was not working?)
I believe you're confusing this with .uno:RemoveBullets which used to be called "Numbering Off" and recently renamed to "No List". This what the help is about, as the numbering bar used to have that command prior to https://cgit.freedesktop.org/libreoffice/core/commit/?id=8d58aca88cdcb48de2006aece446cc1655bd0815

But here we talk about .uno:NumberOrNoNumber, which never was on the numbering toolbar, or any other toolbar AFAIK.
Comment 9 Heiko Tietze 2021-02-25 15:39:49 UTC
Cleaning-up is easy hacking

>git grep .uno:NumberOrNoNumber
officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu:      <node oor:name=".uno:NumberOrNoNumber" oor:op="replace">

>git grep FN_NUM_OR_NONUM
sw/inc/cmdid.h:#define FN_NUM_OR_NONUM         (FN_EDIT + 46)  /* Number on/off */
sw/sdi/_listsh.sdi:    FN_NUM_OR_NONUM // status(play)
sw/sdi/swriter.sdi:SfxBoolItem NumberOrNoNumber FN_NUM_OR_NONUM
sw/source/uibase/shells/listsh.cxx:        case FN_NUM_OR_NONUM:
sw/source/uibase/shells/listsh.cxx:            case FN_NUM_OR_NONUM:
(and the used functions)

Plus changes in the help according comment 7.
Comment 10 sdc.blanco 2021-02-25 17:05:07 UTC
Thanks for clarifications Maxim.  The labelling has been confusing, but improvements are in progress.

(In reply to Heiko Tietze from comment #9)
> Plus changes in the help according comment 7.
bug 140669 to clarify changes to help.
Comment 11 Heiko Tietze 2021-08-20 09:53:50 UTC
*** Bug 143737 has been marked as a duplicate of this bug. ***
Comment 12 Hossein 2022-07-30 11:17:31 UTC
Re-evaluating the EasyHack in 2022

This issue is still relevant. Please see comment 9 for code pointers.
Comment 13 Commit Notification 2024-03-06 10:22:53 UTC
AhmedHamed committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/0d94f6c90788b1d9e90afb3314ffe165c2eafb96

tdf#126464 Remove "Numbering on/off" UNO command

It will be available in 24.8.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.