summaryrefslogtreecommitdiff
path: root/sw/source/core/SwNumberTree
diff options
context:
space:
mode:
authorThomas Arnhold <thomas@arnhold.org>2011-03-12 11:51:35 +0100
committerThomas Arnhold <thomas@arnhold.org>2011-03-13 16:54:59 +0100
commit64378f446e782b6636312a8c72a7400fd799c1a4 (patch)
tree25376336ad586c3804f16ebc05d62fb069bce74b /sw/source/core/SwNumberTree
parent83d8300b31948702f3c11dc14d4070501b108084 (diff)
Move OSL_ENSURE(false,...) to OSL_FAIL(...)
Diffstat (limited to 'sw/source/core/SwNumberTree')
-rw-r--r--sw/source/core/SwNumberTree/SwNodeNum.cxx8
-rw-r--r--sw/source/core/SwNumberTree/SwNumberTree.cxx33
2 files changed, 18 insertions, 23 deletions
diff --git a/sw/source/core/SwNumberTree/SwNodeNum.cxx b/sw/source/core/SwNumberTree/SwNodeNum.cxx
index b831f4c1a991..cbd2d222f572 100644
--- a/sw/source/core/SwNumberTree/SwNodeNum.cxx
+++ b/sw/source/core/SwNumberTree/SwNodeNum.cxx
@@ -182,7 +182,7 @@ bool SwNodeNum::IsContinuous() const
}
else
{
- OSL_ENSURE( false, "<SwNodeNum::IsContinuous()> - OD debug" );
+ OSL_FAIL( "<SwNodeNum::IsContinuous()> - OD debug" );
}
// <--
@@ -294,8 +294,7 @@ bool SwNodeNum::IsCountPhantoms() const
mpNumRule->IsCountPhantoms();
else
{
- OSL_ENSURE( false,
- "<SwNodeNum::IsCountPhantoms(): missing numbering rule - please inform OD" );
+ OSL_FAIL( "<SwNodeNum::IsCountPhantoms(): missing numbering rule - please inform OD" );
}
// <--
@@ -358,8 +357,7 @@ void SwNodeNum::_UnregisterMeAndChildrenDueToRootDelete( SwNodeNum& rNodeNum )
SwNodeNum* pChildNode( dynamic_cast<SwNodeNum*>((*rNodeNum.mChildren.begin())) );
if ( !pChildNode )
{
- OSL_ENSURE( false,
- "<SwNodeNum::_UnregisterMeAndChildrenDueToRootDelete(..)> - unknown number tree node child" );
+ OSL_FAIL( "<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 c19d969d09b1..03ccf0e71bad 100644
--- a/sw/source/core/SwNumberTree/SwNumberTree.cxx
+++ b/sw/source/core/SwNumberTree/SwNumberTree.cxx
@@ -69,7 +69,7 @@ SwNumberTreeNode::~SwNumberTreeNode()
}
else
{
- OSL_ENSURE(false, "lost children!");
+ OSL_FAIL("lost children!");
}
}
@@ -91,7 +91,7 @@ SwNumberTreeNode * SwNumberTreeNode::CreatePhantom()
if (! mChildren.empty() &&
(*mChildren.begin())->IsPhantom())
{
- OSL_ENSURE(false, "phantom already present");
+ OSL_FAIL("phantom already present");
}
else
{
@@ -104,7 +104,7 @@ SwNumberTreeNode * SwNumberTreeNode::CreatePhantom()
if (! aInsert.second)
{
- OSL_ENSURE(false, "insert of phantom failed!");
+ OSL_FAIL("insert of phantom failed!");
delete pNew;
pNew = NULL;
@@ -503,14 +503,13 @@ void SwNumberTreeNode::AddChild( SwNumberTreeNode * pChild,
if ( nDepth < 0 )
{
- OSL_ENSURE( false,
- "<SwNumberTreeNode::AddChild(..)> - parameter <nDepth> out of valid range. Serious defect -> please inform OD." );
+ OSL_FAIL( "<SwNumberTreeNode::AddChild(..)> - parameter <nDepth> out of valid range. Serious defect -> please inform OD." );
return;
}
if ( pChild->GetParent() != NULL || pChild->GetChildCount() > 0 )
{
- OSL_ENSURE(false, "only orphans allowed.");
+ OSL_FAIL("only orphans allowed.");
return;
}
@@ -644,7 +643,7 @@ void SwNumberTreeNode::RemoveChild(SwNumberTreeNode * pChild)
if (pChild->IsPhantom())
{
- OSL_ENSURE(false, "not applicable to phantoms!");
+ OSL_FAIL("not applicable to phantoms!");
return;
}
@@ -697,7 +696,7 @@ void SwNumberTreeNode::RemoveChild(SwNumberTreeNode * pChild)
}
else
{
- OSL_ENSURE(false, "RemoveChild: failed!");
+ OSL_FAIL("RemoveChild: failed!");
}
pChild->PostRemove();
@@ -878,8 +877,7 @@ void SwNumberTreeNode::SetLevelInListTree( const int nLevel )
{
if ( nLevel < 0 )
{
- OSL_ENSURE( false,
- "<SwNumberTreeNode::SetLevelInListTree(..)> - parameter <nLevel> out of valid range. Serious defect -> please inform OD." );
+ OSL_FAIL( "<SwNumberTreeNode::SetLevelInListTree(..)> - parameter <nLevel> out of valid range. Serious defect -> please inform OD." );
return;
}
@@ -931,14 +929,14 @@ bool SwNumberTreeNode::IsSane(bool bRecursive,
if (find(rParents.begin(), rParents.end(), this) != rParents.end())
{
- OSL_ENSURE(false, " I'm my own ancestor!");
+ OSL_FAIL(" I'm my own ancestor!");
bResult = false;
}
if (! rParents.empty() && rParents.back() != mpParent)
{
- OSL_ENSURE(false, " I'm a bastard!");
+ OSL_FAIL(" I'm a bastard!");
bResult = false;
}
@@ -959,7 +957,7 @@ bool SwNumberTreeNode::IsSane(bool bRecursive,
if (! bFirst)
{
- OSL_ENSURE(false, " found phantom not at first position.");
+ OSL_FAIL(" found phantom not at first position.");
bResult = false;
}
@@ -967,7 +965,7 @@ bool SwNumberTreeNode::IsSane(bool bRecursive,
if ((*aIt)->mpParent != (SwNumberTreeNode *) this)
{
- OSL_ENSURE(false, "found a bastard");
+ OSL_FAIL("found a bastard");
bResult = false;
}
@@ -976,7 +974,7 @@ bool SwNumberTreeNode::IsSane(bool bRecursive,
{
if (!(*aIt)->IsPhantom() && (*aIt)->LessThan(*this))
{
- OSL_ENSURE(false, " found child less than me");
+ OSL_FAIL(" found child less than me");
bResult = false;
}
@@ -984,7 +982,7 @@ bool SwNumberTreeNode::IsSane(bool bRecursive,
}
else
{
- OSL_ENSURE(false, "found child that is NULL");
+ OSL_FAIL("found child that is NULL");
bResult = false;
}
@@ -1289,8 +1287,7 @@ void SwNumberTreeNode::NotifyNodesOnListLevel( const int nListLevel )
{
if ( nListLevel < 0 )
{
- OSL_ENSURE( false,
- "<SwNumberTreeNode::NotifyNodesOnListLevel(..)> - invalid list level provided" );
+ OSL_FAIL( "<SwNumberTreeNode::NotifyNodesOnListLevel(..)> - invalid list level provided" );
return;
}