Bug 120394 - FILEOPEN: Numbers appear in numbered list MSO created in attached DOC without visible number format
Summary: FILEOPEN: Numbers appear in numbered list MSO created in attached DOC without...
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: low normal
Assignee: Vasily Melenchuk (CIB)
URL:
Whiteboard: target:7.1.0 target:7.0.0.1 target:6....
Keywords: filter:doc
: 89164 (view as bug list)
Depends on:
Blocks: DOC-Bullet-Number-Lists
  Show dependency treegraph
 
Reported: 2018-10-07 22:56 UTC by Aron Budea
Modified: 2022-05-30 09:33 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
Sample DOC (29.50 KB, application/msword)
2018-10-07 22:56 UTC, Aron Budea
Details
PDF exported in Word (18.19 KB, application/pdf)
2018-10-07 22:58 UTC, Aron Budea
Details
numbering2.doc: try this as a unit test :-) (26.00 KB, application/msword)
2019-04-16 18:25 UTC, Justin L
Details
numbering2.pdf: Word 2010. Notice that level 2 numbering increases even though unseen. (59.13 KB, application/pdf)
2019-04-27 13:58 UTC, Justin L
Details
numbering2.docx: LO doesn't handle the docx of this one properly (20.82 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2019-04-27 14:00 UTC, Justin L
Details
numbering_sNumStringEmpty.patch: close, but not general enough patch (1.73 KB, patch)
2019-08-01 18:54 UTC, Justin L
Details
Sample DOC, numbering2 DOC and numbering2 DOCX compared in MSO LO (59.06 KB, image/png)
2020-06-23 08:42 UTC, Timur
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Aron Budea 2018-10-07 22:56:53 UTC
Created attachment 145455 [details]
Sample DOC

Open the attached DOC.
 
 Note the following discrepancies:
 - the line "IJKL:" becomes "1IJKL:"
 - the numbers 0 and 1 appear above and below the line "1.1.2 FGHIJ"
 
 Observed using LO 6.2.0.0.alpha0+ (2018-09-22, 8b1501d80dc9d3f42c351c6e026fa737e116cae5) & 3.3.0 / Windows 7.
Comment 1 Aron Budea 2018-10-07 22:58:07 UTC
Created attachment 145456 [details]
PDF exported in Word
Comment 2 MM 2018-10-08 00:27:15 UTC
Confirmed on windows 7 x64 with Version: 6.0.7.1 (x64)
Build ID: 5d2cb2a5dd04fe174b336488731eb50bbb5faed3
CPU threads: 3; OS: Windows 6.1; UI render: default
Comment 3 Timur 2019-04-16 10:06:42 UTC
Repro with 6.3+, only for this DOC. If resaved in MSO as DOCX, opens fine.
LO shows numbers because those lines *are* numbered in MSO, but without visible number format.
I don't know how this was created. OK is disabled in "Define New Number Format" if Number style is "none". 
That all really makes this DOC wrong so I set priority to low.
Comment 4 Justin L 2019-04-16 11:47:39 UTC
(In reply to Timur from comment #3)
> That all really makes this DOC wrong so I set priority to low.
Yes, I agree with all of that and came to the same conclusion myself. According to Word 2003, this document is at least partially "corrupt" because if I go into the UI for numbering on these two lines, select "customize" to see the details, and then hit OK (without changing anything), then the numbering appears. So there is definitely something non-standard and slightly illegal about this document.

I also saved it to .docx format with W2003, and agree that .docx opens OK in LO. Here we see that instead of the expected
    <w:lvlText w:val="%1."/>
we get
    <w:lvlText w:val=""/>

That suggests that when the numbering string is empty, it should be considered as type NONE instead of ARABIC(1,2,3) or whatever.
Comment 5 Timur 2019-04-16 12:32:24 UTC Comment hidden (obsolete)
Comment 6 Justin L 2019-04-16 14:25:44 UTC
I marked myself as an assignee - I'll fix it eventually.  I think I'll wait until 6.4 master because anything to do with numbering is nasty business.  I want to hang myself with a long rope, not a short rope.
Comment 7 Justin L 2019-04-16 18:25:44 UTC
Created attachment 150798 [details]
numbering2.doc: try this as a unit test :-)
Comment 8 Aron Budea 2019-04-17 02:48:52 UTC
Thanks for picking it up, Justin!

