Numbering List restart numbering issue

I need to have a quick button to activate Format - Paragraph - Outline&List - Restart Numbering - Start at 1.

So I recorded a macro to activate the command and I got the following macro:

sub RestartNumber
rem ----------------------------------------------------------------------
rem define variables
dim document   as object
dim dispatcher as object
rem ----------------------------------------------------------------------
rem get access to the document
document   = ThisComponent.CurrentController.Frame
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")

rem ----------------------------------------------------------------------
dim args1(0) as new com.sun.star.beans.PropertyValue
args1(0).Name = "NumberingStart"
args1(0).Value = true

dispatcher.executeDispatch(document, ".uno:NumberingStart", "", 0, args1())

rem ----------------------------------------------------------------------
dim args2(0) as new com.sun.star.beans.PropertyValue
args2(0).Name = "NumNewStartAt"
args2(0).Value = 1

dispatcher.executeDispatch(document, ".uno:NumNewStartAt", "", 0, args2())


end sub

All right. The problem is that the result is the number is set to 1 but the paragraph does not keep the Restart Numbering checkbox.

image

Question is: Besides a possible bug, what will be the right command sequence to the both NumberingStart and NumNewStartAt working together?

And if you ask me why a macro for restart numbering if you can have it in a context menu, the reason is that the context menu is binded to .uno:NumberingStart and has no provision to set the number to start at. Then you hit 149380 – For first item in numbered list of a document "Restart Numbering" only works, if start number checkbox in paragraph dialog is also selected

TIA
Olivier

I had a look at the attached document in the bug report.

After experimenting, I wonder if this is by design.

The offending paragraph is the very first associated with the list style. If I use the context menu to restart on the third item, Restart Numbering tagging survives exit-reload.

Now, if I insert a new list item before the offending one. The new list item incurs the same behaviour while the former “1)” can be restarted with the context menu and the markup survives.

Perhaps, developers have considered that forcing a restart on the very first item is nonsense and could cause difficulties if the list is reviewed and edited.

In the case of the attached document, it is part of several chapters bound in a master file. When “assembling” the final document, the offending paragraph is likely not the first one to use the list style. Consequently, marking it for restart is necessary (and mandatory) in order to get a correct document.