From b624b13b3d5a8e573c7de8158cadc66b1982d157 Mon Sep 17 00:00:00 2001 From: Noel Date: Fri, 26 Mar 2021 13:35:54 +0200 Subject: loplugin:flatten Change-Id: Ib7a895fba66f8dc9b6501e61631c02694053b7fc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113157 Tested-by: Jenkins Reviewed-by: Noel Grandin --- sw/source/core/layout/fly.cxx | 26 ++++++++++++------------- sw/source/core/layout/objectformattertxtfrm.cxx | 22 ++++++++++----------- sw/source/core/layout/pagechg.cxx | 26 ++++++++++++------------- sw/source/core/layout/sectfrm.cxx | 26 ++++++++++++------------- sw/source/core/layout/tabfrm.cxx | 26 ++++++++++++------------- sw/source/core/layout/wsfrm.cxx | 26 ++++++++++++------------- 6 files changed, 76 insertions(+), 76 deletions(-) (limited to 'sw/source/core/layout') diff --git a/sw/source/core/layout/fly.cxx b/sw/source/core/layout/fly.cxx index ceb9a65a38a9..6dcf1b756ed4 100644 --- a/sw/source/core/layout/fly.cxx +++ b/sw/source/core/layout/fly.cxx @@ -1048,20 +1048,20 @@ void SwFlyFrame::UpdateAttr_( const SfxPoolItem *pOld, const SfxPoolItem *pNew, default: bClear = false; } - if ( bClear ) + if ( !bClear ) + return; + + if ( pOldSet || pNewSet ) { - if ( pOldSet || pNewSet ) - { - if ( pOldSet ) - pOldSet->ClearItem( nWhich ); - if ( pNewSet ) - pNewSet->ClearItem( nWhich ); - } - else - { - SwModify aMod; - SwLayoutFrame::SwClientNotify(aMod, sw::LegacyModifyHint(pOld, pNew)); - } + if ( pOldSet ) + pOldSet->ClearItem( nWhich ); + if ( pNewSet ) + pNewSet->ClearItem( nWhich ); + } + else + { + SwModify aMod; + SwLayoutFrame::SwClientNotify(aMod, sw::LegacyModifyHint(pOld, pNew)); } } diff --git a/sw/source/core/layout/objectformattertxtfrm.cxx b/sw/source/core/layout/objectformattertxtfrm.cxx index 1ea4a63fb56c..1036ea3f05c3 100644 --- a/sw/source/core/layout/objectformattertxtfrm.cxx +++ b/sw/source/core/layout/objectformattertxtfrm.cxx @@ -639,20 +639,20 @@ static void CleanupEmptyFootnoteFrame(SwFrame* pLowerFrame) // but now we have to clean up empty footnote frames to prevent crashes. // Note: check it at this level, not lower: both container and footnote // can be deleted at the same time! - if (pLowerFrame->IsFootnoteContFrame()) + if (!pLowerFrame->IsFootnoteContFrame()) + return; + + for (SwFrame * pFootnote = pLowerFrame->GetLower(); pFootnote; ) { - for (SwFrame * pFootnote = pLowerFrame->GetLower(); pFootnote; ) + assert(pFootnote->IsFootnoteFrame()); + SwFrame *const pNextNote = pFootnote->GetNext(); + if (!pFootnote->IsDeleteForbidden() && !pFootnote->GetLower() && !pFootnote->IsColLocked() && + !static_cast(pFootnote)->IsBackMoveLocked()) { - assert(pFootnote->IsFootnoteFrame()); - SwFrame *const pNextNote = pFootnote->GetNext(); - if (!pFootnote->IsDeleteForbidden() && !pFootnote->GetLower() && !pFootnote->IsColLocked() && - !static_cast(pFootnote)->IsBackMoveLocked()) - { - pFootnote->Cut(); - SwFrame::DestroyFrame(pFootnote); - } - pFootnote = pNextNote; + pFootnote->Cut(); + SwFrame::DestroyFrame(pFootnote); } + pFootnote = pNextNote; } } diff --git a/sw/source/core/layout/pagechg.cxx b/sw/source/core/layout/pagechg.cxx index 1bc8d05a8167..76ffb60c89a2 100644 --- a/sw/source/core/layout/pagechg.cxx +++ b/sw/source/core/layout/pagechg.cxx @@ -698,20 +698,20 @@ void SwPageFrame::UpdateAttr_( const SfxPoolItem *pOld, const SfxPoolItem *pNew, default: bClear = false; } - if ( bClear ) + if ( !bClear ) + return; + + if ( pOldSet || pNewSet ) { - if ( pOldSet || pNewSet ) - { - if ( pOldSet ) - pOldSet->ClearItem( nWhich ); - if ( pNewSet ) - pNewSet->ClearItem( nWhich ); - } - else - { - SwModify aMod; - SwLayoutFrame::SwClientNotify(aMod, sw::LegacyModifyHint(pOld, pNew)); - } + if ( pOldSet ) + pOldSet->ClearItem( nWhich ); + if ( pNewSet ) + pNewSet->ClearItem( nWhich ); + } + else + { + SwModify aMod; + SwLayoutFrame::SwClientNotify(aMod, sw::LegacyModifyHint(pOld, pNew)); } } diff --git a/sw/source/core/layout/sectfrm.cxx b/sw/source/core/layout/sectfrm.cxx index 0de0d2a5f296..7f738bbc3d5e 100644 --- a/sw/source/core/layout/sectfrm.cxx +++ b/sw/source/core/layout/sectfrm.cxx @@ -2715,20 +2715,20 @@ void SwSectionFrame::UpdateAttr_( const SfxPoolItem *pOld, const SfxPoolItem *pN default: bClear = false; } - if ( bClear ) + if ( !bClear ) + return; + + if ( pOldSet || pNewSet ) { - if ( pOldSet || pNewSet ) - { - if ( pOldSet ) - pOldSet->ClearItem( nWhich ); - if ( pNewSet ) - pNewSet->ClearItem( nWhich ); - } - else - { - SwModify aMod; - SwLayoutFrame::SwClientNotify(aMod, sw::LegacyModifyHint(pOld, pNew)); - } + if ( pOldSet ) + pOldSet->ClearItem( nWhich ); + if ( pNewSet ) + pNewSet->ClearItem( nWhich ); + } + else + { + SwModify aMod; + SwLayoutFrame::SwClientNotify(aMod, sw::LegacyModifyHint(pOld, pNew)); } } diff --git a/sw/source/core/layout/tabfrm.cxx b/sw/source/core/layout/tabfrm.cxx index bbfaf327c96c..af675d8bd8b8 100644 --- a/sw/source/core/layout/tabfrm.cxx +++ b/sw/source/core/layout/tabfrm.cxx @@ -3403,20 +3403,20 @@ void SwTabFrame::UpdateAttr_( const SfxPoolItem *pOld, const SfxPoolItem *pNew, default: bClear = false; } - if ( bClear ) + if ( !bClear ) + return; + + if ( pOldSet || pNewSet ) { - if ( pOldSet || pNewSet ) - { - if ( pOldSet ) - pOldSet->ClearItem( nWhich ); - if ( pNewSet ) - pNewSet->ClearItem( nWhich ); - } - else - { - SwModify aMod; - SwLayoutFrame::SwClientNotify(aMod, sw::LegacyModifyHint(pOld, pNew)); - } + if ( pOldSet ) + pOldSet->ClearItem( nWhich ); + if ( pNewSet ) + pNewSet->ClearItem( nWhich ); + } + else + { + SwModify aMod; + SwLayoutFrame::SwClientNotify(aMod, sw::LegacyModifyHint(pOld, pNew)); } } diff --git a/sw/source/core/layout/wsfrm.cxx b/sw/source/core/layout/wsfrm.cxx index 10434529b67e..fccf94925187 100644 --- a/sw/source/core/layout/wsfrm.cxx +++ b/sw/source/core/layout/wsfrm.cxx @@ -2538,20 +2538,20 @@ void SwContentFrame::UpdateAttr_( const SfxPoolItem* pOld, const SfxPoolItem* pN default: bClear = false; } - if ( bClear ) + if ( !bClear ) + return; + + if ( pOldSet || pNewSet ) { - if ( pOldSet || pNewSet ) - { - if ( pOldSet ) - pOldSet->ClearItem( nWhich ); - if ( pNewSet ) - pNewSet->ClearItem( nWhich ); - } - else - { - SwModify aMod; - SwFrame::SwClientNotify(aMod, sw::LegacyModifyHint(pOld, pNew)); - } + if ( pOldSet ) + pOldSet->ClearItem( nWhich ); + if ( pNewSet ) + pNewSet->ClearItem( nWhich ); + } + else + { + SwModify aMod; + SwFrame::SwClientNotify(aMod, sw::LegacyModifyHint(pOld, pNew)); } } -- cgit