sw/source/core/text/porfld.cxx |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 6edb6d2b34eb48d0db6d568fd22929eb1e5fa98e
Author:     Michael Stahl <michael.st...@allotropia.de>
AuthorDate: Thu Apr 13 14:21:29 2023 +0200
Commit:     Michael Stahl <michael.st...@allotropia.de>
CommitDate: Fri Apr 14 20:10:49 2023 +0200

    sw: fix crashtesting assert on tdf56085-1.odt
    
    ustring.hxx:860: sal_Unicode rtl::OUString::operator[](sal_Int32)
    
    in SwTextFormatter::BuildPortions, itrform2.cxx:529
    
    The follow flag was erroneously not set, here the situation is that
    the current line is full and the field moves to the next line and that's
    why this SwFieldPortion is empty and will be deleted but it was a follow
    itself so its follow is a follow too.
    
    (regression from commit e006c6ce7502f47889034b98cb0795e78ea36094)
    
    Change-Id: I35350c7dc9a5aa249af53bac724cdd270d12b99b
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150415
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <michael.st...@allotropia.de>

diff --git a/sw/source/core/text/porfld.cxx b/sw/source/core/text/porfld.cxx
index c26bc9596585..1ef148b20a40 100644
--- a/sw/source/core/text/porfld.cxx
+++ b/sw/source/core/text/porfld.cxx
@@ -419,7 +419,7 @@ bool SwFieldPortion::Format( SwTextFormatInfo &rInf )
             {
                 pField->SetFont( std::make_unique<SwFont>( *rInf.GetFont() ) );
             }
-            if (Compress())
+            if (IsFollow() || Compress())
             {   // empty this will be deleted in SwLineLayout::CalcLine()
                 // anyway so make sure pField doesn't have a stale flag
                 pField->SetFollow( true );

Reply via email to