summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2020-08-13 19:30:48 +0100
committerCaolán McNamara <caolanm@redhat.com>2020-08-14 12:17:25 +0200
commit1668111a2969201d17c75d0e8c7a8e47e0c7d01c (patch)
tree82795c8c34b86d7e381958271d13ccca62f9de83 /sw
parent7c67a8f4e837669ea23d1bc98e3d6fb78025066f (diff)
rework this to make it more readable
no logic change intended Change-Id: I755de2e37bec3843500920476fc23f013103f976 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100685 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sw')
-rw-r--r--sw/source/core/draw/dcontact.cxx16
1 files changed, 11 insertions, 5 deletions
diff --git a/sw/source/core/draw/dcontact.cxx b/sw/source/core/draw/dcontact.cxx
index 028e6b3df807..5384426f6e61 100644
--- a/sw/source/core/draw/dcontact.cxx
+++ b/sw/source/core/draw/dcontact.cxx
@@ -1831,14 +1831,20 @@ void SwDrawContact::ConnectToLayout( const SwFormatAnchor* pAnch )
{
// append drawing object, if
// (1) proposed anchor frame isn't a follow and
+ const bool bFollow = pFrame->IsContentFrame() && static_cast<SwContentFrame*>(pFrame)->IsFollow();
+ if (bFollow)
+ continue;
+
// (2) drawing object isn't a control object to be anchored
// in header/footer.
- bool bAdd = ( !pFrame->IsContentFrame() ||
- !static_cast<SwContentFrame*>(pFrame)->IsFollow() ) &&
- ( !::CheckControlLayer( GetMaster() ) ||
- !pFrame->FindFooterOrHeader() );
+ const bool bControlInHF = ::CheckControlLayer(GetMaster()) && pFrame->FindFooterOrHeader();
+ if (bControlInHF)
+ continue;
- if (bAdd && RndStdIds::FLY_AT_FLY != pAnch->GetAnchorId())
+ bool bAdd;
+ if (RndStdIds::FLY_AT_FLY == pAnch->GetAnchorId())
+ bAdd = true;
+ else
{
assert(pFrame->IsTextFrame());
bAdd = IsAnchoredObjShown(*static_cast<SwTextFrame*>(pFrame), *pAnch);