diff options
author | Michael Stahl <mstahl@redhat.com> | 2011-11-24 00:52:09 +0100 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2011-11-24 00:52:09 +0100 |
commit | ae64bf305155b40af138e490e524e34a74ba6ad7 (patch) | |
tree | a75ca6fa2a6736a0747debd760dfecb155a7c6ad | |
parent | 772063ba8ad6b18f609cdc7da02534c15b785965 (diff) |
sw: remove debug instance counting
There are various classes that in DBG_UTIL mode count their instances
with a global variable, and give each instance a unique serial number.
The purpose of this exercise is somewhat unclear to me.
This removes the instance counting from:
SwNumberTree, SwIndex, SwNodeIndex, SwNumRule
-rw-r--r-- | sw/inc/SwNumberTree.hxx | 17 | ||||
-rw-r--r-- | sw/inc/index.hxx | 5 | ||||
-rw-r--r-- | sw/inc/ndindex.hxx | 5 | ||||
-rw-r--r-- | sw/inc/numrule.hxx | 5 | ||||
-rw-r--r-- | sw/source/core/SwNumberTree/SwNumberTree.cxx | 24 | ||||
-rw-r--r-- | sw/source/core/bastyp/index.cxx | 15 | ||||
-rw-r--r-- | sw/source/core/doc/number.cxx | 11 | ||||
-rw-r--r-- | sw/source/core/docnode/ndindex.cxx | 14 |
8 files changed, 0 insertions, 96 deletions
diff --git a/sw/inc/SwNumberTree.hxx b/sw/inc/SwNumberTree.hxx index 4775f2012ab4..b3c3b05daff2 100644 --- a/sw/inc/SwNumberTree.hxx +++ b/sw/inc/SwNumberTree.hxx @@ -347,11 +347,6 @@ public: */ const SwNumberTreeNode* GetPrecedingNodeOf( const SwNumberTreeNode& rNode ) const; -#ifdef DBG_UTIL - static unsigned long GetInstances(); - unsigned long GetSerial(); -#endif - #ifdef __SW_NUMBER_TREE_SANITY_CHECK /** Sanity check. @@ -450,18 +445,6 @@ protected: */ mutable tSwNumberTreeChildren::const_iterator mItLastValid; -#ifdef DBG_UTIL - /** - Counter for the number of created instances. - */ - static unsigned long s_nInstances; - - /** - Serial number. - */ - unsigned long m_nSerial; -#endif - SwNumberTreeNode(const SwNumberTreeNode& ); SwNumberTreeNode& operator=( const SwNumberTreeNode& ); diff --git a/sw/inc/index.hxx b/sw/inc/index.hxx index 5c56fd5cf4ab..a20ad4973a27 100644 --- a/sw/inc/index.hxx +++ b/sw/inc/index.hxx @@ -53,11 +53,6 @@ class SW_DLLPUBLIC SwIndex { friend class SwIndexReg; -#ifdef DBG_UTIL - static int s_nSerial; - int m_nSerial; -#endif - xub_StrLen nIndex; SwIndexReg* pArray; SwIndex *pNext, *pPrev; diff --git a/sw/inc/ndindex.hxx b/sw/inc/ndindex.hxx index af1028b70607..566d180cf91d 100644 --- a/sw/inc/ndindex.hxx +++ b/sw/inc/ndindex.hxx @@ -44,11 +44,6 @@ class SW_DLLPUBLIC SwNodeIndex friend void SwNodes::DeRegisterIndex( SwNodeIndex& ); friend void SwNodes::RemoveNode( sal_uLong, sal_uLong, sal_Bool ); -#ifdef DBG_UTIL - static int s_nSerial; - int m_nSerial; -#endif - SwNode* pNd; SwNodeIndex *pNext, *pPrev; diff --git a/sw/inc/numrule.hxx b/sw/inc/numrule.hxx index 35cbb4e513a0..eb7d83aee996 100644 --- a/sw/inc/numrule.hxx +++ b/sw/inc/numrule.hxx @@ -115,11 +115,6 @@ public: private: friend void _FinitCore(); -#if DBG_UTIL - long int m_nSerial; - static long int s_nInstances; -#endif - static SwNumFmt* aBaseFmts [ RULE_END ][ MAXLEVEL ]; static sal_uInt16 aDefNumIndents[ MAXLEVEL ]; // default list level properties for position-and-space mode LABEL_ALIGNMENT diff --git a/sw/source/core/SwNumberTree/SwNumberTree.cxx b/sw/source/core/SwNumberTree/SwNumberTree.cxx index b333eac87fc7..441f0f16ba2c 100644 --- a/sw/source/core/SwNumberTree/SwNumberTree.cxx +++ b/sw/source/core/SwNumberTree/SwNumberTree.cxx @@ -36,9 +36,6 @@ using std::vector; using std::find; -#ifdef DBG_UTIL -unsigned long SwNumberTreeNode::s_nInstances = 0; -#endif SwNumberTreeNode::SwNumberTreeNode() : mChildren(), @@ -49,11 +46,6 @@ SwNumberTreeNode::SwNumberTreeNode() mItLastValid() { mItLastValid = mChildren.end(); - -#ifdef DBG_UTIL - m_nSerial = s_nInstances; - s_nInstances++; -#endif } SwNumberTreeNode::~SwNumberTreeNode() @@ -75,10 +67,6 @@ SwNumberTreeNode::~SwNumberTreeNode() OSL_ENSURE( IsPhantom() || mpParent == NULL, ": I'm not supposed to have a parent."); -#ifdef DBG_UTIL - s_nInstances--; -#endif - mpParent = (SwNumberTreeNode *) 0xdeadbeef; OSL_ENSURE(mChildren.empty(), "children left!"); @@ -997,18 +985,6 @@ SwNumberTreeNode::GetIterator(const SwNumberTreeNode * pChild) const return aItResult; } -#ifdef DBG_UTIL -unsigned long SwNumberTreeNode::GetInstances() -{ - return s_nInstances; -} - -unsigned long SwNumberTreeNode::GetSerial() -{ - return m_nSerial; -} -#endif - bool SwNumberTreeNodeLessThan(const SwNumberTreeNode * pA, const SwNumberTreeNode * pB) { diff --git a/sw/source/core/bastyp/index.cxx b/sw/source/core/bastyp/index.cxx index 6dac54b80472..95e7df170ffc 100644 --- a/sw/source/core/bastyp/index.cxx +++ b/sw/source/core/bastyp/index.cxx @@ -35,10 +35,6 @@ #include "index.hxx" -#ifdef DBG_UTIL -int SwIndex::s_nSerial = 0; -#endif - TYPEINIT0(SwIndexReg); // rtti @@ -58,10 +54,6 @@ SwIndex::SwIndex(SwIndexReg *const pArr, xub_StrLen const nIdx) ChgValue( *pArray->pLast, nIdx ); else ChgValue( *pArray->pFirst, nIdx ); - -#ifdef DBG_UTIL - m_nSerial = ++s_nSerial; -#endif } @@ -69,10 +61,6 @@ SwIndex::SwIndex( const SwIndex& rIdx, short nIdx ) : pArray( rIdx.pArray ), pNext( 0 ), pPrev( 0 ) { ChgValue( rIdx, rIdx.nIndex + nIdx ); - -#ifdef DBG_UTIL - m_nSerial = ++s_nSerial; -#endif } @@ -80,9 +68,6 @@ SwIndex::SwIndex( const SwIndex& rIdx ) : nIndex( rIdx.nIndex ), pArray( rIdx.pArray ), pNext( 0 ), pPrev( 0 ) { ChgValue( rIdx, rIdx.nIndex ); -#ifdef DBG_UTIL - m_nSerial = ++s_nSerial; -#endif } diff --git a/sw/source/core/doc/number.cxx b/sw/source/core/doc/number.cxx index 8f1d281c67a5..18195cc0f6d5 100644 --- a/sw/source/core/doc/number.cxx +++ b/sw/source/core/doc/number.cxx @@ -387,9 +387,6 @@ const SwFmtVertOrient* SwNumFmt::GetGraphicOrientation() const } } -#ifdef DBG_UTIL -long int SwNumRule::s_nInstances = 0; -#endif // handle new parameter <eDefaultNumberFormatPositionAndSpaceMode> SwNumRule::SwNumRule( const String& rNm, @@ -412,10 +409,6 @@ SwNumRule::SwNumRule( const String& rNm, meDefaultNumberFormatPositionAndSpaceMode( eDefaultNumberFormatPositionAndSpaceMode ), msDefaultListId() { -#ifdef DBG_UTIL - m_nSerial = s_nInstances++; -#endif - if( !nRefCount++ ) // zum erstmal, also initialisiern { SwNumFmt* pFmt; @@ -514,10 +507,6 @@ SwNumRule::SwNumRule( const SwNumRule& rNumRule ) meDefaultNumberFormatPositionAndSpaceMode( rNumRule.meDefaultNumberFormatPositionAndSpaceMode ), msDefaultListId( rNumRule.msDefaultListId ) { -#ifdef DBG_UTIL - m_nSerial = s_nInstances++; -#endif - ++nRefCount; memset( aFmts, 0, sizeof( aFmts )); for( sal_uInt16 n = 0; n < MAXLEVEL; ++n ) diff --git a/sw/source/core/docnode/ndindex.cxx b/sw/source/core/docnode/ndindex.cxx index fd862921125f..edf5b4161615 100644 --- a/sw/source/core/docnode/ndindex.cxx +++ b/sw/source/core/docnode/ndindex.cxx @@ -31,10 +31,6 @@ #include "ndindex.hxx" -#ifdef DBG_UTIL -int SwNodeIndex::s_nSerial = 0; -#endif - SwNodeRange::SwNodeRange( const SwNodeIndex &rS, const SwNodeIndex &rE ) : aStart( rS ), aEnd( rE ) @@ -64,10 +60,6 @@ SwNodeIndex::SwNodeIndex( SwNodes& rNds, sal_uLong nIdx ) : pNd( rNds[ nIdx ] ), pNext( 0 ), pPrev( 0 ) { rNds.RegisterIndex( *this ); - -#ifdef DBG_UTIL - m_nSerial = ++s_nSerial; -#endif } @@ -80,9 +72,6 @@ SwNodeIndex::SwNodeIndex( const SwNodeIndex& rIdx, long nDiff ) pNd = rIdx.pNd; pNd->GetNodes().RegisterIndex( *this ); -#ifdef DBG_UTIL - m_nSerial = ++s_nSerial; -#endif } @@ -95,9 +84,6 @@ SwNodeIndex::SwNodeIndex( const SwNode& rNd, long nDiff ) pNd = (SwNode*)&rNd; pNd->GetNodes().RegisterIndex( *this ); -#ifdef DBG_UTIL - m_nSerial = ++s_nSerial; -#endif } |