Bug 148455 - In Writer, the paragraph numbering continues instead of restarting after updating cross references
Summary: In Writer, the paragraph numbering continues instead of restarting after upda...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
7.2.6.2 release
Hardware: All All
: medium normal
Assignee: Vasily Melenchuk (CIB)
URL:
Whiteboard: target:7.4.0 target:7.3.4
Keywords:
: 148049 (view as bug list)
Depends on:
Blocks: DOCX-Bullet-Number-Outline-Lists
  Show dependency treegraph
 
Reported: 2022-04-07 23:32 UTC by softdev1029
Modified: 2023-05-05 15:19 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
Paragraph numbering continues instead of restarting at a) (deleted)
2022-04-07 23:35 UTC, softdev1029
Details
The numbering should re-start (18.21 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2022-04-20 03:20 UTC, softdev1029
Details
Minimal file for testing (12.57 KB, application/vnd.oasis.opendocument.text)
2022-04-20 17:52 UTC, sdc.blanco
Details
.docx file created by LO 7.4 from attachment 179687 (5.12 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2022-04-26 13:27 UTC, sdc.blanco
Details
Attachment 179787in Word 2013 and the original attachment 179687 in Writer (83.09 KB, image/png)
2022-05-05 10:01 UTC, Gabor Kelemen (allotropia)
Details
attachment 179674 after two rounds of RT (169.11 KB, image/png)
2022-05-11 22:31 UTC, Gabor Kelemen (allotropia)
Details
attachment 179674 after two rounds of RT (189.11 KB, image/png)
2022-05-12 11:58 UTC, Gabor Kelemen (allotropia)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description softdev1029 2022-04-07 23:32:04 UTC
Description:
In LibreOffice Writer,
- The original document restarts the paragraph numbering at 1 or a).
- After opening the document in LibreOffice 6.4.7.2 or 7.2.5.2 or 7.3.1.3 or 7.3.3.0.0 etc, the updated document produces the paragraph numbering that continues from a previous paragraph number instead of restarting at 1 or a).

Steps to Reproduce:
1. In LibreOffice Writer, the original document restarts the paragraph numbering at 1 or a).
2. After opening the document in LibreOffice 7.2.5.2 or 7.3.1.3 or 7.3.3.0.0 etc, the updated document produces the paragraph numbering that continues from a previous paragraph number instead of restarting at 1 or a).

Actual Results:
After opening the document in LibreOffice 7.2.5.2 or 7.3.1.3 or 7.3.3.0.0 etc, the updated document produces the paragraph numbering that continues from a previous paragraph number instead of restarting at 1 or a).

Expected Results:
As the original document, it should restart the paragraph numbering at 1 or a).


Reproducible: Always


User Profile Reset: No



Additional Info:
I will attach the .docx file I tested.
Comment 1 softdev1029 2022-04-07 23:35:07 UTC
Created attachment 179389 [details]
Paragraph numbering continues instead of restarting at a)

This original document, page 8 includes the below paragraphs.

```
(a)	discuss and evaluate proposals in connection ...
(b)	discuss ways in which the CEFC and the Counterparty ...
```

But when opening it in LO writer 6.4 or 7.3.x or etc, the paragraph numbering doesn't restart at (a) ... instead, it starts at (e)

```
(e)	discuss and evaluate proposals in connection ...
(f)	discuss ways in which the CEFC and the Counterparty ...
```
Comment 2 Xisco Faulí 2022-04-08 08:45:40 UTC
The content of attachment 179389 [details] has been deleted for the following reason:

user's request
Comment 3 Stéphane Guillou (stragu) 2022-04-14 14:49:22 UTC
Hi softdev
Thank you for the report.
For us to be able to test this, we either need an example document, or a series of steps to recreate the issue from scratch.
Would you be able to provide this?
Comment 4 softdev1029 2022-04-20 03:20:29 UTC
Created attachment 179674 [details]
The numbering should re-start

Please use the document attached.

When we open it in the MS Word file, the numbering re-starts correctly like below

```
1.1 ...
  (a) ...
  (b) ...
  (c) ...

lpsum...
  (a) ...
  (b) ...
```

But when we open it in LO (any version such as 6.2 or 7.2, 7.3 ...), the numbering is continued such as d) e) ...

```
1.1 ...
  (a) ...
  (b) ...
  (c) ...

lpsum...
  (d) ...
  (e) ...
```
Comment 5 sdc.blanco 2022-04-20 07:19:46 UTC
Using attachment 179674 [details], 

Did not reproduce with 7.2.6.2

Did not reproduce with:
Version: 7.4.0.0.alpha0+ (x64) / LibreOffice Community
Build ID: f8e11c6480ff0005715b989a6d4e2e10a3816cf6
CPU threads: 8; OS: Windows 10.0 Build 19043; UI render: Skia/Raster; VCL: win
Locale: da-DK (da_DK); UI: en-US
Calc: CL
Comment 6 softdev1029 2022-04-20 15:55:29 UTC
Sorry, my explanation doesn't seem correct.

