How to do "Continue previous numbering" in a macro?

asked 2015-02-08 00:35:53 +0200

attila.lendvai gravatar image

LibreOffice Writer Version: 4.3.3.2

I wrote a macro that turns manually numbered paragraphs into a numbering. The only problem left is that when it applies my custom paragraph style, then the numbering restarts (selecting the "Continue previous numbering" from the context menu fixes the issue).

I'm looking for a way to either tell the system to continue numbering by default, or somehow issue the same command from my macro.

This is the interesting part of my macro:

     text = oFound.Text
     cursor = text.createTextCursorByRange(oFound)
     cursor.string = ""
     cursor.collapseToEnd()
     cursor.gotoNextParagraph(true)
     cursor.string = ""
     cursor.paraStyleName = "Quote"
     rem these attempts don't do what i want:
     rem cursor.ParaIsNumberingRestart = false
     rem cursor.NumberingLevel = 0
     cursor.gotoNextParagraph(true)
     cursor.collapseToEnd()
     cursor.paraStyleName = "Quote Author"
edit retag flag offensive close merge delete