tdf#125846 - Avoid deleting fly formats one by one

Avoid deleting fly formats one by one while the document is destroyed
since DeleteAndDestroyAll removes all fly formats at once in
SwDoc::~SwDoc afterwards.

Change-Id: Ie62ead75a3ba1cdfa47d072c329e8d9fec9387ac
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/211864
Reviewed-by: Andreas Heinisch <andreas.heinisch@yahoo.de>
Tested-by: Jenkins
This commit is contained in:
Andreas Heinisch
2026-10-06 16:13:28 +02:00
parent a60d879f81
commit a6c7e25105
+2 -1
View File
@@ -1259,7 +1259,8 @@ void SwTextNode::DestroyAttr( SwTextAttr* pAttr )
case RES_TXTATR_FLYCNT:
{
SwFrameFormat* pFormat = pAttr->GetFlyCnt().GetFrameFormat();
if( pFormat ) // set to 0 by Undo?
// tdf#125846 - avoid deleting fly formats one by one while the document is destroyed
if (pFormat && !rDoc.IsInDtor()) // set to 0 by Undo?
rDoc.getIDocumentLayoutAccess().DelLayoutFormat( pFormat );
}
break;