Bug 134294 - Chapter numbering not updated when heading added in between (until heading applied again or reload )
Summary: Chapter numbering not updated when heading added in between (until heading ap...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
6.2.8.2 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: target:7.3.0 target:7.2.5
Keywords: bibisected, bisected, regression
Depends on:
Blocks: Heading-Numbering
  Show dependency treegraph
 
Reported: 2020-06-25 11:14 UTC by Timur
Modified: 2022-10-03 09:54 UTC (History)
7 users (show)

See Also:
Crash report or crash signature:


Attachments
video (1.89 MB, video/webm)
2021-11-18 19:45 UTC, BogdanB
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Timur 2020-06-25 11:14:55 UTC
Chapter numbering is not updated on insert in between. 

Example:
1. open ODT attachment 115699 [details] from bug 76817
2. change Blabla or bla after "2 Second" to Heading 1 
3. see that "2.1 Second - 2" remains the same, instead of being 3.1 
Note: ok for a change in "1" headings

Another example: 
1. open ODT attachment 146174 [details] from bug 121066
2a. in emtly line after "1.1" add text and set Heading 2
3a. see that further heading 3 lines remain 1.1.x instead of being 1.2.x
Note: ok if heading 3 set
Or
2b. after "1.2 Title 2 (First Open)" add new line and set Heading 1
3b. see that further heading lines remain 1.3.x instead of being 2.1.x

Worked in 6.1, regression in 6.2.
Those problems remain only until reload, as in bug 69811.
Comment 1 Attila Baraksó (NISZ) 2020-06-25 15:02:03 UTC
Reproduced in:

Version: 7.1.0.0.alpha0+ (x64)
Build ID: 010713e65ccade7b682c219707c8db3d864145c1
CPU szálak: 4; OS: Windows 10.0 Build 17134; Felületmegjelenítés: Skia/Raster; VCL: win
Locale: hu-HU (hu_HU); UI: hu-HU
Calc: CL
Comment 2 Attila Baraksó (NISZ) 2020-06-25 17:10:25 UTC
Bibisected using bibisect-win32-6.2 to:
URL: https://cgit.freedesktop.org/libreoffice/core/commit/?id=bafd49fb4d72b6dbb10b2fea1386d295dc9d435c
author: Bjoern Michaelsen <bjoern.michaelsen@libreoffice.org>
committer: Björn Michaelsen <bjoern.michaelsen@libreoffice.org>
summary: tdf#118049 tdf#118833 tdf#118725: Fix some SwDepend regressions

Adding CC: Bjoern Michaelsen
Comment 3 kan 2020-06-26 17:00:25 UTC Comment hidden (obsolete)
Comment 4 kan 2020-06-26 17:21:13 UTC
(In reply to shariqkeen from comment #3)

> reproduced with docx in
> 
> Version: 7.1.0.0.alpha0+
> Build ID: e69f547bce7de376a0af464c5f7af5e7d2c8784a
> CPU threads: 4; OS: Linux 4.15; UI render: default; VCL: gtk3
> Locale: en-IN (en_IN); UI: en-US
> TinderBox: Linux-rpm_deb-x86_64@86-TDF, Branch:master, Time:
> 2020-06-23_15:52:52
> Calc: threaded
> 
> tested docx is attachment 162418 [details], whose demo gifs from are
> attachment 162415 [details], attachment 162416 [details], attachment 162417 [details]
> [details] from bug 130446

on opening docx attachment 162418 [details] [in 7.1 alpha Linux], when a new heading is introduced just above another heading, and if the level of the new heading is different from the heading below, then the heading below doesn't get updated.

For example, introduce heading 1/3 above heading 2 (heading 2 doesn't update). Or introduce heading 1/2/3 above heading 4 (heading 4 doesn't update).

Though it happens only the first time at a specific location, if the same heading is tinkered just one more time then everything gets updated correctly for that location. But i saw other locations still remain without getting updated, if multiple such instances are kept.

gifs showing the demo are attachment 162415 [details], attachment 162416 [details], attachment 162417 [details]
Comment 5 Justin L 2021-03-24 08:19:16 UTC
repro 7.2+

The first example has spent part of it's life in an MS Format - written by LibreOffice. Probably better to focus on the second one (attachment 146174 [details]), although both are exhibiting the same symptoms.

Since the identified commit was a fix for an earlier 6.2-ish patch by
author	Bjoern Michaelsen on 2018-05-05 08:14:12 +0200
commit 83243003b46dfb258c2b41049b0e1cb82a2d7ddb 
use WriterMultiListener instead of SwDepend in SwContentNode

...I tested in 6.0, and things seemed to be working there too. So it wasn't just something that "got fixed, and then the fix was reverted".
Comment 6 BogdanB 2021-07-27 05:05:50 UTC
I retested in Version: 7.3.0.0.alpha0+ / LibreOffice Community
Build ID: 612d5b1a04fe022a34018d901bb9b052791d54e5
CPU threads: 4; OS: Linux 5.8; UI render: default; VCL: gtk3
Locale: ro-RO (ro_RO.UTF-8); UI: en-US
Calc: threaded

With the attachment from description if I click once on Heading 2 is a bug, if I click one more time on Heading 2 everything is ok.
Comment 7 Commit Notification 2021-11-05 09:49:29 UTC
Bjoern Michaelsen committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/4a7022c199addb1fbc7445708c0f4801fbf1e47f

tdf#134294: fix Chapter heading updates

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 8 Commit Notification 2021-11-05 16:49:22 UTC
Bjoern Michaelsen committed a patch related to this issue.
It has been pushed to "libreoffice-7-2":

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

tdf#134294: fix Chapter heading updates

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 9 BogdanB 2021-11-18 19:39:19 UTC
NOw a new headingis applyed it remains the same. It change ok just after I click on the wrong numbers. I will upload a video with the latest master.
Comment 10 BogdanB 2021-11-18 19:45:57 UTC
Created attachment 176351 [details]
video

Numbers are changing NOT when previous style is changed to H1, but when clicked.
Comment 11 Christian Lohmaier 2021-12-06 13:28:48 UTC
7.2.4 was a hotfix release, updating target in status-whiteboard
Comment 12 Björn Michaelsen 2022-09-25 01:26:52 UTC
(In reply to BogdanB from comment #10)
> Created attachment 176351 [details]
> video
> 
> Numbers are changing NOT when previous style is changed to H1, but when
> clicked.

That is not reproducable for me on current master.
Comment 13 Timur 2022-09-26 12:04:12 UTC Comment hidden (obsolete)
Comment 14 Björn Michaelsen 2022-09-26 20:26:07 UTC
(In reply to Timur from comment #13)
> I set New again, as original steps from Description are reproduced for me in
> 7.5+.
> Test Build ID: bb47ffbc9d36e83695aa0d01767d3f83533c04e0, VCL: gtk3

... which is not the current master at the time of my comment. That is older.

This might be relevant as the fix for https://bugs.documentfoundation.org/show_bug.cgi?id=144939 came in after that and might also have fixed this one.
Comment 15 Timur 2022-09-27 08:47:00 UTC Comment hidden (obsolete)
Comment 16 Timur 2022-09-27 08:47:31 UTC
*** Bug 144939 has been marked as a duplicate of this bug. ***
Comment 17 Xisco Faulí 2022-10-03 09:54:32 UTC
(In reply to Timur from comment #15)
> It's Fixed and bug 144939 seems a duplicate, same problem, same commit.

no, the commit is not the same although the commit message is the same.