[Libreoffice-commits] core.git: sw/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Fri Dec 28 06:00:10 UTC 2018


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

New commits:
commit 134be7f810d9d3878f6ed03fe4ef675351f8e7c3
Author:     Justin Luth <justin_luth at sil.org>
AuthorDate: Thu Dec 27 19:08:34 2018 +0300
Commit:     Justin Luth <justin_luth at sil.org>
CommitDate: Fri Dec 28 06:59:48 2018 +0100

    NFC sw flowfrm HasParaSpaceAtPages: simplify logic.
    
    double negatives with an AND; that really confuses me.
    Simply with an equivalent function.
    There are two reasons to Use the upper value:
    -it is the first one (no prev)
    -or there is a pagebreak.
    
    is much easier to understand than
    
    Use the upper value unless
    -there is a previous frame
    -and this one doesn't have a pagebreak.
    
    (I can't even review this commit message without getting confused
    by the original logic.)
    
    Change-Id: Iddfbe63b0abcb11f96e323e8a28d0ed335c09133
    Reviewed-on: https://gerrit.libreoffice.org/65647
    Tested-by: Justin Luth <justin_luth at sil.org>
    Reviewed-by: Justin Luth <justin_luth at sil.org>

diff --git a/sw/source/core/layout/flowfrm.cxx b/sw/source/core/layout/flowfrm.cxx
index 5e3db880b044..405cfcd0d16d 100644
--- a/sw/source/core/layout/flowfrm.cxx
+++ b/sw/source/core/layout/flowfrm.cxx
@@ -1247,7 +1247,7 @@ bool SwFlowFrame::HasParaSpaceAtPages( bool bSct ) const
                 ( pTmp->IsFootnoteFrame() && !static_cast<const SwFootnoteFrame*>(pTmp)->GetMaster() ) )
                 return true;
             if( pTmp->IsPageFrame() )
-                return !( pTmp->GetPrev() && !IsPageBreak(true) );
+                return !pTmp->GetPrev() || IsPageBreak(true);
             if( pTmp->IsColumnFrame() && pTmp->GetPrev() )
                 return IsColBreak( true );
             if( pTmp->IsSctFrame() && ( !bSct || pTmp->GetPrev() ) )


More information about the Libreoffice-commits mailing list