jdum / odfdo

python library for OpenDocument format (ODF)
Apache License 2.0
48 stars 11 forks source link

Copying styles into a new document fails #11

Closed keestux closed 3 years ago

keestux commented 3 years ago

While I was trying to create a new document and fill it with a table from a template document I noticed that that styles are not inserted properly in the new document. Every time .insert_style is called it will delete the previously inserted style.

jdum commented 3 years ago

I'm sorry, style management for ODF is complex. From the method insert_style() doc string: "If default is True, the style will be inserted as a default style and would replace any existing default style of the same family. Any name or display name would be ignored."

jdum commented 3 years ago

See also the "limitations" paragraph from the readme.md: "the best (only ?) way to apply style is by merging styles from a template document into your generated document. See odfdo-style.py in "scripts" folder."

keestux commented 3 years ago

Hmm, sorry for the noise. I messed up myself. I modified something I shouldn't have.

jdum commented 3 years ago

Not a problem. Your issue will help others to understand that : styles in ODF are not what most people would expect from a concept having that name. What ever anybody would think about that "style" thing is off topic, as the main requirement is to implement something compliant with actual ODF format.