Test steps are:

1. Try to open it in MSWord and confirm all re-started numbering.
2. And open it in LO (any version, 6.2, 7.2, 7.3) and save it in MS word version.
In fact, in LO, the numbering correctly re-starts...

3. But, open the saved version in MSWord again. Then you can see the numbering is not re-started and go with d) f) ...

Please let me know if the above test steps are helpful.

Thanks
Comment 7 sdc.blanco 2022-04-20 17:52:04 UTC
Created attachment 179687 [details]
Minimal file for testing

I can reproduce the observations in comment 6, but the formatting was complicated (e.g., the list items are also headings), so I tried to make a minimal version that reproduces your file, which is attached.

1. Open the .odt attachment with LO or Word.  Looks OK.

2. Open attachment with LO and save as .docx

3. Open saved .docx file in LO and Word

Actual:  Looks ok in LO. 
         In Word, the "restart numbering" is lost.  
           That is, instead of the headings showing (a) (b) (c) (a) (b), 
                                          they show (a) (b) (c) (d) (e)


The attached file was created and tested (in Safe Mode) with
Version: 7.4.0.0.alpha0+ (x64) / LibreOffice Community
Build ID: f8e11c6480ff0005715b989a6d4e2e10a3816cf6
CPU threads: 8; OS: Windows 10.0 Build 19043; UI render: Skia/Raster; VCL: win
Locale: da-DK (da_DK); UI: en-US
Calc: CL 

Test file created with follow procedure.

1. Open new document.
2. Add five Heading 3 paragraphs.
3. Tools > Chapter Numbering  to assign a b c numbering to Level 3 (with ( ) before and after separators
4. Restart numbering on fourth heading
5. save as .odt.
Comment 8 sdc.blanco 2022-04-20 17:54:04 UTC
Also reproduced with 7.2.6.2 - so I have set that version as the earliest.  
If you can test with earlier versions, then you can change the Version number.
Comment 9 Gabor Kelemen (allotropia) 2022-04-26 12:59:10 UTC
(In reply to softdev1029 from comment #4)
> But when we open it in LO (any version such as 6.2 or 7.2, 7.3 ...), the
> numbering is continued such as d) e) ...
> 
> ```
> 1.1 ...
>   (a) ...
>   (b) ...
>   (c) ...
> 
> lpsum...
>   (d) ...
>   (e) ...
> ```

Hi

I can reproduce this issue with the file when it is saved with 7.2 but not anymore when saved with 7.3 and newer since:

https://git.libreoffice.org/core/+/e6bf21d2d5efb231c877eb985997b28033198600

author	Vasily Melenchuk <vasily.melenchuk@cib.de>	Mon Sep 27 13:40:41 2021 +0300
committer	Vasily Melenchuk <vasily.melenchuk@cib.de>	Mon Oct 04 15:29:45 2021 +0200

