diff options
Diffstat (limited to 'sw/source/core/layout/findfrm.cxx')
-rw-r--r-- | sw/source/core/layout/findfrm.cxx | 98 |
1 files changed, 49 insertions, 49 deletions
diff --git a/sw/source/core/layout/findfrm.cxx b/sw/source/core/layout/findfrm.cxx index b3d8c4dfc494..13aad81eafaf 100644 --- a/sw/source/core/layout/findfrm.cxx +++ b/sw/source/core/layout/findfrm.cxx @@ -1230,44 +1230,44 @@ SwFrame *SwFrame::FindPrev_() void SwFrame::ImplInvalidateNextPos( bool bNoFootnote ) { SwFrame *pFrame = FindNext_(); - if ( nullptr != pFrame ) + if ( nullptr == pFrame ) + return; + + if( pFrame->IsSctFrame() ) { - if( pFrame->IsSctFrame() ) + while( pFrame && pFrame->IsSctFrame() ) { - while( pFrame && pFrame->IsSctFrame() ) + if( static_cast<SwSectionFrame*>(pFrame)->GetSection() ) { - if( static_cast<SwSectionFrame*>(pFrame)->GetSection() ) - { - SwFrame* pTmp = static_cast<SwSectionFrame*>(pFrame)->ContainsAny(); - if( pTmp ) - pTmp->InvalidatePos(); - else if( !bNoFootnote ) - static_cast<SwSectionFrame*>(pFrame)->InvalidateFootnotePos(); - if( !IsInSct() || FindSctFrame()->GetFollow() != pFrame ) - pFrame->InvalidatePos(); - return; - } - pFrame = pFrame->FindNext(); + SwFrame* pTmp = static_cast<SwSectionFrame*>(pFrame)->ContainsAny(); + if( pTmp ) + pTmp->InvalidatePos(); + else if( !bNoFootnote ) + static_cast<SwSectionFrame*>(pFrame)->InvalidateFootnotePos(); + if( !IsInSct() || FindSctFrame()->GetFollow() != pFrame ) + pFrame->InvalidatePos(); + return; } - if( pFrame ) + pFrame = pFrame->FindNext(); + } + if( pFrame ) + { + if ( pFrame->IsSctFrame()) { - if ( pFrame->IsSctFrame()) - { - // We need to invalidate the section's content so it gets - // the chance to flow to a different page. - SwFrame* pTmp = static_cast<SwSectionFrame*>(pFrame)->ContainsAny(); - if( pTmp ) - pTmp->InvalidatePos(); - if( !IsInSct() || FindSctFrame()->GetFollow() != pFrame ) - pFrame->InvalidatePos(); - } - else + // We need to invalidate the section's content so it gets + // the chance to flow to a different page. + SwFrame* pTmp = static_cast<SwSectionFrame*>(pFrame)->ContainsAny(); + if( pTmp ) + pTmp->InvalidatePos(); + if( !IsInSct() || FindSctFrame()->GetFollow() != pFrame ) pFrame->InvalidatePos(); } + else + pFrame->InvalidatePos(); } - else - pFrame->InvalidatePos(); } + else + pFrame->InvalidatePos(); } /** method to invalidate printing area of next frame @@ -1293,32 +1293,32 @@ void SwFrame::InvalidateNextPrtArea() } // Invalidate printing area of found next frame - if ( pNextFrame ) + if ( !pNextFrame ) + return; + + if ( pNextFrame->IsSctFrame() ) { - if ( pNextFrame->IsSctFrame() ) + // Invalidate printing area of found section frame, if + // (1) this text frame isn't in a section OR + // (2) found section frame isn't a follow of the section frame this + // text frame is in. + if ( !IsInSct() || FindSctFrame()->GetFollow() != pNextFrame ) { - // Invalidate printing area of found section frame, if - // (1) this text frame isn't in a section OR - // (2) found section frame isn't a follow of the section frame this - // text frame is in. - if ( !IsInSct() || FindSctFrame()->GetFollow() != pNextFrame ) - { - pNextFrame->InvalidatePrt(); - } - - // Invalidate printing area of first content in found section. - SwFrame* pFstContentOfSctFrame = - static_cast<SwSectionFrame*>(pNextFrame)->ContainsAny(); - if ( pFstContentOfSctFrame ) - { - pFstContentOfSctFrame->InvalidatePrt(); - } + pNextFrame->InvalidatePrt(); } - else + + // Invalidate printing area of first content in found section. + SwFrame* pFstContentOfSctFrame = + static_cast<SwSectionFrame*>(pNextFrame)->ContainsAny(); + if ( pFstContentOfSctFrame ) { - pNextFrame->InvalidatePrt(); + pFstContentOfSctFrame->InvalidatePrt(); } } + else + { + pNextFrame->InvalidatePrt(); + } } /// @returns true if the frame _directly_ sits in a section |