sw: layout: fix crash in SwSectionFrame::MakeAll()

sectfrm.cxx:854: Assertion `moveBackPos == &GetPrecede()->GetFrame()' failed.

Because the section has columns, and GetPrevSctLeaf() apparently returns
the body frame in a column.

(regression from commit c60ad7e0fb)

Change-Id: I16fcd7a42b24e54873cde0aa0087c7aa56b0a8e5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176738
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
This commit is contained in:
Michael Stahl
2024-11-21 12:01:13 +01:00
parent 73cb99d5ea
commit e8c5941401
+4
View File
@@ -846,6 +846,10 @@ void SwSectionFrame::MakeAll(vcl::RenderContext* pRenderContext)
// appropriately; then drop the temporary, if needed.
if (SwLayoutFrame* moveBackPos = GetPrevSctLeaf())
{
if (moveBackPos->IsColBodyFrame())
{
moveBackPos = moveBackPos->GetUpper()->GetUpper();
}
SwLayoutFrame* newUpper = moveBackPos;
SwFrame* newSibling = nullptr;
const bool temporaryMasterCreated = IsFollow();