tdf#144578: numbering: generate include upper levels for UI
Comment 10 Gabor Kelemen (allotropia) 2022-04-26 13:05:51 UTC
(In reply to sdc.blanco from comment #7)
> Created attachment 179687 [details]
> Minimal file for testing
> 
> I can reproduce the observations in comment 6, but the formatting was
> complicated (e.g., the list items are also headings), so I tried to make a
> minimal version that reproduces your file, which is attached.
> 
> 1. Open the .odt attachment with LO or Word.  Looks OK.
> 
> 2. Open attachment with LO and save as .docx
> 
> 3. Open saved .docx file in LO and Word
> 
> Actual:  Looks ok in LO. 
>          In Word, the "restart numbering" is lost.  
>            That is, instead of the headings showing (a) (b) (c) (a) (b), 
>                                           they show (a) (b) (c) (d) (e)
> 

I don't see such an issue in Word 2010/2013. Numbering restarts correctly when saved from 7.2 or 7.3, 7.4.

Can you attach a docx file that is saved from your odt and appears incorrectly?
Comment 11 sdc.blanco 2022-04-26 13:27:43 UTC
Created attachment 179787 [details]
.docx file created by LO 7.4 from attachment 179687 [details]

(In reply to Gabor Kelemen (allotropia) from comment #10)
> Can you attach a docx file that is saved from your odt and appears
> incorrectly?
The attached .docx file was created 3 minutes after saving attachment 179687 [details], but now as .docx, and using LO 7.4.  In Word 365, the restart numbering is lost, but in LO 7.2 and 7.4 the restart appears as expected.
Comment 12 Gabor Kelemen (allotropia) 2022-05-05 10:01:32 UTC
Created attachment 179942 [details]
Attachment 179787 [details]in Word 2013 and the original attachment 179687 [details] in Writer

I see that the numbering is restarted correctly in Word 2013. Very strange.

Another issue is the two dots appearing before the numbering letter.

This started in:

https://git.libreoffice.org/core/+/9987b518fca1476bd0ce8c86bcf6ac7c81f7b580
author	Vasily Melenchuk <vasily.melenchuk@cib.de>	Mon Jun 14 14:27:56 2021 +0300
committer	Thorsten Behrens <thorsten.behrens@allotropia.de>	Tue Jun 29 19:02:20 2021 +0200

new ODF numbered list parameter loext:num-list-format

After this the two extra dots appeared in the odt attachment 179687 [details] file as well until: 

https://git.libreoffice.org/core/+/bf2b46aa15665dde63ceff4e7686b99b3990354f

author	Vasily Melenchuk <vasily.melenchuk@cib.de>	Sun Dec 26 20:38:30 2021 +0300
committer	Vasily Melenchuk <vasily.melenchuk@cib.de>	Mon Dec 27 15:47:21 2021 +0100
tree 765ac9ce801e742d2d6f4dd56640e4a5bd53a48f
parent bbfce0b49fb11997af8eb03d40431b6a78f2aebe [diff]

tdf#146257: sw: better handling for list numbering = NONE

The docx export when opened in Word (not in Writer!) is still affected in a fresh nightly:

Version: 7.4.0.0.alpha0+ (x64) / LibreOffice Community
Build ID: fe61ab648e0f3b5993660f2255aca2de6f53c2a2
CPU threads: 14; OS: Windows 10.0 Build 19044; UI render: default; VCL: win
Locale: de-DE (hu_HU); UI: en-US
Calc: threaded Jumbo

BUT this is a completely different issue of what the OP claimed. It would be better to file this separately.

Also .doc export of your odt attachment 179687 [details] is bad: the last paragraph continues the original numbering, so "a b c a b" becomes "a b c a d". 
In Word there are two extra dots before the letters.

RTF export is again differently bad: restart numbering is completely lost.
In Word there are two extra dots before the letters.
Comment 13 Gabor Kelemen (allotropia) 2022-05-11 22:31:44 UTC
Created attachment 180068 [details]
attachment 179674 [details] after two rounds of RT

Turns out if the original attachment 179674 [details] is saved in Writer, then opened in Word, saved again, then opened in Writer, it is indeed not restarting the numbering, as stated in comment #6

Version: 7.4.0.0.alpha0+ (x64) / LibreOffice Community
Build ID: cdf8e971d5d46df4bcab35a99c4254df9459213f
CPU threads: 14; OS: Windows 10.0 Build 19044; UI render: default; VCL: win
Locale: de-DE (hu_HU); UI: en-US
Calc: threaded
Comment 14 Gabor Kelemen (allotropia) 2022-05-11 22:41:41 UTC
Seems to have started with:

https://git.libreoffice.org/core/+/9987b518fca1476bd0ce8c86bcf6ac7c81f7b580

author	Vasily Melenchuk <vasily.melenchuk@cib.de>	Mon Jun 14 14:27:56 2021 +0300
committer	Thorsten Behrens <thorsten.behrens@allotropia.de>	Tue Jun 29 19:02:20 2021 +0200

new ODF numbered list parameter loext:num-list-format

Before this the numbering restart survived two rounds of RT, after this the numbering continued with (4) and (e) - since then it is (d) and (e).
Comment 15 Gabor Kelemen (allotropia) 2022-05-12 11:54:19 UTC
(In reply to Gabor Kelemen (allotropia) from comment #13)
> Created attachment 180068 [details]
> attachment 179674 [details] after two rounds of RT
> 
> Turns out if the original attachment 179674 [details] is saved in Writer,
> then opened in Word, saved again, then opened in Writer, it is indeed not
> restarting the numbering, as stated in comment #6
> 

This is not true, after another look this screenshot was made in 7.3.0, but the issue was fixed in 7.4 with:

https://git.libreoffice.org/core/+/f50a8f1d8852bfc143809dc5d45ef662d3557a61

tdf#146851: writerfilter: do not recreate list levels on override
Comment 16 Gabor Kelemen (allotropia) 2022-05-12 11:58:54 UTC
Created attachment 180076 [details]
attachment 179674 [details] after two rounds of RT

In recent master, this time for real:

Version: 7.4.0.0.alpha0+ (x64) / LibreOffice Community
Build ID: cdf8e971d5d46df4bcab35a99c4254df9459213f
CPU threads: 14; OS: Windows 10.0 Build 19044; UI render: default; VCL: win
Locale: de-DE (hu_HU); UI: en-US
Calc: threaded
Comment 17 Commit Notification 2022-05-18 13:00:41 UTC
Vasily Melenchuk committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/198381eb32edcc3e82d0f23df65f0804a08b44e6

tdf#148455 docx import/export: improvements to lvlOverride

It will be available in 7.4.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 2022-05-18 14:47:33 UTC
Vasily Melenchuk committed a patch related to this issue.
It has been pushed to "libreoffice-7-3":

https://git.libreoffice.org/core/commit/270e8967a720166205263cf695aedb00f8f7ecd9

tdf#148455 docx import/export: improvements to lvlOverride

It will be available in 7.3.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 19 Gabor Kelemen (allotropia) 2022-05-19 06:28:23 UTC
*** Bug 148049 has been marked as a duplicate of this bug. ***