Bug 144668 - DOCX Customized numbering format lost on save and re-open
Summary: DOCX Customized numbering format lost on save and re-open
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
6.4.7.2 release
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: target:7.3.0 target:7.2.5
Keywords: bibisected, bisected, filter:docx, regression
: 144864 145280 (view as bug list)
Depends on:
Blocks:
 
Reported: 2021-09-22 15:59 UTC by John
Modified: 2022-07-29 17:19 UTC (History)
6 users (show)

See Also:
Crash report or crash signature:


Attachments
Proper working document (5.08 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2021-09-23 09:48 UTC, John
Details

Note You need to log in before you can comment on or make changes to this bug.
Description John 2021-09-22 15:59:37 UTC
Description:
Prior versions worked, 6.4.7.2 is not working whereas 6.3.3.2 is working. I have customized numbering formats [0001], [0002], etc.  To create I choose numbering, then choose more numbering.  On tab customize, I change "Before" to '[000' and "after" to ']' for level 1.  For level 2 I set start at to 10, "Before" to '[00' and "After" to ']'.  I also set Show sublevels to 1.  

If I save and re-open the document (Word Format ".docx" but have tried all formats) then the numbers have become [1000], [2000], etc.  The entries on the customize tab are missing.

I have been able to successfully continue to do the above on the old version.  

Steps to Reproduce:
1.To create I choose numbering, then choose more numbering.  
2. On tab customize, 
3. I change "Before" to '[000' and "after" to ']' for level 1. 
4. For level 2 I set start at to 10, "Before" to '[00' and "After" to ']'.  
5. I also set Show sublevels to 1.  
6. save and re-open the document (Word Format ".docx" but have tried all formats)

Actual Results:
the numbers have become [1000], [2000], etc.  The entries on the customize tab are missing.


Expected Results:
[0001], [0002], etc


Reproducible: Always


User Profile Reset: Yes



Additional Info:
The softrware should have saved and re-opened without losing the custom formatting.
Comment 1 John 2021-09-22 18:23:59 UTC
I returned to a document saved in 6.4.7.2 an opened with 6.3.3.2 and noted under customize the before and after are there but they are reversed.  Before shows [ and After shows 000]

They are not perfectly reversed but there is data in the fields.
Comment 2 Regina Henschel 2021-09-22 23:47:55 UTC
Please attach a working document from version 6.3.
Comment 3 Henrik Palomäki 2021-09-23 07:53:07 UTC
Repro on

Version: 7.3.0.0.alpha0+ / LibreOffice Community
Build ID: 363d0e7e2875d0f99cf0442353202c96c097f5e2
CPU threads: 4; OS: Linux 5.10; UI render: default; VCL: kf5 (cairo+xcb)
Locale: en-US (en_US.UTF-8); UI: en-US
TinderBox: Linux-rpm_deb-x86_64@86-TDF, Branch:master, Time: 2021-09-18_04:28:09
Calc: threaded

For me, it wasn't enough to open file right after saving in Writer. It was needed to close the document first and then open the file from the main page.

But couldn't repro on 6.4.7.2.

On version 7.2.1.2 I couldn't even open the "More numbering" menu by pressing the button from the drop down menu of "Toggle ordered list". It exited the menu after pressing the button.

Version 6.3.3.2 works for me too.
Comment 4 Henrik Palomäki 2021-09-23 08:14:05 UTC
After entering the numbering menu from the format menu, I got repro on version 7.2.1.2.
Comment 5 John 2021-09-23 09:48:58 UTC
Created attachment 175210 [details]
Proper working document

This is a properly formatted and working document.

If I OPEN this document in a newer version it will appear correct and look ok. It is upon saving and re-opening the document in newer versions that the numbering format is lost.
Comment 6 Regina Henschel 2021-09-23 17:22:44 UTC
We have two errors here:
DOCX Import: The second level is set to show all levels (ODF text:display-level="2"), but the OOXML format string has only %2 and not %1.
DOCX Export: The format string is totally wrong. In ODF it is loext:num-list-format="[000%1%], but in OOXML is becomes [%1000].

The wrong format string on export is created too, if you start with a new document. The export error does not happen, if the prefix string has only letters and not digits.

Tested with Version: 7.3.0.0.alpha0+ (x64) / LibreOffice Community
Build ID: 3372f93173b900c087073078a01d31916bf47783
CPU threads: 8; OS: Windows 10.0 Build 19043; UI render: Skia/Raster; VCL: win
Locale: de-DE (en_US); UI: en-US
Calc: threaded
Comment 7 Henrik Palomäki 2021-09-24 15:22:35 UTC
(In reply to John from comment #5)
> Created attachment 175210 [details]
> Proper working document
> 
> This is a properly formatted and working document.
> 
> If I OPEN this document in a newer version it will appear correct and look
> ok. It is upon saving and re-opening the document in newer versions that the
> numbering format is lost.

Are you sure the file is a working document? I don't see any indentations on 7.3.0.0.alpha0+, 7.2.1.2 or 7.2.0.4. Also, there are no indentations on MS Word.
Comment 8 Regina Henschel 2021-10-02 23:47:20 UTC
*** Bug 144864 has been marked as a duplicate of this bug. ***
Comment 9 raal 2021-10-09 15:54:33 UTC
This seems to have begun at the below commit.
Adding Cc: to Vasily Melenchuk; Could you possibly take a look at this one?
Thanks
linux-64-7.1$ 4ec9c51f9f2b326e9dfc3634fe9ed182471b0a97 is the first bad commit
commit 4ec9c51f9f2b326e9dfc3634fe9ed182471b0a97
Author: Jenkins Build User <tdf@pollux.tdf>
Date:   Tue Jun 2 04:44:29 2020 +0200

    source 8401181bf0232959efb516802abcda42377ea06e

https://git.libreoffice.org/core/+/8401181bf0232959efb516802abcda42377ea06e
   tdf#120394: DOCX list import: simplify zero width space hack
Comment 10 Commit Notification 2021-11-05 09:55:49 UTC
Vasily Melenchuk committed a patch related to this issue.
It has been pushed to "master":

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

tdf#144668: docx export: simpler way to create lvlText in numberings

It will be available in 7.3.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 11 Aurimas Fišeras 2021-11-05 11:10:19 UTC
*** Bug 145280 has been marked as a duplicate of this bug. ***
Comment 12 Commit Notification 2021-11-05 14:56:29 UTC
Vasily Melenchuk committed a patch related to this issue.
It has been pushed to "libreoffice-7-2":

https://git.libreoffice.org/core/commit/6f84c1fda7654c18b1e53de7b1c077e8a31e606f

tdf#144668: docx export: simpler way to create lvlText in numberings

It will be available in 7.2.4.

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 13 Mark 2021-11-18 19:17:44 UTC
This bug is NOT corrected in the current alpha version 7.3.0.0.
Comment 14 Christian Lohmaier 2021-12-06 13:28:48 UTC
7.2.4 was a hotfix release, updating target in status-whiteboard