Catch extra bullet in bullet list

I am looking to some clue/Basic code to detect and correct paragraphs with bullet lists which have an extra, overlaying bullet applied.

In all guides, we use Paragraph styles List 1 and List 2 which are connected to list styles Bullet * and Bullet - respectively.

However in many lists in the Guides there are often another bullet (* or -) over the List 1 or 2 paragraph bullet. There no visual indication when editing the chapters, and no problem in printing or exporting to PDF. But when changing some para style attribute, the extra bullet pops.

The current trick I use is to select the set of bullet list paragraphs, apply temporary the BodyText style (then the extra bullet shows), remove the extra bullet and re-apply the para list style. That must be done in every list in the text which is rather exhausting.

if no extra bullet pops, then I press Ctrl+Z to undo the temporary change.

Has anybody a couple of Basic lines to detect and remove the extra bullet? At least I’d like to know how to catch and delete this extra bullet.

Thanks in advance.

Style inspector indicates that there is a direct paragraph formatting on the offending list items as “List style Name = List 2”. This direct formatting is not removed with Ctrl+M (clean direct formatting)

I can’t help with macro but the list shown is from page of 25 Impress guide 7.0

yes, I know, I am editing it.

Yes. The comment was for others looking at the question and needing to inspect or test the problem.

@ohallot: presently the style inspector always reports bullet/numbering as direct formatting even when a list style is applied. This an error. You can’t rely on the style inspector to diagnose bullet/numbering direct formatting.

Based on suggestion by Rafael Lima and Pierre-Yves Samin, the idea is to record a macro that executes

  • Search & replace the List1 paragraph style with an unused style (e.g. Content10)
  • Search for all paragraphs in Content10
  • Apply the numbering via the toolbar
  • Remove numbering via the toolbar
  • Replace the paragraph style Contents10 with List1

the macro can be:

Sub CleanListStyles
  Dim sFamilies as Variant
  sFamily = ThisComponent.StyleFamilies.getByName("ParagraphStyles")
  Dim newStyle as Object
  Set newStyle = ThisComponent.CreateInstance("com.sun.star.style.ParagraphStyle")
  newStyle.ParentStyle = "Standard"
  sFamily.insertByName("olivier_dummy", newStyle)
  CleanExtraBullet("List 1", "olivier_dummy")
  CleanExtraBullet("List 2", "olivier_dummy")
  CleanExtraBullet("Heading Caution", "olivier_dummy")
  CleanExtraBullet("Heading Tip", "olivier_dummy")
  CleanExtraBullet("Heading Note", "olivier_dummy")
  sFamily.removeByName("olivier_dummy")
msgbox "Finished"
End sub 

where

CleanExtraBullet(ListStyle As String, dummyStyle As String) 

is the recorded macro.

The actions you describe are so quick and simple that they really don’t don’t need the macro. I am embarrassed not to have thought of it. Tested on Writer Guide 6.0, just a minute from start to completed to replace all the second bullet formatting

Yes, you are right, but imagine you have +>17 chapters to clean times 6 Guides, times ‘n’ languages times dozens of lists paragraphs times 5 bullet list styles… Of course if I have just one big file (the whole book) it work as well and less need for a macro.

That sounds like the need for a macro.