diff options
author | Michael Stahl <mstahl@redhat.com> | 2011-11-24 00:53:21 +0100 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2011-11-24 00:53:21 +0100 |
commit | 0d2a6999fc320843e4db0c99d961414416a8451c (patch) | |
tree | b026d1ffd8b5a219759190a5e19e0d32d93ca322 | |
parent | 555ff26501d1bbd8a7872c20671c6303db1e1701 (diff) |
SwIndex, SwIndexReg::~SwIndexReg: deploy assert()
-rw-r--r-- | sw/source/core/bastyp/index.cxx | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/sw/source/core/bastyp/index.cxx b/sw/source/core/bastyp/index.cxx index 49356c16b744..081f87e3d641 100644 --- a/sw/source/core/bastyp/index.cxx +++ b/sw/source/core/bastyp/index.cxx @@ -29,6 +29,7 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sw.hxx" +#include <assert.h> #include <stdlib.h> // fuer qsort #include <tools/solar.h> @@ -72,7 +73,7 @@ void SwIndex::Init(xub_StrLen const nIdx) } else if (!m_pIndexReg->m_pFirst) // first Index? { - OSL_ASSERT(!m_pIndexReg->m_pLast); + assert(!m_pIndexReg->m_pLast); m_pIndexReg->m_pFirst = m_pIndexReg->m_pLast = this; m_nIndex = nIdx; } @@ -89,7 +90,7 @@ void SwIndex::Init(xub_StrLen const nIdx) SwIndex& SwIndex::ChgValue( const SwIndex& rIdx, xub_StrLen nNewValue ) { - OSL_ASSERT(m_pIndexReg == rIdx.m_pIndexReg); + assert(m_pIndexReg == rIdx.m_pIndexReg); if (!m_pIndexReg) { return *this; // no IndexReg => no list to sort into; m_nIndex is 0 @@ -164,7 +165,7 @@ void SwIndex::Remove() { if (!m_pIndexReg) { - OSL_ASSERT(!m_pPrev && !m_pNext); + assert(!m_pPrev && !m_pNext); return; } @@ -193,7 +194,7 @@ void SwIndex::Remove() SwIndex& SwIndex::operator=( const SwIndex& rIdx ) { bool bEqual; - if (rIdx.m_pIndexReg != m_pIndexReg) // im alten abmelden !! + if (rIdx.m_pIndexReg != m_pIndexReg) // unregister! { Remove(); m_pIndexReg = rIdx.m_pIndexReg; @@ -234,7 +235,7 @@ SwIndexReg::SwIndexReg() SwIndexReg::~SwIndexReg() { - OSL_ENSURE( !m_pFirst || !m_pLast, "There are still indices registered" ); + assert(!m_pFirst && !m_pLast); // There are still indices registered } void SwIndexReg::Update( SwIndex const & rIdx, const xub_StrLen nDiff, @@ -360,8 +361,8 @@ xub_StrLen SwIndex::operator-=( const SwIndex & rIndex ) *************************************************************************/ bool SwIndex::operator< ( const SwIndex & rIndex ) const { - OSL_ENSURE( m_pIndexReg == rIndex.m_pIndexReg, - "Attempt to compare indices into different arrays."); + // Attempt to compare indices into different arrays + assert(m_pIndexReg == rIndex.m_pIndexReg); return m_nIndex < rIndex.m_nIndex; } @@ -370,8 +371,8 @@ bool SwIndex::operator< ( const SwIndex & rIndex ) const *************************************************************************/ bool SwIndex::operator<=( const SwIndex & rIndex ) const { - OSL_ENSURE( m_pIndexReg == rIndex.m_pIndexReg, - "Attempt to compare indices into different arrays."); + // Attempt to compare indices into different arrays + assert(m_pIndexReg == rIndex.m_pIndexReg); return m_nIndex <= rIndex.m_nIndex; } @@ -380,8 +381,8 @@ bool SwIndex::operator<=( const SwIndex & rIndex ) const *************************************************************************/ bool SwIndex::operator> ( const SwIndex & rIndex ) const { - OSL_ENSURE( m_pIndexReg == rIndex.m_pIndexReg, - "Attempt to compare indices into different arrays."); + // Attempt to compare indices into different arrays + assert(m_pIndexReg == rIndex.m_pIndexReg); return m_nIndex > rIndex.m_nIndex; } @@ -390,8 +391,8 @@ bool SwIndex::operator> ( const SwIndex & rIndex ) const *************************************************************************/ bool SwIndex::operator>=( const SwIndex & rIndex ) const { - OSL_ENSURE( m_pIndexReg == rIndex.m_pIndexReg, - "Attempt to compare indices into different arrays."); + // Attempt to compare indices into different arrays + assert(m_pIndexReg == rIndex.m_pIndexReg); return m_nIndex >= rIndex.m_nIndex; } |