summaryrefslogtreecommitdiff
path: root/sw/source/core/layout
diff options
context:
space:
mode:
authorNoel <noel.grandin@collabora.co.uk>2021-03-26 13:35:54 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-03-26 18:02:19 +0100
commitb624b13b3d5a8e573c7de8158cadc66b1982d157 (patch)
tree56948e6a5e8d7f5a7cbde6328a27f13ecd8a72bc /sw/source/core/layout
parent8136620ff432bf17815bef1f88c7531edb839d23 (diff)
loplugin:flatten
Change-Id: Ib7a895fba66f8dc9b6501e61631c02694053b7fc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113157 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw/source/core/layout')
-rw-r--r--sw/source/core/layout/fly.cxx26
-rw-r--r--sw/source/core/layout/objectformattertxtfrm.cxx22
-rw-r--r--sw/source/core/layout/pagechg.cxx26
-rw-r--r--sw/source/core/layout/sectfrm.cxx26
-rw-r--r--sw/source/core/layout/tabfrm.cxx26
-rw-r--r--sw/source/core/layout/wsfrm.cxx26
6 files changed, 76 insertions, 76 deletions
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<SwFootnoteFrame*>(pFootnote)->IsBackMoveLocked())
{
- assert(pFootnote->IsFootnoteFrame());
- SwFrame *const pNextNote = pFootnote->GetNext();
- if (!pFootnote->IsDeleteForbidden() && !pFootnote->GetLower() && !pFootnote->IsColLocked() &&
- !static_cast<SwFootnoteFrame*>(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));
}
}