[Libreoffice-commits] core.git: Branch 'libreoffice-5-1' - sw/source

Caolán McNamara caolanm at redhat.com
Mon Apr 18 09:45:51 UTC 2016


 sw/source/core/layout/sectfrm.cxx |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

New commits:
commit 3a91536cdaae48cfd1eb82fe2ffd1cf2bed3dcb7
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Mar 7 12:16:28 2016 +0000

    Resolves: tdf#96172 crashtesting: avoid crash in layout
    
    sectfrm is riddled with workarounds for "half dead"
    section frames. This is yet another one.
    
    Change-Id: Ic03ad8971002d7dce308475f1497d1dda8045d15
    Cherry-picked from 727ebae15e623660b9cc6f8db0e7558830bf920d
    Reviewed-on: https://gerrit.libreoffice.org/24154
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/sw/source/core/layout/sectfrm.cxx b/sw/source/core/layout/sectfrm.cxx
index c9bf717..4b906b3 100644
--- a/sw/source/core/layout/sectfrm.cxx
+++ b/sw/source/core/layout/sectfrm.cxx
@@ -1575,7 +1575,7 @@ SwLayoutFrame *SwFrame::GetNextSctLeaf( MakePageType eMakePage )
         // We have found the suitable layout sheet. If there (in the sheet) is
         // already a Follow of our section, we take its first layout sheet,
         // otherwise it is time to create a section follow
-        SwSectionFrame* pNew;
+        SwSectionFrame* pNew = nullptr;
 
         // This can be omitted if existing Follows were cut short
         SwFrame* pFirst = pLayLeaf->Lower();
@@ -1586,7 +1586,7 @@ SwLayoutFrame *SwFrame::GetNextSctLeaf( MakePageType eMakePage )
             pNew = pSect->GetFollow();
         else if( MAKEPAGE_NOSECTION == eMakePage )
             return pLayLeaf;
-        else
+        else if (pSect->GetSection())
         {
             pNew = new SwSectionFrame( *pSect, false );
             pNew->InsertBefore( pLayLeaf, pLayLeaf->Lower() );
@@ -1641,7 +1641,7 @@ SwLayoutFrame *SwFrame::GetNextSctLeaf( MakePageType eMakePage )
                 pNew->SimpleFormat();
         }
         // The wanted layout sheet is now the first of the determined SctFrames:
-        pLayLeaf = FIRSTLEAF( pNew );
+        pLayLeaf = pNew ? FIRSTLEAF(pNew) : nullptr;
     }
     return pLayLeaf;
 }


More information about the Libreoffice-commits mailing list