summaryrefslogtreecommitdiff
path: root/sw/source/core/SwNumberTree
diff options
context:
space:
mode:
authorCédric Bosdonnat <cedricbosdo@openoffice.org>2010-11-25 17:08:45 +0100
committerCédric Bosdonnat <cedricbosdo@openoffice.org>2010-11-25 17:12:34 +0100
commitc16ba8a04fd4599e439e7e039705e41691c43acb (patch)
tree66a1c67973a674245548e10ff0746d1e473a7703 /sw/source/core/SwNumberTree
parente9eaf033646695987e218907a565b555b976c5c8 (diff)
Removed DBG_UTIL from sw
* Fixed the different dbglevel builds * This needed to change all the sw local ASSERT to OSL_ENSURE...
Diffstat (limited to 'sw/source/core/SwNumberTree')
-rw-r--r--sw/source/core/SwNumberTree/SwNodeNum.cxx20
-rw-r--r--sw/source/core/SwNumberTree/SwNumberTree.cxx62
2 files changed, 41 insertions, 41 deletions
diff --git a/sw/source/core/SwNumberTree/SwNodeNum.cxx b/sw/source/core/SwNumberTree/SwNodeNum.cxx
index 255e03a8cb18..cad245d97bb8 100644
--- a/sw/source/core/SwNumberTree/SwNodeNum.cxx
+++ b/sw/source/core/SwNumberTree/SwNodeNum.cxx
@@ -74,7 +74,7 @@ SwNumRule * SwNodeNum::GetNumRule() const
void SwNodeNum::ChangeNumRule( SwNumRule& rNumRule )
{
- ASSERT( GetNumRule() && GetTxtNode(),
+ OSL_ENSURE( GetNumRule() && GetTxtNode(),
"<SwNodeNum::ChangeNumRule(..)> - missing list style and/or text node. Serious defect -> please informm OD." );
if ( GetNumRule() && GetTxtNode() )
{
@@ -91,7 +91,7 @@ void SwNodeNum::ChangeNumRule( SwNumRule& rNumRule )
SwPosition SwNodeNum::GetPosition() const
{
- ASSERT( GetTxtNode(),
+ OSL_ENSURE( GetTxtNode(),
"<SwNodeNum::GetPosition()> - no text node set at <SwNodeNum> instance" );
return SwPosition(*mpTxtNode);
}
@@ -110,13 +110,13 @@ SwNumberTreeNode * SwNodeNum::Create() const
// --> OD 2008-02-19 #refactorlists#
void SwNodeNum::PreAdd()
{
- ASSERT( GetTxtNode(),
+ OSL_ENSURE( GetTxtNode(),
"<SwNodeNum::PreAdd()> - no text node set at <SwNodeNum> instance" );
if ( !GetNumRule() && GetTxtNode() )
{
mpNumRule = GetTxtNode()->GetNumRule();
}
- ASSERT( GetNumRule(),
+ OSL_ENSURE( GetNumRule(),
"<SwNodeNum::PreAdd()> - no list style set at <SwNodeNum> instance" );
if ( GetNumRule() && GetTxtNode() )
{
@@ -135,9 +135,9 @@ void SwNodeNum::PreAdd()
void SwNodeNum::PostRemove()
{
- ASSERT( GetTxtNode(),
+ OSL_ENSURE( GetTxtNode(),
"<SwNodeNum::PostRemove()> - no text node set at <SwNodeNum> instance" );
- ASSERT( GetNumRule(),
+ OSL_ENSURE( GetNumRule(),
"<SwNodeNum::PostRemove()> - no list style set at <SwNodeNum> instance" );
if ( GetTxtNode() )
@@ -191,7 +191,7 @@ bool SwNodeNum::IsContinuous() const
}
else
{
- ASSERT( false, "<SwNodeNum::IsContinuous()> - OD debug" );
+ OSL_ENSURE( false, "<SwNodeNum::IsContinuous()> - OD debug" );
}
// <--
@@ -232,7 +232,7 @@ bool SwNodeNum::HasCountedChildren() const
for (aIt = mChildren.begin(); aIt != mChildren.end(); aIt++)
{
SwNodeNum* pChild( dynamic_cast<SwNodeNum*>(*aIt) );
- ASSERT( pChild,
+ OSL_ENSURE( pChild,
"<SwNodeNum::HasCountedChildren()> - unexcepted type of child -> please inform OD" );
if ( pChild &&
( pChild->IsCountedForNumbering() ||
@@ -348,7 +348,7 @@ bool SwNodeNum::IsCountPhantoms() const
mpNumRule->IsCountPhantoms();
else
{
- ASSERT( false,
+ OSL_ENSURE( false,
"<SwNodeNum::IsCountPhantoms(): missing numbering rule - please inform OD" );
}
// <--
@@ -471,7 +471,7 @@ void SwNodeNum::_UnregisterMeAndChildrenDueToRootDelete( SwNodeNum& rNodeNum )
SwNodeNum* pChildNode( dynamic_cast<SwNodeNum*>((*rNodeNum.mChildren.begin())) );
if ( !pChildNode )
{
- ASSERT( false,
+ OSL_ENSURE( false,
"<SwNodeNum::_UnregisterMeAndChildrenDueToRootDelete(..)> - unknown number tree node child" );
++nAllowedChildCount;
continue;
diff --git a/sw/source/core/SwNumberTree/SwNumberTree.cxx b/sw/source/core/SwNumberTree/SwNumberTree.cxx
index 00b2b0abc296..b3a1d4381be4 100644
--- a/sw/source/core/SwNumberTree/SwNumberTree.cxx
+++ b/sw/source/core/SwNumberTree/SwNumberTree.cxx
@@ -37,7 +37,7 @@
using std::vector;
using std::find;
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
unsigned long SwNumberTreeNode::nInstances = 0;
#endif
@@ -53,7 +53,7 @@ SwNumberTreeNode::SwNumberTreeNode()
{
mItLastValid = mChildren.end();
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
mnSerial = nInstances;
nInstances++;
#endif
@@ -72,19 +72,19 @@ SwNumberTreeNode::~SwNumberTreeNode()
}
else
{
- ASSERT(false, "lost children!");
+ OSL_ENSURE(false, "lost children!");
}
}
- ASSERT( IsPhantom() || mpParent == NULL, ": I'm not supposed to have a parent.");
+ OSL_ENSURE( IsPhantom() || mpParent == NULL, ": I'm not supposed to have a parent.");
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
nInstances--;
#endif
mpParent = (SwNumberTreeNode *) 0xdeadbeef;
- ASSERT(mChildren.empty(), "children left!");
+ OSL_ENSURE(mChildren.empty(), "children left!");
}
SwNumberTreeNode * SwNumberTreeNode::CreatePhantom()
@@ -94,7 +94,7 @@ SwNumberTreeNode * SwNumberTreeNode::CreatePhantom()
if (! mChildren.empty() &&
(*mChildren.begin())->IsPhantom())
{
- ASSERT(false, "phantom already present");
+ OSL_ENSURE(false, "phantom already present");
}
else
{
@@ -107,7 +107,7 @@ SwNumberTreeNode * SwNumberTreeNode::CreatePhantom()
if (! aInsert.second)
{
- ASSERT(false, "insert of phantom failed!");
+ OSL_ENSURE(false, "insert of phantom failed!");
delete pNew;
pNew = NULL;
@@ -158,7 +158,7 @@ void SwNumberTreeNode::ValidateHierarchical(const SwNumberTreeNode * pNode) cons
if (aValidateIt != mChildren.end())
{
- ASSERT((*aValidateIt)->mpParent == this, "wrong parent");
+ OSL_ENSURE((*aValidateIt)->mpParent == this, "wrong parent");
tSwNumberTreeChildren::iterator aIt = mItLastValid;
@@ -501,10 +501,10 @@ void SwNumberTreeNode::MoveChildren(SwNumberTreeNode * pDest)
// <--
}
- ASSERT (mChildren.empty(), "MoveChildren failed!");
+ OSL_ENSURE(mChildren.empty(), "MoveChildren failed!");
#ifdef __SW_NUMBER_TREE_SANITY_CHECK
- ASSERT(IsSane(false) && pDest->IsSane(false), "insanity!");
+ OSL_ENSURE(IsSane(false) && pDest->IsSane(false), "insanity!");
#endif
}
@@ -539,7 +539,7 @@ void SwNumberTreeNode::AddChild( SwNumberTreeNode * pChild,
// --> OD 2008-03-13 #refactorlists#
if ( nDepth < 0 )
{
- ASSERT( false,
+ OSL_ENSURE( false,
"<SwNumberTreeNode::AddChild(..)> - parameter <nDepth> out of valid range. Serious defect -> please inform OD." );
return;
}
@@ -547,7 +547,7 @@ void SwNumberTreeNode::AddChild( SwNumberTreeNode * pChild,
if ( pChild->GetParent() != NULL || pChild->GetChildCount() > 0 )
{
- ASSERT(false, "only orphans allowed.");
+ OSL_ENSURE(false, "only orphans allowed.");
return;
}
@@ -556,7 +556,7 @@ void SwNumberTreeNode::AddChild( SwNumberTreeNode * pChild,
tSwNumberTreeChildren::iterator aInsertDeepIt =
mChildren.upper_bound(pChild);
- ASSERT(! (aInsertDeepIt != mChildren.end() &&
+ OSL_ENSURE(! (aInsertDeepIt != mChildren.end() &&
(*aInsertDeepIt)->IsPhantom()), " unexspected phantom");
@@ -684,7 +684,7 @@ void SwNumberTreeNode::RemoveChild(SwNumberTreeNode * pChild)
if (pChild->IsPhantom())
{
- ASSERT(false, "not applicable to phantoms!");
+ OSL_ENSURE(false, "not applicable to phantoms!");
return;
}
@@ -744,7 +744,7 @@ void SwNumberTreeNode::RemoveChild(SwNumberTreeNode * pChild)
}
else
{
- ASSERT(false, "RemoveChild: failed!");
+ OSL_ENSURE(false, "RemoveChild: failed!");
}
// --> OD 2008-02-19 #refactorlists#
@@ -857,7 +857,7 @@ bool SwNumberTreeNode::HasPhantomCountedParent() const
{
bool bRet( false );
- ASSERT( IsPhantom(),
+ OSL_ENSURE( IsPhantom(),
"<SwNumberTreeNode::HasPhantomCountedParent()> - wrong usage of method - it's only for phantoms" );
if ( IsPhantom() && mpParent )
{
@@ -934,19 +934,19 @@ void SwNumberTreeNode::SetLevelInListTree( const int nLevel )
{
if ( nLevel < 0 )
{
- ASSERT( false,
+ OSL_ENSURE( false,
"<SwNumberTreeNode::SetLevelInListTree(..)> - parameter <nLevel> out of valid range. Serious defect -> please inform OD." );
return;
}
- ASSERT( GetParent(),
+ OSL_ENSURE( GetParent(),
"<SwNumberTreeNode::SetLevelInListTree(..)> - can only be called for number tree nodes in a list tree" );
if ( GetParent() )
{
if ( nLevel != GetLevelInListTree() )
{
SwNumberTreeNode* pRootTreeNode = GetRoot();
- ASSERT( pRootTreeNode,
+ OSL_ENSURE( pRootTreeNode,
"<SwNumberTreeNode::SetLevelInListTree(..)> - no root tree node found. Serious defect -> please inform OD." );
RemoveMe();
@@ -988,14 +988,14 @@ bool SwNumberTreeNode::IsSane(bool bRecursive,
if (find(rParents.begin(), rParents.end(), this) != rParents.end())
{
- ASSERT(false, " I'm my own ancestor!");
+ OSL_ENSURE(false, " I'm my own ancestor!");
bResult = false;
}
if (! rParents.empty() && rParents.back() != mpParent)
{
- ASSERT(false, " I'm a bastard!");
+ OSL_ENSURE(false, " I'm a bastard!");
bResult = false;
}
@@ -1016,7 +1016,7 @@ bool SwNumberTreeNode::IsSane(bool bRecursive,
if (! bFirst)
{
- ASSERT(false, " found phantom not at first position.");
+ OSL_ENSURE(false, " found phantom not at first position.");
bResult = false;
}
@@ -1024,7 +1024,7 @@ bool SwNumberTreeNode::IsSane(bool bRecursive,
if ((*aIt)->mpParent != (SwNumberTreeNode *) this)
{
- ASSERT(false, "found a bastard");
+ OSL_ENSURE(false, "found a bastard");
bResult = false;
}
@@ -1033,7 +1033,7 @@ bool SwNumberTreeNode::IsSane(bool bRecursive,
{
if (!(*aIt)->IsPhantom() && (*aIt)->LessThan(*this))
{
- ASSERT(false, " found child less than me");
+ OSL_ENSURE(false, " found child less than me");
bResult = false;
}
@@ -1041,7 +1041,7 @@ bool SwNumberTreeNode::IsSane(bool bRecursive,
}
else
{
- ASSERT(false, "found child that is NULL");
+ OSL_ENSURE(false, "found child that is NULL");
bResult = false;
}
@@ -1061,7 +1061,7 @@ SwNumberTreeNode::GetIterator(const SwNumberTreeNode * pChild) const
tSwNumberTreeChildren::iterator aItResult =
mChildren.find(const_cast<SwNumberTreeNode *>(pChild));
- ASSERT( aItResult != mChildren.end(),
+ OSL_ENSURE( aItResult != mChildren.end(),
"something went wrong getting the iterator for a child");
return aItResult;
@@ -1093,7 +1093,7 @@ SwNumberTreeNode::GetIterator(const SwNumberTreeNode * pChild) const
// return aStr;
//}
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
unsigned long SwNumberTreeNode::GetInstances()
{
return nInstances;
@@ -1176,7 +1176,7 @@ void SwNumberTreeNode::SetLastValid
( SwNumberTreeNode::tSwNumberTreeChildren::iterator aItValid,
bool bValidating ) const
{
- ASSERT( (aItValid == mChildren.end() || GetIterator(*aItValid) != mChildren.end()),
+ OSL_ENSURE( (aItValid == mChildren.end() || GetIterator(*aItValid) != mChildren.end()),
"last-valid iterator");
if (
@@ -1376,7 +1376,7 @@ void SwNumberTreeNode::NotifyNodesOnListLevel( const int nListLevel )
{
if ( nListLevel < 0 )
{
- ASSERT( false,
+ OSL_ENSURE( false,
"<SwNumberTreeNode::NotifyNodesOnListLevel(..)> - invalid list level provided" );
return;
}
@@ -1388,7 +1388,7 @@ void SwNumberTreeNode::NotifyNodesOnListLevel( const int nListLevel )
void SwNumberTreeNode::NotifyChildrenOnDepth( const int nDepth )
{
- ASSERT( nDepth >= 0,
+ OSL_ENSURE( nDepth >= 0,
"<SwNumberTreeNode::NotifyChildrenOnDepth(..)> - misusage" );
SwNumberTreeNode::tSwNumberTreeChildren::iterator aChildIter =