[Libreoffice-bugs] [Bug 133459] FILEOPEN: User defined number format not applied to fields inside header or footer

bugzilla-daemon at bugs.documentfoundation.org bugzilla-daemon at bugs.documentfoundation.org
Wed Jun 3 20:22:16 UTC 2020


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

--- Comment #10 from Maxim Monastirsky <momonasmon at gmail.com> ---
What I found so far: The field code indeed seems to use automatic styles, with
one exception: During the import of <office:automatic-styles>, there is a
special code in the SvXMLImport::SetAutoStyles method that inserts already
existing number styles into automatic styles as well. But for this to happen,
the mnImportFlags member must include the SvXMLImportFlags::CONTENT flag.

For the fodt import, this method is called just once with mnImportFlags ==
SvXMLImportFlags::ALL. That's when the number style from <office:styles> is
inserted into automatic styles, and later consumed from there by the header
field.

But for odt, this method is called twice, because there is
<office:automatic-styles> in both styles.xml and content.xml:

- For styles.xml, it's called with mnImportFlags == (SvXMLImportFlags::STYLES |
SvXMLImportFlags::MASTERSTYLES | SvXMLImportFlags::AUTOSTYLES |
SvXMLImportFlags::FONTDECLS), so the number style isn't inserted into automatic
styles, and later can't be found by the header.

- For content.xml, it's finally called with mnImportFlags ==
(SvXMLImportFlags::AUTOSTYLES | SvXMLImportFlags::CONTENT |
SvXMLImportFlags::SCRIPTS | SvXMLImportFlags::FONTDECLS). But while the number
style is inserted, it has no use here, as the header is defined in styles.xml,
and was processed already.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/libreoffice-bugs/attachments/20200603/59d598e1/attachment.htm>


More information about the Libreoffice-bugs mailing list