https://bugs.documentfoundation.org/show_bug.cgi?id=161509

--- Comment #3 from David Huggins-Daines <[email protected]> ---
Hi, I’m surprised by the defensiveness of your response.  I am just trying to
solve a problem here and don’t claim to be an expert in anything, particularly
the inner workings of Word or the Open Office XML file format standard.  So, if
you are certain that I’m wrong, I’d like to know!

In theory these are UI names, but in practice, built-in styles (the ones that
have latent style definitions) are special - the name used by Word in <w:name>
is *not* always the same as the one shown in the Word UI, because of
internationalization among other things.  

For example if I create a document with Word in French locale, the UI shows
"Titre 1" but word/styles.xml still has:

<w:name w:val="heading 1"
xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"/>

This is why python-docx special-cases them:

https://github.com/python-openxml/python-docx/blob/0cf6d71fb47ede07ecd5de2a8655f9f46c5f083d/src/docx/styles/__init__.py#L8

See also the note here:

https://python-docx.readthedocs.io/en/latest/user/styles-using.html

I don’t really know what you mean by a "many-to-one mapping on input". Again,
built-in styles are special, they have conventional names, and that is why
LibreOffice does the mapping in the first place.  Sure, in *theory* there is a
mapping of "Heading 1" to itself, but in practice, Word will never allow you to
create a custom style with "Heading 1" (as opposed to "heading 1") as its
<w:name>.  I invite you to try it.

If you think the maintainer of python-docx is wrong I would be happy to know,
and to know why.  Otherwise please try to have an open mind.

-- 
You are receiving this mail because:
You are the assignee for the bug.

Reply via email to