sw/source/core/draw/dcontact.cxx |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

New commits:
commit 6e0c7591ab86a893be85087d3caee0328e9411dd
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Thu Aug 13 19:39:40 2020 +0100
Commit:     Caolán McNamara <caol...@redhat.com>
CommitDate: Thu Aug 20 15:43:56 2020 +0200

    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 <caol...@redhat.com>

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;
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to