(In reply to Timur from comment #5)
> Aron, how was this DOC created? Do you think it makes sense to keep this
> open? I wouldn't mind marking as WontFix.
It's a valid document based on an original created in MS Word (2010 or before, and cut down/sanitized in MS Word 2013). I don't know how the original was created, and it's not the point, users often don't follow the expected way of setting things, and applications aren't perfect to prevent them.
Comment 9 Justin L 2019-04-27 13:58:51 UTC
Created attachment 151040 [details]
numbering2.pdf: Word 2010. Notice that level 2 numbering increases even though unseen.
Comment 10 Justin L 2019-04-27 14:00:23 UTC
Created attachment 151041 [details]
numbering2.docx: LO doesn't handle the docx of this one properly
Comment 11 Justin L 2019-08-01 18:54:33 UTC
Created attachment 153096 [details]
numbering_sNumStringEmpty.patch: close, but not general enough patch
Comment 12 Justin L 2019-08-01 18:56:29 UTC
Probably unsolvable without modifying Writer's core functionality.
Comment 13 Justin L 2019-08-02 17:51:53 UTC
*** Bug 89164 has been marked as a duplicate of this bug. ***
Comment 14 Justin L 2020-05-14 19:52:59 UTC
@Vasily - this might be an easy win for you since I think you completed the underlying changes for bug 116883 that comment 12 was hoping for. If nothing else, this will be a good test to see if your solution is generic enough to be able to expand to cover this scenario.
Comment 15 Vasily Melenchuk (CIB) 2020-05-15 07:34:49 UTC
@Justin I quickly looked here, seems no quick fix possible right now:
1. My solution for tdf#116883 does not help fully here:  empty format string in code means that we should try to use old way with prefix and suffix. I need to redesign it a little.
2. I see some issues with w:numStyleLink/w:styleLink impleentation in LO. Once I for attached numbering2.docx instead of reference via style use reference to abstract list, document looks much better.
3. After p.2 there are still some strange issues with third level (1.2.1) it was still incorrect for me.
Comment 16 Commit Notification 2020-05-17 01:07:10 UTC
Vasily Melenchuk committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/047de8a887628dc45d5b8df7b297abd6fa2fafc5

tdf#120394: docx import: support for w:styleLink

It will be available in 7.0.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 17 Commit Notification 2020-05-17 01:08:47 UTC
Vasily Melenchuk committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/d8329149394e4e5758a9e293b0162db050379a4e

tdf#120394: list format string can be empty

It will be available in 7.0.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 18 Commit Notification 2020-06-01 16:21:12 UTC
Vasily Melenchuk committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/8401181bf0232959efb516802abcda42377ea06e

tdf#120394: DOCX list import: simplify zero width space hack

It will be available in 7.1.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 19 Commit Notification 2020-06-04 23:14:39 UTC
Vasily Melenchuk committed a patch related to this issue.
It has been pushed to "libreoffice-6-4":

https://git.libreoffice.org/core/commit/cdcbf109c47d366539b98c6e379874ae08de08e1

tdf#120394: list format string can be empty

It will be available in 6.4.5.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 20 Commit Notification 2020-06-04 23:14:49 UTC
Vasily Melenchuk committed a patch related to this issue.
It has been pushed to "libreoffice-7-0":

https://git.libreoffice.org/core/commit/36c713f673796f51b9bc657492b0c16396231805

tdf#120394: DOCX list import: simplify zero width space hack

It will be available in 7.0.0.1.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 21 Commit Notification 2020-06-10 13:21:06 UTC
Vasily Melenchuk committed a patch related to this issue.
It has been pushed to "libreoffice-6-4":

https://git.libreoffice.org/core/commit/3124b2c5746a81225dc122d53c5f06f8a9967129

tdf#120394: docx import: support for w:styleLink

It will be available in 6.4.6.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 22 Commit Notification 2020-06-11 23:15:18 UTC
Vasily Melenchuk committed a patch related to this issue.
It has been pushed to "libreoffice-6-4":

https://git.libreoffice.org/core/commit/129006ee5bec721bfb8bae9cd55586b353e230b7

tdf#120394: DOCX list import: simplify zero width space hack

It will be available in 6.4.6.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 23 Commit Notification 2020-06-17 09:20:27 UTC
Vasily Melenchuk committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/7e605bc3ff0cfea76be4683f0170d821fcae7203

tdf#120394: doc import: use list format string

It will be available in 7.1.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 24 Vasily Melenchuk (CIB) 2020-06-17 11:06:13 UTC
Both doc and docx documents are looking okay for me in master. Not all patches are backported, so 7.0 and 6.4 are not as good as possible.
Comment 25 Commit Notification 2020-06-18 17:23:32 UTC
Vasily Melenchuk committed a patch related to this issue.
It has been pushed to "libreoffice-7-0":

https://git.libreoffice.org/core/commit/e66bd1f65ffdad9ea5450a11dfd1fb78556b1927

tdf#120394: doc import: use list format string

It will be available in 7.0.0.1.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 26 Timur 2020-06-23 08:42:59 UTC
Created attachment 162335 [details]
Sample DOC, numbering2 DOC and numbering2 DOCX compared in MSO LO

All looks good.
Comment 27 Commit Notification 2020-06-23 14:10:40 UTC
Vasily Melenchuk committed a patch related to this issue.
It has been pushed to "libreoffice-6-4-5":

https://git.libreoffice.org/core/commit/3c09eb16f4e0dea47839adbef66584a6e7bbca63

fix tdf#83309 tdf#120394 tdf#132754: squashed fix backport

It will be available in 6.4.5.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.