summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2011-09-08 11:07:51 +0200
committerStephan Bergmann <sbergman@redhat.com>2011-09-08 11:11:18 +0200
commitb66db1c73f494e74a8bf6c94544eccc01095528e (patch)
treefb9cbd185ed3db3eb5b3ad6488cd86e8a9e7ca00 /sw
parentb92890a5d8162cc59793589c4c98de59b2cb53a7 (diff)
Cleanup of SwFlowFrm flags.
bUndersized was used uninitialized in derived SwFlowFrm, as valgrinding sw/qa/unoapi revealed.
Diffstat (limited to 'sw')
-rw-r--r--sw/source/core/inc/flowfrm.hxx15
-rw-r--r--sw/source/core/inc/sectfrm.hxx18
-rw-r--r--sw/source/core/inc/txtfrm.hxx2
-rw-r--r--sw/source/core/layout/flowfrm.cxx11
-rw-r--r--sw/source/core/layout/sectfrm.cxx10
-rw-r--r--sw/source/core/layout/tabfrm.cxx2
-rw-r--r--sw/source/core/text/txtfrm.cxx49
7 files changed, 54 insertions, 53 deletions
diff --git a/sw/source/core/inc/flowfrm.hxx b/sw/source/core/inc/flowfrm.hxx
index 2eb36f59b5f1..e1c47c2db351 100644
--- a/sw/source/core/inc/flowfrm.hxx
+++ b/sw/source/core/inc/flowfrm.hxx
@@ -120,11 +120,6 @@ protected:
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
- sal_Bool bEndnAtEnd :1; // " " " : endnotes at the end of section
- sal_Bool bCntntLock :1; // " " " : content locked
- sal_Bool bOwnFtnNum :1; // " " " : special numbering of footnotes
- sal_Bool bFtnLock :1; // " " " : ftn, don't leave this section bwd
sal_Bool bFlyLock :1; // Stop positioning of at-character flyframes
//Prueft ob Vorwaertsfluss noch Sinn macht Endloswanderschaften (unterbinden)
@@ -180,10 +175,6 @@ public:
sal_Bool IsJoinLocked() const { return bLockJoin; }
sal_Bool IsAnyJoinLocked() const { return bLockJoin || HasLockedFollow(); }
- sal_Bool IsFtnAtEnd() const { return bFtnAtEnd; }
- sal_Bool IsEndnAtEnd() const { return bEndnAtEnd; }
- sal_Bool IsAnyNoteAtEnd() const { return bFtnAtEnd || bEndnAtEnd; }
- sal_Bool AreNotesAtEnd() const { return bFtnAtEnd && bEndnAtEnd; }
sal_Bool IsPageBreak( sal_Bool bAct ) const;
sal_Bool IsColBreak( sal_Bool bAct ) const;
@@ -234,14 +225,8 @@ public:
void CheckKeep();
- void SetFtnLock( sal_Bool bNew ){ bFtnLock = bNew; }
- sal_Bool IsFtnLock() const { return bFtnLock; }
void SetFlyLock( sal_Bool bNew ){ bFlyLock = bNew; }
sal_Bool IsFlyLock() const { return bFlyLock; }
- void SetOwnFtnNum( sal_Bool bNew ){ bOwnFtnNum = bNew; }
- sal_Bool IsOwnFtnNum() const { return bOwnFtnNum; }
- void SetCntntLock( sal_Bool bNew ){ bCntntLock = bNew; }
- sal_Bool IsCntntLocked() const { return bCntntLock; }
//casten einen Frm auf einen FlowFrm - wenns denn einer ist, sonst 0
//Diese Methoden muessen fuer neue Ableitungen geaendert werden!
diff --git a/sw/source/core/inc/sectfrm.hxx b/sw/source/core/inc/sectfrm.hxx
index b8215887a19a..73a9e1f0efb7 100644
--- a/sw/source/core/inc/sectfrm.hxx
+++ b/sw/source/core/inc/sectfrm.hxx
@@ -45,6 +45,11 @@ class SwLayouter;
class SwSectionFrm: public SwLayoutFrm, public SwFlowFrm
{
SwSection* pSection;
+ bool bFtnAtEnd: 1; // footnotes at the end of section
+ bool bEndnAtEnd: 1; // endnotes at the end of section
+ bool bCntntLock: 1; // content locked
+ bool bOwnFtnNum: 1; // special numbering of footnotes
+ bool bFtnLock: 1; // ftn, don't leave this section bwd
void _UpdateAttr( const SfxPoolItem*, const SfxPoolItem*, sal_uInt8 &,
SwAttrSetChg *pa = 0, SwAttrSetChg *pb = 0 );
@@ -130,6 +135,19 @@ public:
virtual void dumpAsXmlAttributes(xmlTextWriterPtr writer);
+ bool IsFtnAtEnd() const { return bFtnAtEnd; }
+ bool IsEndnAtEnd() const { return bEndnAtEnd; }
+ bool IsAnyNoteAtEnd() const { return bFtnAtEnd || bEndnAtEnd; }
+ bool AreNotesAtEnd() const { return bFtnAtEnd && bEndnAtEnd; }
+
+ void SetCntntLock( bool bNew ) { bCntntLock = bNew; }
+ bool IsCntntLocked() const { return bCntntLock; }
+
+ bool IsOwnFtnNum() const { return bOwnFtnNum; }
+
+ void SetFtnLock( bool bNew ) { bFtnLock = bNew; }
+ bool IsFtnLock() const { return bFtnLock; }
+
DECL_FIXEDMEMPOOL_NEWDEL(SwSectionFrm)
};
diff --git a/sw/source/core/inc/txtfrm.hxx b/sw/source/core/inc/txtfrm.hxx
index 168d79188f2b..1d388e6587d9 100644
--- a/sw/source/core/inc/txtfrm.hxx
+++ b/sw/source/core/inc/txtfrm.hxx
@@ -108,8 +108,6 @@ class SwTxtFrm: public SwCntntFrm
//entsprechend dem Attribut ein.
void CalcLineSpace();
- void InitCtor(); // Wird in beiden Ctoren gerufen
-
// Wird nur in Format gerufen:
void AdjustFrm( const SwTwips nChgHeight, sal_Bool bHasToFit = sal_False );
diff --git a/sw/source/core/layout/flowfrm.cxx b/sw/source/core/layout/flowfrm.cxx
index af62c7859eb7..3ca26041d87c 100644
--- a/sw/source/core/layout/flowfrm.cxx
+++ b/sw/source/core/layout/flowfrm.cxx
@@ -82,11 +82,12 @@ sal_Bool SwFlowFrm::bMoveBwdJump = sal_False;
SwFlowFrm::SwFlowFrm( SwFrm &rFrm ) :
rThis( rFrm ),
pFollow( 0 ),
- pPrecede( 0 )
-{
- bLockJoin = bIsFollow = bCntntLock = bOwnFtnNum =
- bFtnLock = bFlyLock = sal_False;
-}
+ pPrecede( 0 ),
+ bIsFollow( false ),
+ bLockJoin( false ),
+ bUndersized( false ),
+ bFlyLock( false )
+{}
/*************************************************************************
diff --git a/sw/source/core/layout/sectfrm.cxx b/sw/source/core/layout/sectfrm.cxx
index 7347f0644d24..6879add25435 100644
--- a/sw/source/core/layout/sectfrm.cxx
+++ b/sw/source/core/layout/sectfrm.cxx
@@ -87,11 +87,13 @@ SwSectionFrm::SwSectionFrm( SwSection &rSect, SwFrm* pSib ) :
SwSectionFrm::SwSectionFrm( SwSectionFrm &rSect, sal_Bool bMaster ) :
SwLayoutFrm( rSect.GetFmt(), rSect.getRootFrm() ),
SwFlowFrm( (SwFrm&)*this ),
- pSection( rSect.GetSection() )
+ pSection( rSect.GetSection() ),
+ bFtnAtEnd( rSect.IsFtnAtEnd() ),
+ bEndnAtEnd( rSect.IsEndnAtEnd() ),
+ bCntntLock( false ),
+ bOwnFtnNum( false ),
+ bFtnLock( false )
{
- bFtnAtEnd = rSect.IsFtnAtEnd();
- bEndnAtEnd = rSect.IsEndnAtEnd();
- bLockJoin = sal_False;
nType = FRMC_SECTION;
PROTOCOL( this, PROT_SECTION, bMaster ? ACT_CREATE_MASTER : ACT_CREATE_FOLLOW, &rSect )
diff --git a/sw/source/core/layout/tabfrm.cxx b/sw/source/core/layout/tabfrm.cxx
index db2431015879..b139c59065f9 100644
--- a/sw/source/core/layout/tabfrm.cxx
+++ b/sw/source/core/layout/tabfrm.cxx
@@ -124,7 +124,7 @@ SwTabFrm::SwTabFrm( SwTabFrm &rTab ) :
pTable( rTab.GetTable() )
{
bIsFollow = sal_True;
- bLockJoin = bComplete = bONECalcLowers = bCalcLowers = bLowersFormatted = bLockBackMove =
+ bComplete = bONECalcLowers = bCalcLowers = bLowersFormatted = bLockBackMove =
bResizeHTMLTable = bHasFollowFlowLine = bIsRebuildLastLine =
bRestrictTableGrowth = bRemoveFollowFlowLinePending = sal_False;
// #i26945#
diff --git a/sw/source/core/text/txtfrm.cxx b/sw/source/core/text/txtfrm.cxx
index 9e4a23762f36..e29fbe7c0f45 100644
--- a/sw/source/core/text/txtfrm.cxx
+++ b/sw/source/core/text/txtfrm.cxx
@@ -365,37 +365,34 @@ void SwTxtFrm::Init()
}
/*************************************************************************
-|* SwTxtFrm::CTORen/DTOR
-|*************************************************************************/
-
-void SwTxtFrm::InitCtor()
-{
- nCacheIdx = MSHRT_MAX;
- nOfst = 0;
- nAllLines = 0;
- nThisLines = 0;
- mnFlyAnchorOfst = 0;
- mnFlyAnchorOfstNoWrap = 0;
- mnFtnLine = 0;
- // OD 2004-03-17 #i11860#
- mnHeightOfLastLine = 0;
- mnAdditionalFirstLineOffset = 0;
-
- nType = FRMC_TXT;
- bLocked = bFormatted = bWidow = bUndersized = bJustWidow =
- bEmpty = bInFtnConnect = bFtn = bRepaint = bBlinkPor =
- bFieldFollow = bHasAnimation = bIsSwapped = sal_False;
- // OD 14.03.2003 #i11760#
- mbFollowFormatAllowed = sal_True;
-}
-
-/*************************************************************************
* SwTxtFrm::SwTxtFrm()
*************************************************************************/
SwTxtFrm::SwTxtFrm(SwTxtNode * const pNode, SwFrm* pSib )
: SwCntntFrm( pNode, pSib )
+ , nAllLines( 0 )
+ , nThisLines( 0 )
+ , mnFlyAnchorOfst( 0 )
+ , mnFlyAnchorOfstNoWrap( 0 )
+ , mnFtnLine( 0 )
+ , mnHeightOfLastLine( 0 ) // OD 2004-03-17 #i11860#
+ , mnAdditionalFirstLineOffset( 0 )
+ , nOfst( 0 )
+ , nCacheIdx( MSHRT_MAX )
+ , bLocked( false )
+ , bFormatted( false )
+ , bWidow( false )
+ , bJustWidow( false )
+ , bEmpty( false )
+ , bInFtnConnect( false )
+ , bFtn( false )
+ , bRepaint( false )
+ , bBlinkPor( false )
+ , bFieldFollow( false )
+ , bHasAnimation( false )
+ , bIsSwapped( false )
+ , mbFollowFormatAllowed( true ) // OD 14.03.2003 #i11760#
{
- InitCtor();
+ nType = FRMC_TXT;
}
/*************************************************************************