Bug 133410 - Multiple not in document existing WW8Num1z0 character styles are created on export to doc
Summary: Multiple not in document existing WW8Num1z0 character styles are created on e...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: filters and storage (show other bugs)
Version:
(earliest affected)
3.5.7.2 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-05-26 15:36 UTC by Telesto
Modified: 2023-01-26 09:53 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
Example file (46.17 KB, application/vnd.oasis.opendocument.text)
2020-06-04 20:03 UTC, Telesto
Details
Desktop/ExportUsedNumbering.odt: simple example showing the problem. (12.77 KB, application/vnd.oasis.opendocument.text)
2020-06-11 09:49 UTC, Justin L
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Telesto 2020-05-26 15:36:07 UTC
Description:
Multiple non-existing WW8Num1z0 character styles are created on export to docxx

Steps to Reproduce:
1. Open attachment 161273 [details]
2. Inspect Styles panel -> Character styles 
2. Export to DOCX
3. File Reload
4. Check again

Actual Results:
WW8Num1z0 - WW8Num1z9 are added

Expected Results:
Probably wrong


Reproducible: Always


User Profile Reset: No



Additional Info:
Version: 7.0.0.0.alpha1+ (x64)
Build ID: 21875558f6c478f07d68ff39e025d7ffd451674f
CPU threads: 4; OS: Windows 6.3 Build 9600; UI render: Skia/Raster; VCL: win
Locale: nl-NL (nl_NL); UI: en-US
Calc: CL

and in
3.5.7.2
Comment 1 Telesto 2020-06-04 17:37:53 UTC
Same for doc.. the don't appear to be in use.. in Word nor LibrOffice
Comment 2 Telesto 2020-06-04 17:44:56 UTC
@Justin..
Your opinion would be helpful. Not knowing enough about DOC/DOCX to evaluate if the WW8Num1z0 character styles make sense somehow

Feel free to close if this isn't a bug.
Comment 3 Telesto 2020-06-04 20:03:32 UTC
Created attachment 161620 [details]
Example file

Hmm, can't dig up a real example of WW8Num1z0 for DOCX but does happen when exporting this file to DOC
Comment 4 Telesto 2020-06-04 20:24:46 UTC
Another example of the style mess created at docx export (not specific WW8Num1z0)
1. Download and open: https://documentation.libreoffice.org/assets/Uploads/Documentation/en/WG6.0/WG60-WriterGuideLO.odt [I could use a smaller one, but had this one around) 
2. Export it DOCX 
3. File -> Reload -> Takes a while
4. Show all styles in the sidebar
5. Walk through the different styles (Paragraph/Character/List/Page).. and notice a lot of content.. Switch to applied.. and appears a lot of the styles is not needed at all
Comment 5 Justin L 2020-06-11 06:37:50 UTC
(In reply to Telesto from comment #4)
>  and appears a lot of the styles is not needed at all
Whether they are applied or not is irrelevant. If they are defined, they need to be round-tripped.

To me, it looks like the problem is all related to numbering styles. This seems fairly clear from the document in comment 4. That is not terribly surprising because numbering between LO and MSO is very different. However, LO could probably be smarter about identifying/consolidating identical numbering lists instead of creating a new one for each new use of the list. [At least that is what I assume is happening.] However, making a change here would be fraught with danger.

The same thing would be true for the character style associated with the numbering list. For sure the charstyle does not need to be duplicated along with the numbering instance - they could share the same style easily. That part shouldn't be so dangerous.
Comment 6 Justin L 2020-06-11 07:27:31 UTC
(In reply to Justin L from comment #5)
> That part shouldn't be so dangerous.
Umm, see LO 5.0.6's tdf#95213 DOCX import: don't reuse list label styles.

which was mollified somewhat by LO 6.3's tdf#92335 DOCX: fix multiplying of "ListLabel" styles.

Basically, our handling of numbering in export/import needs to be thrown out the window. But I don't have the skills to rewrite it.
Comment 7 Justin L 2020-06-11 09:49:30 UTC
Created attachment 161872 [details]
Desktop/ExportUsedNumbering.odt: simple example showing the problem.
Comment 8 Telesto 2020-06-11 09:53:47 UTC
Thanks for the investigation Justin!
Comment 9 Justin L 2021-03-11 09:01:13 UTC
This patch should significantly reduce the number of char styles created by doc import.
https://gerrit.libreoffice.org/c/core/+/112320 tdf#108518 revert OOo hack: Fix issue #i119405: Numbering text style