Bug 146704 - section setting endnote "collect at end of section" does not update layout
Summary: section setting endnote "collect at end of section" does not update layout
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
7.3.0.1 rc
Hardware: All All
: medium normal
Assignee: Attila Szűcs
URL:
Whiteboard: target:7.4.0 target:7.3.1
Keywords: bisected, regression
Depends on:
Blocks:
 
Reported: 2022-01-11 20:46 UTC by Michael Stahl (allotropia)
Modified: 2022-03-10 10:05 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Stahl (allotropia) 2022-01-11 20:46:43 UTC
steps:

1. insert section
2. inside section, insert endnote
3. Format->Section, Options, Footnotes/Endnotes, check Endnotes "collect at end of section", OK

expected:
the endnote moved from its own endnote page to the first page, into section

actual:
nothing happens
(but if you click "collect footnote at end of section" *as well* it will move 

the executions diverge in SwTextFrame::ConnectFootnote():

│      611      SwFootnoteBossFrame *pBoss = pContent->FindFootnoteBossFrame( !bEnd );  

here pBoss is SwPageFrame 1 (page 1) now
and was SwColumnFrame 12 (inside section) in LO 6.4

presumably because of 

commit 4c31b4ef2083087a822c3ae648fd09acc67d2f88
Author:     Attila Szűcs <szucs.attila3@nisz.hu>
AuthorDate: Wed Sep 8 15:51:16 2021 +0200
Commit:     László Németh <nemeth@numbertext.org>
CommitDate: Tue Nov 2 16:31:24 2021 +0100

    tdf#139336 sw: fix extra pages of multicolumn sections with footnotes


...which added code to FindFootnoteBossFrame() that checks for the sections' IsFootnoteAtEnd() but not IsEndnAtEnd() - a suspicious omission.

note: a bisect won't find this because the bug is masked by another bug 146605 that is fixed on master since today.
Comment 1 David 2022-01-25 23:36:09 UTC
If this regression can't be fixed properly in a timely manner, would it be possible to at least mitigate the problem with the following fix?

In sw/source/uibase/app/docshini.cxx, line 292 needs to be changed from:
    m_xDoc->getIDocumentSettingAccess().set( DocumentSettingId::FOOTNOTE_IN_COLUMN_TO_PAGEEND, true);

to:

   m_xDoc->getIDocumentSettingAccess().set( DocumentSettingId::FOOTNOTE_IN_COLUMN_TO_PAGEEND, false);

The endnote correctly changes position with this fix, but it may revert prior fixes from bug 139336, which caused this regression.
Comment 2 David 2022-01-31 09:35:23 UTC
@Attila Szucs
Is there any status update on a fix for this regression?
Comment 3 Attila Szűcs 2022-01-31 12:19:55 UTC
(In reply to David from comment #2)
> @Attila Szucs
> Is there any status update on a fix for this regression?

It is easy to fix.. i will upload a patch to gerrit soon..

Michael Stahl is right, the problem is in the FindFootnoteBossFrame .. 
i did not know that endnotes use this function too.. so i just need to add +1 condition for my changes.

Sorry .. i just had a lot of changes in my workspace... so i did not have much time to code ... :(
Comment 4 David 2022-02-11 19:23:33 UTC
(In reply to Attila Szűcs from comment #3)
> Sorry .. i just had a lot of changes in my workspace... so i did not have
> much time to code ... :(

Is there any possibility that this could be fixed in time for the 7.3.1 release?
Comment 5 Commit Notification 2022-02-15 14:53:51 UTC
Attila Szűcs committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/9a457c24ab2731c99f1a5fa1d28f68788e6977f3

tdf#146704 sw: fix regression of endnote layout in sections

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 6 David 2022-02-15 16:56:29 UTC
Thanks Attila!  Works correctly now!
Comment 7 Commit Notification 2022-02-15 19:50:33 UTC
Attila Szűcs committed a patch related to this issue.
It has been pushed to "libreoffice-7-3":

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

tdf#146704 sw: fix regression of endnote layout in sections

It will be available in 7.3.2.

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 2022-02-23 11:50:09 UTC
Attila Szűcs committed a patch related to this issue.
It has been pushed to "libreoffice-7-3-1":

https://git.libreoffice.org/core/commit/76ff5c9dc5a4525067da3de485ac9d0924ab6172

tdf#146704 sw: fix regression of endnote layout in sections

It will be available in 7.3.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 9 NISZ LibreOffice Team 2022-03-10 10:05:49 UTC
Verified in:
Version: 7.4.0.0.alpha0+ (x64) / LibreOffice Community
Build ID: 6adabd915d931b845fcf2fef15fbf3fca14ec9b3
CPU threads: 4; OS: Windows 10.0 Build 18363; UI render: Skia/Raster; VCL: win
Locale: hu-HU (hu_HU); UI: en-US
Calc: threaded