Blob Blame History Raw
From 4c36086e3a8b546d906e0dd9f0472abd7013852e Mon Sep 17 00:00:00 2001
From: Michael Stahl <mstahl@redhat.com>
Date: Mon, 13 Feb 2012 18:36:28 +0100
Subject: [PATCH 3/3] fdo#41712: sw: remove superfluous flag:
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

This removes SwFlowFrm::bIsFollow, which is pointless duplication of
m_pPrecede; this fixes lots of assertions (probably some real problem as
well).

Signed-off-by: C├ędric Bosdonnat <cedric.bosdonnat.ooo@free.fr>
---
 sw/source/core/frmedt/tblsel.cxx   |    2 +-
 sw/source/core/inc/flowfrm.hxx     |    4 +---
 sw/source/core/layout/flowfrm.cxx  |    2 +-
 sw/source/core/layout/laycache.cxx |    1 -
 sw/source/core/layout/sectfrm.cxx  |    9 ---------
 sw/source/core/layout/ssfrm.cxx    |    3 ---
 sw/source/core/layout/tabfrm.cxx   |    1 -
 sw/source/core/text/frmform.cxx    |    1 -
 8 files changed, 3 insertions(+), 20 deletions(-)

diff --git a/sw/source/core/frmedt/tblsel.cxx b/sw/source/core/frmedt/tblsel.cxx
index 34fd69d..4397073 100644
--- a/sw/source/core/frmedt/tblsel.cxx
+++ b/sw/source/core/frmedt/tblsel.cxx
@@ -2250,7 +2250,7 @@ void _FndBox::SetTableLines( const SwTable &rTable )
 
 inline void UnsetFollow( SwFlowFrm *pTab )
 {
-    pTab->bIsFollow = sal_False;
+    pTab->m_pPrecede = 0;
 }
 
 void _FndBox::DelFrms( SwTable &rTable )
diff --git a/sw/source/core/inc/flowfrm.hxx b/sw/source/core/inc/flowfrm.hxx
index 9617988..8facb39 100644
--- a/sw/source/core/inc/flowfrm.hxx
+++ b/sw/source/core/inc/flowfrm.hxx
@@ -117,7 +117,6 @@ protected:
     SwFlowFrm *m_pFollow;
     SwFlowFrm *m_pPrecede;
 
-    sal_Bool bIsFollow	:1;	//Ist's ein Follow
     sal_Bool bLockJoin	:1;	//Join (und damit deleten) verboten wenn sal_True!
     sal_Bool bUndersized:1; // wir sind kleiner als gewuenscht
     sal_Bool bFtnAtEnd	:1; // For sectionfrms only: footnotes at the end of section
@@ -168,8 +167,7 @@ public:
     void MoveSubTree( SwLayoutFrm* pParent, SwFrm* pSibling = 0 );
 
            sal_Bool 	  HasFollow() const    { return m_pFollow ? sal_True : sal_False; }
-           sal_Bool		  IsFollow()     const { return bIsFollow; }
-    inline void		  _SetIsFollow( sal_Bool bSet ) { bIsFollow = bSet; }
+           sal_Bool		  IsFollow()     const { return 0 != m_pPrecede; }
     const  SwFlowFrm *GetFollow() const	   { return m_pFollow;   }
            SwFlowFrm *GetFollow()	   	   { return m_pFollow;   }
            sal_Bool  	  IsAnFollow( const SwFlowFrm *pFlow ) const;
diff --git a/sw/source/core/layout/flowfrm.cxx b/sw/source/core/layout/flowfrm.cxx
index c5e083f..5b4a588 100644
--- a/sw/source/core/layout/flowfrm.cxx
+++ b/sw/source/core/layout/flowfrm.cxx
@@ -84,7 +84,7 @@ SwFlowFrm::SwFlowFrm( SwFrm &rFrm ) :
     m_pFollow( 0 ),
     m_pPrecede( 0 )
 {
-    bLockJoin = bIsFollow = bCntntLock = bOwnFtnNum =
+    bLockJoin = bCntntLock = bOwnFtnNum =
         bFtnLock = bFlyLock = sal_False;
 }
 
