Editing Calc styles: returning to a default

Dear list,

we work with styles extensively. Occasionally, someone will make
a mistake and e.g. apply "bold face" to a style. The problem is that
it seems Calc irrevocably remembers this. We can now deselect "bold
face", but then the style will incorporate "not bold", whereas
before it simply made no statement about "bold face" and hence could
be combined with direct formatting.

Is there a way to return a style to defaults, or put differently,
can a style definition be reduced somehow to just the attributes
that I want to control?

Thanks,

Hi,

Not sure if I understand what you're after. The [Standard] button on the
style editor dialog resets all attributes to the attribute values of the
parent style.

Hope this helps,
Andreas

Hi Andreas, thanks for taking your time to respond.

also sprach Andreas Säger <villeroy@t-online.de> [2015-04-15 17:44 +0200]:

Not sure if I understand what you're after. The [Standard] button
on the style editor dialog resets all attributes to the attribute
values of the parent style.

This is better than recreating the style, so thank you for the hint.

I guess what I am really after is some sort of text-file export or
a UI allowing me to individually add and remove attributes from
a style. I imagine some tree arrangement and attributes, such as
"underline", and then I can select whether this attribute

  - is set to on (forces underlining)
  - is set to off (forces no underlining)
  - is not set (inherits underlining from other formatting/styles)

While this does not exist, I can make do with your solution.

Thanks,

martin f krafft wrote:

Hi Andreas, thanks for taking your time to respond.

also sprach Andreas Säger <villeroy@t-online.de> [2015-04-15 17:44 +0200]:

Not sure if I understand what you're after. The [Standard] button
on the style editor dialog resets all attributes to the attribute
values of the parent style.

This is better than recreating the style, so thank you for the hint.

I guess what I am really after is some sort of text-file export or
a UI allowing me to individually add and remove attributes from
a style. I imagine some tree arrangement and attributes, such as
"underline", and then I can select whether this attribute

   - is set to on (forces underlining)
   - is set to off (forces no underlining)
   - is not set (inherits underlining from other formatting/styles)

While this does not exist, I can make do with your solution.

If you're comfortable editing text-based files describing the styles, note that OpenDocument Format (ODF) files, including ODT and ODS, are actually zip archives containing the content, styles, etc.

Working on a copy of the file (so you don't lose the original if you make a mistake!) you can unzip the .ods file, ensuring the directory structure is preserved. Within it is a styles.xml file, which contains the style definitions in an XML format. After editing it, zip of the contents again, ensuring the original directory structure is preserved, give the file a .ods extension, and it should open in LibreOffice.

There's probably a formal specification of ODF somewhere, but it may be easier to work out the parts you're interested in by making one change at a time and seeing what effect it has on the styles.xml.

Mark.