Bug 81331

Summary: FILESAVE: DOC list styles defined according to item identifier (i.e., character) rather than item text (i.e., paragraph)
Product: LibreOffice Reporter: Murz <MurzNN>
Component: WriterAssignee: Not Assigned <libreoffice-bugs>
Status: NEW --- QA Contact:
Severity: normal    
Priority: medium    
Version: 4.2.4.2 release   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:
Attachments: Example file - save it to DOC for got described results
Example file that already saved to DOC
Next example with 2 styled lists (in ODT format, save it to DOC)

Description Murz 2014-07-14 09:05:21 UTC
Created attachment 102755 [details]
Example file - save it to DOC for got described results

When I working with numbering list and try to individually format some items, all works well if I saving to ODT format. 

But when I save to DOC (MS Word) format, all list is formatted with only one individual style, so all other styles are lost.

How to reproduce:

1. Create new LibreOffice Writer document.

2. Create numbering list in it:
---
1. Item 1
2. Item 2
3. Item 3
4. Item 4
---

3. Select via mouse text from start of text "Item 2" to end of "Item 3" (screenshot http://i.imgur.com/zelOsvx.png ) and apply bold style (Ctrl+B) - you will got list with "2." and "3." numbers via Bold style, but "1." and "4." without Bold (screenshot http://i.imgur.com/AKbKrS6.png)

4. Save this document as ODT, close and open again - all styles here without changes (this file is attached to issue).

5. Save this document as DOC, close and open again - you will see that all list numbers goes Bold - screenshot http://i.imgur.com/RE5NSTr.png

But Bold must be only 2 and 3 items. Same problem with Italic formatting and other formatting too.

So custom item styles is applied to all items in list when exporting to MS Office DOC format.

---

Described howto is only example how to reproduce, when working with styling and numbering list - this bug is very annoying, because it broke all document styles in lists.

After investigating this issue I see that LibreOffice creates styles like
WW8Num1z0 WW8Num1z1 ...  WW8Num1z8
WW8Num2z0 WW8Num2z1 ...  WW8Num2z8

and your list will be formatted via only one WW8Num1z0 style.

---

Is this issue reproducible on other users? Can we fix it?
Comment 1 Murz 2014-07-14 09:06:02 UTC
Created attachment 102756 [details]
Example file that already saved to DOC
Comment 2 Murz 2014-07-14 09:10:13 UTC
Created attachment 102757 [details]
Next example with 2 styled lists (in ODT format, save it to DOC)

Here is another example that demonstrates the problem with 2 numbered lists - screenshot is here http://i.imgur.com/dtvimOY.png
Comment 3 Urmas 2014-07-14 13:20:59 UTC
The formatting of list items in DOC file appears shifted by 1 item backwards in Word.
Comment 4 Owen Genat 2014-08-01 06:30:20 UTC
(In reply to comment #0)
> When I working with numbering list and try to individually format some
> items, all works well if I saving to ODT format. 
> 
> But when I save to DOC (MS Word) format, all list is formatted with only one
> individual style, so all other styles are lost.

> After investigating this issue I see that LibreOffice creates styles like
> WW8Num1z0 WW8Num1z1 ...  WW8Num1z8
> 
> and your list will be formatted via only one WW8Num1z0 style.

This is because the MS Binary / OOXML formats do not support named list styles (these are defined in ODF only). Refer this thread for further detail:

http://ask.libreoffice.org/en/question/36453/why-are-my-list-styles-renamed-as-wwnumn-when-converting-from-odt-to-docx/

There is nothing LO can do about this. I think this bug can be RESOLVED as NOTABUG.
Comment 5 Murz 2014-08-01 07:02:38 UTC
Owen Genat, thanks for the info, very useful.
As I understand, main problem is "OOXML doesn't support named numberings", so this issue can not be fully solved, but list of related problems can be minimized.

Main and very annoying problem is when user mark only one item of long list as bold/italic in ODT, in DOC file we got all list styled with this one item style.

So if I use list with 100 items, and mark item 91 as bold, in DOC I will see all list with bold style, this is the main problem. Losting style of item #91 is not so serious problem.

If we cannot store style info for separate item, why we style all list via style of separate item?

Can we cleanup all custom styles of items in list and use defaul style (or first item style) for all list when exporting to DOC? 

This way will considerably decrease described problem and minimize visible differences in odt and doc file.
Comment 6 Owen Genat 2014-08-09 12:38:17 UTC
(In reply to comment #5)
> Main and very annoying problem is when user mark only one item of long list
> as bold/italic in ODT, in DOC file we got all list styled with this one item
> style.

Thanks for clarifying the issue. One thing to note is that the provide ODT examples do not use list styles e.g., ListN or NumberingN.

The WWNumN list styles appear to be created by the DOC export filter according to the formatting of the identifier, rather than the list item. Attachment 102755 [details] only has bold and regular identifiers, thus WWNum1 (bold) is created when saving that attachment to DOC format. The result however is that all list items end up with bold identifiers and thus use the WWNum1 list style.

In attachment 102757 [details] there are bold, italic, and regular identifiers and again, saving this file to DOC results in three list styles. The styles however in the DOC appear to be WWNum2 (bold+italic), and WWNum3 (Bold) in keeping with the resultant identifier appearance.

This explains why, when one of these WWNumN styles is subsequently modified, it affects numerous list items. Exactly why there is a difference between identifier display and apparent definition in the ODT and that in the DOC is unclear. I must admit however that I find list style definitions in DOC/DOCX difficult to determine so this bug really needs a developer to assess it and see what (if anything) is feasible.

This report is therefore not so much about the naming of the WWNumN list styles as it is about how list styles of this type (name) are defined / translated when saving to DOC. I am therefore going to confirm this. Status set to NEW. Summary edited for clarity. Apologies for any initial misunderstanding of the issue.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.