Bug 155324 - updating ToX inserts wrong (too large) page numbers
Summary: updating ToX inserts wrong (too large) page numbers
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
7.1.0.3 release
Hardware: All All
: medium normal
Assignee: Michael Stahl (allotropia)
URL:
Whiteboard: target:7.6.0 target:7.5.5
Keywords: bisected, regression
Depends on:
Blocks: TableofContents-Indexes
  Show dependency treegraph
 
Reported: 2023-05-15 13:23 UTC by Michael Stahl (allotropia)
Modified: 2023-08-11 01:44 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
reproducer (17.81 KB, application/vnd.oasis.opendocument.text)
2023-05-15 17:23 UTC, Michael Stahl (allotropia)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Stahl (allotropia) 2023-05-15 13:23:57 UTC
this is a regression in 7.1 from commit b9ef71476fd70bc13f50ebe80390e0730d1b7afb
"tdf#134298 sw: layout: remove left-over page frame without content"

1. open attached document, with ToX followed by a page with many footnotes
2. update ToX
3. click on ToX entry to jump down
4. scroll back up
5. update ToX
6. page numbers in ToX are wrong

then since 7.4 commit 86081afc3021fa0ae6c2b32d11b4b20cc8a190a3 it became easier to repro:

1. open attached document, with ToX followed by a page with many footnotes
2. update ToX
3. page numbers in ToX are wrong
Comment 1 Michael Stahl (allotropia) 2023-05-15 17:23:54 UTC
Created attachment 187301 [details]
reproducer
Comment 2 m_a_riosv 2023-05-15 22:27:17 UTC
Reproducible, pages on TOC are wrong from the beginning.
'Foo' -> page 7 when is page 5. Clicking the link goes to the correct place.
Version: 7.6.0.0.alpha1+ (X86_64) / LibreOffice Community
Build ID: 6f1534940ac12ff8e46f4782e18cfb6cf585da39
CPU threads: 16; OS: Windows 10.0 Build 22621; UI render: default; VCL: win
Locale: es-ES (es_ES); UI: en-US Calc: CL threaded
Comment 3 Commit Notification 2023-05-16 18:14:27 UTC
Michael Stahl committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/325fe7ab507fd8f2ca17a3db32181edf30169525

tdf#155324 sw: layout: try not to MoveFwd onto a page created by page break

It will be available in 7.6.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 4 Commit Notification 2023-05-17 14:55:52 UTC
Michael Stahl committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/247738a9afeeb2f0644fa0307b7023fe115fae83

tdf#155324 sw: add unit test

It will be available in 7.6.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 5 m_a_riosv 2023-05-18 14:38:46 UTC
Thanks @Michael.
Please, can you set up as resolved – fixed, so I can put as verified.
Comment 6 Commit Notification 2023-06-27 09:29:40 UTC
Michael Stahl committed a patch related to this issue.
It has been pushed to "libreoffice-7-5":

https://git.libreoffice.org/core/commit/425a252c3cc5e5a79a533965026dd4af6b8df739

tdf#155324 sw: layout: try not to MoveFwd onto a page created by page break

It will be available in 7.5.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.