summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2020-08-13 19:39:40 +0100
committerCaolán McNamara <caolanm@redhat.com>2020-08-20 15:43:56 +0200
commit6e0c7591ab86a893be85087d3caee0328e9411dd (patch)
treea35dd07bd1d8bb99bf607a1a515957499fd8dcd3
parent5884f85ace3ea1b90c314f46e3f2aeadc247ffa1 (diff)
tdf#129542 the control is already anchored to header/footer content
DisconnectFromLayout has unset its old anchor, if we don't insert it somewhere then its old anchor is null and we crash eventually. Seeing as we're already anchored into header/footer content, albeit only in the first view of a header/footer, then allow reconnecting to layout in that mode Change-Id: I0be4d167ee7d7b932318a1318954bed0da3a4fc0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100686 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r--sw/source/core/draw/dcontact.cxx6
1 files changed, 4 insertions, 2 deletions
diff --git a/sw/source/core/draw/dcontact.cxx b/sw/source/core/draw/dcontact.cxx
index 5384426f6e61..0b6fffab9057 100644
--- a/sw/source/core/draw/dcontact.cxx
+++ b/sw/source/core/draw/dcontact.cxx
@@ -1830,7 +1830,7 @@ void SwDrawContact::ConnectToLayout( const SwFormatAnchor* pAnch )
for( SwFrame *pFrame = aIter.First(); pFrame; pFrame = aIter.Next() )
{
// append drawing object, if
- // (1) proposed anchor frame isn't a follow and
+ // (1) proposed anchor frame isn't a follow and...
const bool bFollow = pFrame->IsContentFrame() && static_cast<SwContentFrame*>(pFrame)->IsFollow();
if (bFollow)
continue;
@@ -1838,7 +1838,9 @@ void SwDrawContact::ConnectToLayout( const SwFormatAnchor* pAnch )
// (2) drawing object isn't a control object to be anchored
// in header/footer.
const bool bControlInHF = ::CheckControlLayer(GetMaster()) && pFrame->FindFooterOrHeader();
- if (bControlInHF)
+ // tdf#129542 but make an exception for control objects so they can get added to just the first frame,
+ // the Master Anchor Frame and not the others
+ if (bControlInHF && pAnchorFrameOfMaster)
continue;
bool bAdd;