summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2022-03-30 19:55:20 +0100
committerCaolán McNamara <caolanm@redhat.com>2022-03-30 22:18:04 +0200
commite10888cbb3bba4e0dff954566fd0f3721be3e5ab (patch)
tree3b53571b395d74735c8bc3735c67a815ee05fd06
parent6fee8f6da0c25ab3c5c7a84da45f1f79a19d4951 (diff)
unroll this typical writer-style multi condition if statement
no logic change intended Change-Id: Iebb8df604aa69829536e3cab10b33056e4cdf78e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132331 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r--sw/source/core/layout/pagechg.cxx12
1 files changed, 9 insertions, 3 deletions
diff --git a/sw/source/core/layout/pagechg.cxx b/sw/source/core/layout/pagechg.cxx
index 73a003223495..e09c1a265e2c 100644
--- a/sw/source/core/layout/pagechg.cxx
+++ b/sw/source/core/layout/pagechg.cxx
@@ -1339,13 +1339,19 @@ namespace
pPage->PreparePage( bFootnote );
// If the sibling has no body text, destroy it as long as it is no footnote page.
- if ( pSibling && !pSibling->IsFootnotePage() &&
- !pSibling->FindFirstBodyContent() &&
- (!pRefPage || !isDeleteForbidden(pSibling)) )
+ if (!pSibling)
+ return true;
+ if (pSibling->IsFootnotePage())
+ return true;
+ if (pSibling->FindFirstBodyContent())
+ return true;
+
+ if (!pRefPage || !isDeleteForbidden(pSibling))
{
pRoot->RemovePage( pRefSibling, SwRemoveResult::Next ) ;
return false;
}
+
return true;
}
}