diff --git a/sw/source/core/layout/laycache.cxx b/sw/source/core/layout/laycache.cxx
index 850e38b..61b40ce 100644
--- a/sw/source/core/layout/laycache.cxx
+++ b/sw/source/core/layout/laycache.cxx
@@ -934,7 +934,6 @@ sal_Bool SwLayHelper::CheckInsert( sal_uLong nNodeIndex )
                         {
                             SwTxtFrm *pNew = new SwTxtFrm( ((SwTxtFrm*)rpFrm)->
                                                             GetTxtNode(), rpFrm );
-                            pNew->_SetIsFollow( sal_True );
                             pNew->ManipOfst( nOfst );
                             pNew->SetFollow( ((SwTxtFrm*)rpFrm)->GetFollow() );
                             ((SwTxtFrm*)rpFrm)->SetFollow( pNew );
diff --git a/sw/source/core/layout/sectfrm.cxx b/sw/source/core/layout/sectfrm.cxx
index eee5a68..60e6d2d 100644
--- a/sw/source/core/layout/sectfrm.cxx
+++ b/sw/source/core/layout/sectfrm.cxx
@@ -102,15 +102,11 @@ SwSectionFrm::SwSectionFrm( SwSectionFrm &rSect, sal_Bool bMaster ) :
         {
             SwSectionFrm* pMaster = rSect.FindMaster();
             pMaster->SetFollow( this );
-            bIsFollow = sal_True;
         }
-        else
-            rSect.bIsFollow = sal_True;
         SetFollow( &rSect );
     }
     else
     {
-        bIsFollow = sal_True;
         SetFollow( rSect.GetFollow() );
         rSect.SetFollow( this );
         if( !GetFollow() )
@@ -171,7 +167,6 @@ SwSectionFrm::~SwSectionFrm()
         else if( HasFollow() )
         {
             PROTOCOL( this, PROT_SECTION, ACT_DEL_MASTER, GetFollow() )
-            GetFollow()->bIsFollow = sal_False;
         }
     }
 }
@@ -219,10 +214,7 @@ void SwSectionFrm::DelEmpty( sal_Bool bRemove )
         // freigeben, deshalb wird die Size des Masters invalidiert.
         if( !GetFollow() && !pMaster->IsColLocked() )
             pMaster->InvalidateSize();
-        bIsFollow = sal_False;
     }
-    else if( HasFollow() )
-        GetFollow()->bIsFollow = sal_False;
     SetFollow(0);
     if( pUp )
     {
@@ -506,7 +498,6 @@ void SwSectionFrm::MergeNext( SwSectionFrm* pNxt )
         }
         SetFollow( pNxt->GetFollow() );
         pNxt->SetFollow( NULL );
-        pNxt->bIsFollow = sal_False;
         pNxt->Cut();
         delete pNxt;
         InvalidateSize();
diff --git a/sw/source/core/layout/ssfrm.cxx b/sw/source/core/layout/ssfrm.cxx
index b2dc389..6ac8bc7 100644
--- a/sw/source/core/layout/ssfrm.cxx
+++ b/sw/source/core/layout/ssfrm.cxx
@@ -523,13 +523,10 @@ void SwCntntFrm::DelFrms( const SwCntntNode& rNode )
             }
         }
         // <--
-        if( pFrm->HasFollow() )
-            pFrm->GetFollow()->_SetIsFollow( pFrm->IsFollow() );
         if( pFrm->IsFollow() )
         {
             SwCntntFrm* pMaster = (SwTxtFrm*)pFrm->FindMaster();
             pMaster->SetFollow( pFrm->GetFollow() );
-            pFrm->_SetIsFollow( sal_False );
         }
         pFrm->SetFollow( 0 );//Damit er nicht auf dumme Gedanken kommt.
                                 //Andernfalls kann es sein, dass ein Follow
diff --git a/sw/source/core/layout/tabfrm.cxx b/sw/source/core/layout/tabfrm.cxx
index aaa73ca..d8a2a02 100644
--- a/sw/source/core/layout/tabfrm.cxx
+++ b/sw/source/core/layout/tabfrm.cxx
@@ -124,7 +124,6 @@ SwTabFrm::SwTabFrm( SwTabFrm &rTab ) :
     SwFlowFrm( (SwFrm&)*this ),
     pTable( rTab.GetTable() )
 {
-    bIsFollow = sal_True;
     bLockJoin = bComplete = bONECalcLowers = bCalcLowers = bLowersFormatted = bLockBackMove =
     bResizeHTMLTable = bHasFollowFlowLine = bIsRebuildLastLine =
     bRestrictTableGrowth = bRemoveFollowFlowLinePending = sal_False;
diff --git a/sw/source/core/text/frmform.cxx b/sw/source/core/text/frmform.cxx
index 464eab7..dd5495f 100644
--- a/sw/source/core/text/frmform.cxx
+++ b/sw/source/core/text/frmform.cxx
@@ -701,7 +701,6 @@ SwCntntFrm *SwTxtFrm::SplitFrm( const xub_StrLen nTxtPos )
     // Damit meine Daten nicht verschwinden, locke ich mich.
     SwTxtFrmLocker aLock( this );
     SwTxtFrm *pNew = (SwTxtFrm *)(GetTxtNode()->MakeFrm( this ));
-    pNew->bIsFollow = sal_True;
 
     pNew->SetFollow( GetFollow() );
     SetFollow( pNew );
-- 
1.7.7.6