[Libreoffice-commits] core.git: sw/source

Caolán McNamara caolanm at redhat.com
Fri May 8 08:57:16 PDT 2015


 sw/source/core/inc/frame.hxx       |    5 +++++
 sw/source/core/layout/calcmove.cxx |    2 ++
 sw/source/core/layout/wsfrm.cxx    |    1 +
 sw/source/core/text/frmform.cxx    |    2 ++
 4 files changed, 10 insertions(+)

New commits:
commit 068c4df48fd1d9f4c42864733b80e7cbd7f5d006
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri May 8 16:46:48 2015 +0100

    Resolves: ooo#119155 don't crash with odd content in footnotes
    
    hit it with a large and simple hammer
    
    Change-Id: Ib0e55ad64780efc7664ccd9a2684fbe7dba87498

diff --git a/sw/source/core/inc/frame.hxx b/sw/source/core/inc/frame.hxx
index bc729ca..165a94e 100644
--- a/sw/source/core/inc/frame.hxx
+++ b/sw/source/core/inc/frame.hxx
@@ -358,6 +358,7 @@ protected:
     bool mbColLocked     : 1;  // lock Grow/Shrink for column-wise section
                                   // or fly frames, will be set in Format
     bool m_isInDestroy : 1;
+    bool mbForbidDelete : 1;
 
     void ColLock()      { mbColLocked = true; }
     void ColUnlock()    { mbColLocked = false; }
@@ -808,6 +809,7 @@ public:
     bool IsProtected() const;
 
     bool IsColLocked()  const { return mbColLocked; }
+    bool IsDeleteForbidden()  const { return mbForbidDelete; }
 
     /// this is the only way to delete a SwFrm instance
     static void DestroyFrm(SwFrm *const pFrm);
@@ -858,6 +860,9 @@ public:
     void RegisterToFormat( SwFmt& rFmt );
     void ValidateThisAndAllLowers( const sal_uInt16 nStage );
 
+    void ForbidDelete()      { mbForbidDelete = true; }
+    void AllowDelete()    { mbForbidDelete = false; }
+
     //UUUU
     drawinglayer::attribute::SdrAllFillAttributesHelperPtr getSdrAllFillAttributesHelper() const;
     bool supportsFullDrawingLayerFillAttributeSet() const;
diff --git a/sw/source/core/layout/calcmove.cxx b/sw/source/core/layout/calcmove.cxx
index d808f5c..2a82263 100644
--- a/sw/source/core/layout/calcmove.cxx
+++ b/sw/source/core/layout/calcmove.cxx
@@ -1045,6 +1045,7 @@ void SwCntntFrm::MakeAll()
         return;
     }
 
+    ForbidDelete();
     LockJoin();
     long nFormatCount = 0;
     // - loop prevention
@@ -1674,6 +1675,7 @@ void SwCntntFrm::MakeAll()
     delete pSaveFtn;
 
     UnlockJoin();
+    AllowDelete();
     if ( bMovedFwd || bMovedBwd )
         pNotify->SetInvaKeep();
     // OD 2004-02-26 #i25029#
diff --git a/sw/source/core/layout/wsfrm.cxx b/sw/source/core/layout/wsfrm.cxx
index 57f81cc..caf63ca 100644
--- a/sw/source/core/layout/wsfrm.cxx
+++ b/sw/source/core/layout/wsfrm.cxx
@@ -78,6 +78,7 @@ SwFrm::SwFrm( SwModify *pMod, SwFrm* pSib ) :
     mbValidPos = mbValidPrtArea = mbValidSize = mbValidLineNum = mbRetouche =
     mbFixSize = mbColLocked = false;
     mbCompletePaint = mbInfInvalid = true;
+    mbForbidDelete = false;
 }
 
 const IDocumentDrawModelAccess* SwFrm::getIDocumentDrawModelAccess()
diff --git a/sw/source/core/text/frmform.cxx b/sw/source/core/text/frmform.cxx
index 3df7347..802a131 100644
--- a/sw/source/core/text/frmform.cxx
+++ b/sw/source/core/text/frmform.cxx
@@ -561,6 +561,8 @@ void SwTxtFrm::_AdjustFollow( SwTxtFormatter &rLine,
                 OSL_FAIL( "+SwTxtFrm::JoinFrm: Follow is locked." );
                 return;
             }
+            if (GetFollow()->IsDeleteForbidden())
+                return;
             JoinFrm();
         }
 


More information about the Libreoffice-commits mailing list