How can I delete unused styles in the conditional formatting list?

I have been using extensive trial and error techniques to make conditional formatting work and have added many now useless styles (to go along with the original list with styles with effects that I do not know). So now I have a huge list, most of which are just partial steps toward a desired style.

Ideally, I would know where this list lives and delete unwanted styles with a text editor. But that just might be DOS experience wistful thinking.

Obviously you can delete the styles, one by one, using the Styles & Formatting dialog.

You can right-click on styles in the dialog and choose Edit to see what the properties are.

If you are comfortable editing an XML file, you can dive into the innards of an ODS file and remove the styles; I suspect this may be as slow as using the dialog box in Calc.

You probably know that an .ods file is in fact a zip archive of a number of files; you need to extract the styles.xml file from the top level of the .ods archive; delete from it the entries representing the styles you do not want; and replece the edited styles.xml in the .ods archive. User-defined styles will look like

<style:style style:name="Current_5f_day" style:display-name="Current_day" style:family="table-cell" style:parent-style-name="Default">
  <style:text-properties fo:color="#ff3333" fo:font-weight="bold" style:font-weight-asian="normal"/>
</style:style>

I don’t know what the effect of deleting a style that is in use might be, so tread with caution.

If this answer helped you, please accept it by clicking the check mark :heavy_check_mark: to the left and, karma permitting, upvote it. If this resolves your problem, close the question, that will help other people with the same question.

You can save your document directly as an XML file using format “flat XML”, extension .fodt (no zip processing needed).

If you delete a used file, it will be recreated with a weird name, where all non-alphanumeric characters in its original name replaced with xx (xx = hexadecimal encoding of non-alphanumeric character). This seems to be taken from style:name instead of style:display-name (see snippet above).

Thanks - did not know about the Styles & Formatting dialog. It works well.

I also discovered that the style name cannot contain any spaces, although it is allowed to when created. It seems like all styles starting with the same characters up to the space will be listed separately but deleting any one will delete the effect.

The Styles and Formatting menu is indeed good.

I have the same problem but my situation is a little more complicated, as I’ve got more than 4700 (!) conditional styles in my document (see picture… and no, there’s no leap in counting, they are ACTUALLY that number).

Picture showing my document with “some” styles in the list

The idea of deleting every instance one by one is not exactly appealing to me!

Any hint on how to do this job at once? Unfortunately multi-selection in the style list is not allowed. Hope it will be supported in a release or another.

Regards,
Massimo