A real example from Cdes: For making a text node shift down by some distance, you can do something like
The important question is: Where to place that style? The usual way to find this out is, create a small test document, and save it as a fodt file, which is an uncompressed xml. If you do this, the style snippet above is place in office:automatic-styles, i.e.:
contextual-spacing are irrelevant, for the latter, I couldn't even find a specification)
So, creating the style under
office:automatic-styles in our Java-code seems to be the right thing. But:
- in the generated odt file (which is a zip file), the
office:automatic-stylesblock containing our style is written to styles.xml
- however, in an odt file generated by Libreoffice, the corresponding
office:automatic-stylesblock is written to content.xml
So, the consequence is, that in our generated odt file, the style is not found, and Libreoffice just ignores it silently. And, because in the fodt file you usually use for testing (as it is not zipped, has line breaks, and thus diff is usable sensefully), everything is in one plain file, you cannot trigger the problem there.
The solution is simple: If one places the style under
which in our Java world looks like
stylesOfficeStyles instead of
then the style suddenly is used.