OSL_ENSHURE replaced by OSL_ENSURE

This commit is contained in:
Joachim Lingner
2001-03-21 12:52:43 +00:00
parent 6c821b4f6f
commit 730d9ab61f
5 changed files with 103 additions and 103 deletions

View File

@@ -2,9 +2,9 @@
* *
* $RCSfile: internalnode.cxx,v $ * $RCSfile: internalnode.cxx,v $
* *
* $Revision: 1.3 $ * $Revision: 1.4 $
* *
* last change: $Author: hr $ $Date: 2000-10-26 11:01:57 $ * last change: $Author: jl $ $Date: 2001-03-21 13:52:43 $
* *
* The Contents of this file are made available subject to the terms of * The Contents of this file are made available subject to the terms of
* either of the following licenses * either of the following licenses
@@ -75,7 +75,7 @@ OSQLInternalNode::OSQLInternalNode(const sal_Char* pNewValue,
sal_uInt32 nNodeID) sal_uInt32 nNodeID)
: OSQLParseNode(pNewValue,eNodeType,nNodeID) : OSQLParseNode(pNewValue,eNodeType,nNodeID)
{ {
OSL_ENSHURE(OSQLParser::s_pGarbageCollector, "Collector not initialized"); OSL_ENSURE(OSQLParser::s_pGarbageCollector, "Collector not initialized");
OSQLParser::s_pGarbageCollector->push_back(this); OSQLParser::s_pGarbageCollector->push_back(this);
} }
@@ -85,7 +85,7 @@ OSQLInternalNode::OSQLInternalNode(const ::rtl::OString &_NewValue,
sal_uInt32 nNodeID) sal_uInt32 nNodeID)
:OSQLParseNode(_NewValue,eNodeType,nNodeID) :OSQLParseNode(_NewValue,eNodeType,nNodeID)
{ {
OSL_ENSHURE(OSQLParser::s_pGarbageCollector, "Collector not initialized"); OSL_ENSURE(OSQLParser::s_pGarbageCollector, "Collector not initialized");
OSQLParser::s_pGarbageCollector->push_back(this); OSQLParser::s_pGarbageCollector->push_back(this);
} }
@@ -95,7 +95,7 @@ OSQLInternalNode::OSQLInternalNode(const sal_Unicode* pNewValue,
sal_uInt32 nNodeID) sal_uInt32 nNodeID)
:OSQLParseNode(pNewValue,eNodeType,nNodeID) :OSQLParseNode(pNewValue,eNodeType,nNodeID)
{ {
OSL_ENSHURE(OSQLParser::s_pGarbageCollector, "Collector not initialized"); OSL_ENSURE(OSQLParser::s_pGarbageCollector, "Collector not initialized");
OSQLParser::s_pGarbageCollector->push_back(this); OSQLParser::s_pGarbageCollector->push_back(this);
} }
@@ -105,7 +105,7 @@ OSQLInternalNode::OSQLInternalNode(const ::rtl::OUString &_NewValue,
sal_uInt32 nNodeID) sal_uInt32 nNodeID)
:OSQLParseNode(_NewValue,eNodeType,nNodeID) :OSQLParseNode(_NewValue,eNodeType,nNodeID)
{ {
OSL_ENSHURE(OSQLParser::s_pGarbageCollector, "Collector not initialized"); OSL_ENSURE(OSQLParser::s_pGarbageCollector, "Collector not initialized");
OSQLParser::s_pGarbageCollector->push_back(this); OSQLParser::s_pGarbageCollector->push_back(this);
} }
@@ -114,7 +114,7 @@ OSQLInternalNode::OSQLInternalNode(const ::rtl::OUString &_NewValue,
OSQLInternalNode::~OSQLInternalNode() OSQLInternalNode::~OSQLInternalNode()
{ {
// remove the node from the garbage list // remove the node from the garbage list
OSL_ENSHURE(OSQLParser::s_pGarbageCollector, "Collector not initialized"); OSL_ENSURE(OSQLParser::s_pGarbageCollector, "Collector not initialized");
if (!OSQLParser::s_pGarbageCollector->empty()) if (!OSQLParser::s_pGarbageCollector->empty())
{ {
OSQLParser::s_pGarbageCollector->erase( OSQLParser::s_pGarbageCollector->erase(

View File

@@ -1,7 +1,7 @@
%{ %{
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
// //
// $Header: /zpool/svn/migration/cvs_rep_09_09_08/code/connectivity/source/parse/sqlbison.y,v 1.20 2001-03-13 08:24:04 oj Exp $ // $Header: /zpool/svn/migration/cvs_rep_09_09_08/code/connectivity/source/parse/sqlbison.y,v 1.21 2001-03-21 13:52:43 jl Exp $
// //
// Copyright 2000 Sun Microsystems, Inc. All Rights Reserved. // Copyright 2000 Sun Microsystems, Inc. All Rights Reserved.
// //
@@ -9,7 +9,7 @@
// OJ // OJ
// //
// Last change: // Last change:
// $Author: oj $ $Date: 2001-03-13 08:24:04 $ $Revision: 1.20 $ // $Author: jl $ $Date: 2001-03-21 13:52:43 $ $Revision: 1.21 $
// //
// Description: // Description:
// //
@@ -3110,7 +3110,7 @@ Any getNumberFormatProperty(const Reference< ::com::sun::star::util::XNumberForm
sal_Int32 nKey, sal_Int32 nKey,
const rtl::OUString& aPropertyName) const rtl::OUString& aPropertyName)
{ {
OSL_ENSHURE(xSupplier.is(), "getNumberFormatProperty : the formatter doesn't implement a supplier !"); OSL_ENSURE(xSupplier.is(), "getNumberFormatProperty : the formatter doesn't implement a supplier !");
Reference< ::com::sun::star::util::XNumberFormats > xFormats = xSupplier->getNumberFormats(); Reference< ::com::sun::star::util::XNumberFormats > xFormats = xSupplier->getNumberFormats();
if (xFormats.is()) if (xFormats.is())
@@ -3216,7 +3216,7 @@ OSQLParser::~OSQLParser()
{ {
{ {
::osl::MutexGuard aGuard(s_aMutex); ::osl::MutexGuard aGuard(s_aMutex);
OSL_ENSHURE(s_nRefCount > 0, "OSQLParser::~OSQLParser() : suspicious call : have a refcount of 0 !"); OSL_ENSURE(s_nRefCount > 0, "OSQLParser::~OSQLParser() : suspicious call : have a refcount of 0 !");
if (!--s_nRefCount) if (!--s_nRefCount)
{ {
s_pScanner->setScanner(sal_True); s_pScanner->setScanner(sal_True);
@@ -3283,14 +3283,14 @@ OSQLParseNode* OSQLParser::parseTree(::rtl::OUString& rErrorMessage,
// Das Ergebnis liefern (den Root Parse Node): // Das Ergebnis liefern (den Root Parse Node):
// OSL_ENSHURE(Sdbyyval.pParseNode != NULL,"OSQLParser: Parser hat keinen ParseNode geliefert"); // OSL_ENSURE(Sdbyyval.pParseNode != NULL,"OSQLParser: Parser hat keinen ParseNode geliefert");
// return Sdbyyval.pParseNode; // return Sdbyyval.pParseNode;
// geht nicht wegen Bug in MKS YACC-erzeugtem Code (es wird ein falscher ParseNode // geht nicht wegen Bug in MKS YACC-erzeugtem Code (es wird ein falscher ParseNode
// geliefert). // geliefert).
// Stattdessen setzt die Parse-Routine jetzt den Member pParseTree // Stattdessen setzt die Parse-Routine jetzt den Member pParseTree
// - einfach diesen zurueckliefern: // - einfach diesen zurueckliefern:
OSL_ENSHURE(m_pParseTree != NULL,"OSQLParser: Parser hat keinen ParseTree geliefert"); OSL_ENSURE(m_pParseTree != NULL,"OSQLParser: Parser hat keinen ParseTree geliefert");
return m_pParseTree; return m_pParseTree;
} }
} }
@@ -3353,7 +3353,7 @@ OSQLParseNode* OSQLParser::predicateTree(::rtl::OUString& rErrorMessage, const :
if (m_nFormatKey && m_xFormatter.is()) if (m_nFormatKey && m_xFormatter.is())
{ {
Any aValue = getNumberFormatProperty(m_xFormatter->getNumberFormatsSupplier(), m_nFormatKey, FIELD_STR_LOCALE); Any aValue = getNumberFormatProperty(m_xFormatter->getNumberFormatsSupplier(), m_nFormatKey, FIELD_STR_LOCALE);
OSL_ENSHURE(aValue.getValueType() == ::getCppuType((const ::com::sun::star::lang::Locale*)0), "OSQLParser::PredicateTree : invalid language property !"); OSL_ENSURE(aValue.getValueType() == ::getCppuType((const ::com::sun::star::lang::Locale*)0), "OSQLParser::PredicateTree : invalid language property !");
if (aValue.getValueType() == ::getCppuType((const ::com::sun::star::lang::Locale*)0)) if (aValue.getValueType() == ::getCppuType((const ::com::sun::star::lang::Locale*)0))
aValue >>= *m_pLocale; aValue >>= *m_pLocale;
@@ -3429,7 +3429,7 @@ OSQLParseNode* OSQLParser::predicateTree(::rtl::OUString& rErrorMessage, const :
// Stattdessen setzt die Parse-Routine jetzt den Member pParseTree // Stattdessen setzt die Parse-Routine jetzt den Member pParseTree
// - einfach diesen zurueckliefern: // - einfach diesen zurueckliefern:
OSL_ENSHURE(m_pParseTree != NULL,"OSQLParser: Parser hat keinen ParseTree geliefert"); OSL_ENSURE(m_pParseTree != NULL,"OSQLParser: Parser hat keinen ParseTree geliefert");
return m_pParseTree; return m_pParseTree;
} }
} }
@@ -3477,7 +3477,7 @@ OSQLParseNode* OSQLParser::predicateTree(::rtl::OUString& rErrorMessage, const :
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
::rtl::OUString OSQLParser::RuleIDToStr(sal_uInt32 nRuleID) ::rtl::OUString OSQLParser::RuleIDToStr(sal_uInt32 nRuleID)
{ {
OSL_ENSHURE(nRuleID >= (sizeof yytname/sizeof yytname[0]), "Invalid nRuleId!"); OSL_ENSURE(nRuleID >= (sizeof yytname/sizeof yytname[0]), "Invalid nRuleId!");
return ::rtl::OUString::createFromAscii(yytname[nRuleID]); return ::rtl::OUString::createFromAscii(yytname[nRuleID]);
} }
@@ -4133,8 +4133,8 @@ sal_Int16 OSQLParser::buildComparsionRule(OSQLParseNode*& pAppend,OSQLParseNode*
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
void OSQLParser::reduceLiteral(OSQLParseNode*& pLiteral, sal_Bool bAppendBlank) void OSQLParser::reduceLiteral(OSQLParseNode*& pLiteral, sal_Bool bAppendBlank)
{ {
OSL_ENSHURE(pLiteral->isRule(), "This is no ::com::sun::star::chaos::Rule"); OSL_ENSURE(pLiteral->isRule(), "This is no ::com::sun::star::chaos::Rule");
OSL_ENSHURE(pLiteral->count() == 2, "OSQLParser::ReduceLiteral() Invalid count"); OSL_ENSURE(pLiteral->count() == 2, "OSQLParser::ReduceLiteral() Invalid count");
OSQLParseNode* pTemp = pLiteral; OSQLParseNode* pTemp = pLiteral;
::rtl::OUString aValue; ::rtl::OUString aValue;
if (bAppendBlank) if (bAppendBlank)

View File

@@ -2,7 +2,7 @@
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
// //
// $Header: /zpool/svn/migration/cvs_rep_09_09_08/code/connectivity/source/parse/sqlflex.l,v 1.8 2001-03-12 14:09:02 oj Exp $ // $Header: /zpool/svn/migration/cvs_rep_09_09_08/code/connectivity/source/parse/sqlflex.l,v 1.9 2001-03-21 13:52:43 jl Exp $
// //
// Copyright 2000 Sun Microsystems, Inc. All Rights Reserved. // Copyright 2000 Sun Microsystems, Inc. All Rights Reserved.
// //
@@ -10,7 +10,7 @@
// OJ // OJ
// //
// Last change: // Last change:
// $Author: oj $ $Date: 2001-03-12 14:09:02 $ $Revision: 1.8 $ // $Author: jl $ $Date: 2001-03-21 13:52:43 $ $Revision: 1.9 $
// //
// Description: // Description:
// //
@@ -426,7 +426,7 @@ sal_Int32 gatherString( sal_Int32 delim, sal_Int32 nTyp)
*/ */
sal_Int32 gatherName(const sal_Char* text) sal_Int32 gatherName(const sal_Char* text)
{ {
OSL_ENSHURE(xxx_pGLOBAL_SQLSCAN,"You forgot to set the scanner!"); OSL_ENSURE(xxx_pGLOBAL_SQLSCAN,"You forgot to set the scanner!");
sal_Int32 nToken = xxx_pGLOBAL_SQLSCAN->getInternationalTokenID(text); sal_Int32 nToken = xxx_pGLOBAL_SQLSCAN->getInternationalTokenID(text);
switch (nToken) switch (nToken)
{ {
@@ -458,7 +458,7 @@ sal_Int32 gatherName(const sal_Char* text)
*/ */
sal_Int32 gatherNamePre(const sal_Char* text) sal_Int32 gatherNamePre(const sal_Char* text)
{ {
OSL_ENSHURE(xxx_pGLOBAL_SQLSCAN,"You forgot to set the scanner!"); OSL_ENSURE(xxx_pGLOBAL_SQLSCAN,"You forgot to set the scanner!");
sal_Int32 nToken = xxx_pGLOBAL_SQLSCAN->getInternationalTokenID(text); sal_Int32 nToken = xxx_pGLOBAL_SQLSCAN->getInternationalTokenID(text);
switch (nToken) switch (nToken)
{ {
@@ -524,7 +524,7 @@ void OSQLScanner::SQLyyerror(sal_Char *fmt)
return; return;
IN_SQLyyerror = true; IN_SQLyyerror = true;
OSL_ENSHURE(m_pContext, "OSQLScanner::SQLyyerror: No Context set"); OSL_ENSURE(m_pContext, "OSQLScanner::SQLyyerror: No Context set");
m_sErrorMessage = ::rtl::OUString(fmt,strlen(fmt),RTL_TEXTENCODING_UTF8); m_sErrorMessage = ::rtl::OUString(fmt,strlen(fmt),RTL_TEXTENCODING_UTF8);
if (m_nCurrentPos < m_sStatement.getLength()) if (m_nCurrentPos < m_sStatement.getLength())
{ {
@@ -596,7 +596,7 @@ sal_Int32 OSQLScanner::SQLyygetc(void)
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
sal_Int32 OSQLScanner::getInternationalTokenID(const sal_Char* sToken) const sal_Int32 OSQLScanner::getInternationalTokenID(const sal_Char* sToken) const
{ {
OSL_ENSHURE(m_pContext, "OSQLScanner::getInternationalTokenID: No Context set"); OSL_ENSURE(m_pContext, "OSQLScanner::getInternationalTokenID: No Context set");
return (m_bInternational) ? m_pContext->getIntlKeyCode(::rtl::OString(sToken)) : 0; return (m_bInternational) ? m_pContext->getIntlKeyCode(::rtl::OString(sToken)) : 0;
} }
// ------------------------------------------------------------------------- // -------------------------------------------------------------------------

View File

@@ -2,9 +2,9 @@
* *
* $RCSfile: sqliterator.cxx,v $ * $RCSfile: sqliterator.cxx,v $
* *
* $Revision: 1.16 $ * $Revision: 1.17 $
* *
* last change: $Author: oj $ $Date: 2001-03-13 08:24:04 $ * last change: $Author: jl $ $Date: 2001-03-21 13:52:43 $
* *
* The Contents of this file are made available subject to the terms of * The Contents of this file are made available subject to the terms of
* either of the following licenses * either of the following licenses
@@ -220,7 +220,7 @@ void OSQLParseTreeIterator::traverseOneTableName(const OSQLParseNode * pTableNam
{ {
OSL_ENSHURE(pTableName != NULL,"OSQLParseTreeIterator::traverseOneTableName: pTableName == NULL"); OSL_ENSURE(pTableName != NULL,"OSQLParseTreeIterator::traverseOneTableName: pTableName == NULL");
Any aCatalog; Any aCatalog;
::rtl::OUString aSchema,aTableName,aComposedName; ::rtl::OUString aSchema,aTableName,aComposedName;
@@ -276,7 +276,7 @@ void OSQLParseTreeIterator::traverseOneTableName(const OSQLParseNode * pTableNam
} }
catch(Exception&) catch(Exception&)
{ {
OSL_ENSHURE(0,"traverseOneTableName: Exception occured!"); OSL_ENSURE(0,"traverseOneTableName: Exception occured!");
} }
} }
@@ -365,8 +365,8 @@ void OSQLParseTreeIterator::getSelect_statement(OSQLParseNode *pSelect)
} }
OSQLParseNode * pTableRefCommalist = pSelect->getChild(3)->getChild(0)->getChild(1); OSQLParseNode * pTableRefCommalist = pSelect->getChild(3)->getChild(0)->getChild(1);
OSL_ENSHURE(pTableRefCommalist != NULL,"OSQLParseTreeIterator: Fehler im Parse Tree"); OSL_ENSURE(pTableRefCommalist != NULL,"OSQLParseTreeIterator: Fehler im Parse Tree");
OSL_ENSHURE(SQL_ISRULE(pTableRefCommalist,table_ref_commalist),"OSQLParseTreeIterator: Fehler im Parse Tree"); OSL_ENSURE(SQL_ISRULE(pTableRefCommalist,table_ref_commalist),"OSQLParseTreeIterator: Fehler im Parse Tree");
OSQLParseNode * pTableName = NULL; OSQLParseNode * pTableName = NULL;
::rtl::OUString aTableRange; ::rtl::OUString aTableRange;
@@ -597,7 +597,7 @@ void OSQLParseTreeIterator::traverseSelectColumnNames(const OSQLParseNode* pSele
if (SQL_ISRULE(pColumnRef,column_ref)) if (SQL_ISRULE(pColumnRef,column_ref))
{ {
getColumnRange(pColumnRef,aColumnName,aTableRange); getColumnRange(pColumnRef,aColumnName,aTableRange);
OSL_ENSHURE(aColumnName.getLength(),"Columnname darf nicht leer sein"); OSL_ENSURE(aColumnName.getLength(),"Columnname darf nicht leer sein");
} }
else /*if (SQL_ISRULE(pColumnRef,general_set_fct) || SQL_ISRULE(pColumnRef,set_fct_spec) || else /*if (SQL_ISRULE(pColumnRef,general_set_fct) || SQL_ISRULE(pColumnRef,set_fct_spec) ||
SQL_ISRULE(pColumnRef,position_exp) || SQL_ISRULE(pColumnRef,extract_exp) || SQL_ISRULE(pColumnRef,position_exp) || SQL_ISRULE(pColumnRef,extract_exp) ||
@@ -660,34 +660,34 @@ void OSQLParseTreeIterator::traverseOrderByColumnNames(const OSQLParseNode* pSel
return; return;
} }
OSL_ENSHURE(pSelectNode->count() >= 4,"OSQLParseTreeIterator: Fehler im Parse Tree"); OSL_ENSURE(pSelectNode->count() >= 4,"OSQLParseTreeIterator: Fehler im Parse Tree");
OSQLParseNode * pTableExp = pSelectNode->getChild(3); OSQLParseNode * pTableExp = pSelectNode->getChild(3);
OSL_ENSHURE(pTableExp != NULL,"OSQLParseTreeIterator: Fehler im Parse Tree"); OSL_ENSURE(pTableExp != NULL,"OSQLParseTreeIterator: Fehler im Parse Tree");
OSL_ENSHURE(SQL_ISRULE(pTableExp,table_exp),"OSQLParseTreeIterator: Fehler im Parse Tree"); OSL_ENSURE(SQL_ISRULE(pTableExp,table_exp),"OSQLParseTreeIterator: Fehler im Parse Tree");
OSL_ENSHURE(pTableExp->count() == 5,"OSQLParseTreeIterator: Fehler im Parse Tree"); OSL_ENSURE(pTableExp->count() == 5,"OSQLParseTreeIterator: Fehler im Parse Tree");
OSQLParseNode * pOptOrderByClause = pTableExp->getChild(4); OSQLParseNode * pOptOrderByClause = pTableExp->getChild(4);
OSL_ENSHURE(pOptOrderByClause != NULL,"OSQLParseTreeIterator: Fehler im Parse Tree"); OSL_ENSURE(pOptOrderByClause != NULL,"OSQLParseTreeIterator: Fehler im Parse Tree");
OSL_ENSHURE(SQL_ISRULE(pOptOrderByClause,opt_order_by_clause),"OSQLParseTreeIterator: Fehler im Parse Tree"); OSL_ENSURE(SQL_ISRULE(pOptOrderByClause,opt_order_by_clause),"OSQLParseTreeIterator: Fehler im Parse Tree");
if (pOptOrderByClause->count() == 0) if (pOptOrderByClause->count() == 0)
return; return;
OSL_ENSHURE(pOptOrderByClause->count() == 3,"OSQLParseTreeIterator: Fehler im Parse Tree"); OSL_ENSURE(pOptOrderByClause->count() == 3,"OSQLParseTreeIterator: Fehler im Parse Tree");
OSQLParseNode * pOrderingSpecCommalist = pOptOrderByClause->getChild(2); OSQLParseNode * pOrderingSpecCommalist = pOptOrderByClause->getChild(2);
OSL_ENSHURE(pOrderingSpecCommalist != NULL,"OSQLParseTreeIterator: Fehler im Parse Tree"); OSL_ENSURE(pOrderingSpecCommalist != NULL,"OSQLParseTreeIterator: Fehler im Parse Tree");
OSL_ENSHURE(SQL_ISRULE(pOrderingSpecCommalist,ordering_spec_commalist),"OSQLParseTreeIterator: Fehler im Parse Tree"); OSL_ENSURE(SQL_ISRULE(pOrderingSpecCommalist,ordering_spec_commalist),"OSQLParseTreeIterator: Fehler im Parse Tree");
OSL_ENSHURE(pOrderingSpecCommalist->count() > 0,"OSQLParseTreeIterator: Fehler im Parse Tree"); OSL_ENSURE(pOrderingSpecCommalist->count() > 0,"OSQLParseTreeIterator: Fehler im Parse Tree");
::rtl::OUString aColumnName,aColumnAlias; ::rtl::OUString aColumnName,aColumnAlias;
::rtl::OUString aTableRange; ::rtl::OUString aTableRange;
for (sal_uInt32 i = 0; i < pOrderingSpecCommalist->count(); i++) for (sal_uInt32 i = 0; i < pOrderingSpecCommalist->count(); i++)
{ {
OSQLParseNode * pOrderingSpec = pOrderingSpecCommalist->getChild(i); OSQLParseNode * pOrderingSpec = pOrderingSpecCommalist->getChild(i);
OSL_ENSHURE(pOrderingSpec != NULL,"OSQLParseTreeIterator: Fehler im Parse Tree"); OSL_ENSURE(pOrderingSpec != NULL,"OSQLParseTreeIterator: Fehler im Parse Tree");
OSL_ENSHURE(SQL_ISRULE(pOrderingSpec,ordering_spec),"OSQLParseTreeIterator: Fehler im Parse Tree"); OSL_ENSURE(SQL_ISRULE(pOrderingSpec,ordering_spec),"OSQLParseTreeIterator: Fehler im Parse Tree");
OSL_ENSHURE(pOrderingSpec->count() == 2,"OSQLParseTreeIterator: Fehler im Parse Tree"); OSL_ENSURE(pOrderingSpec->count() == 2,"OSQLParseTreeIterator: Fehler im Parse Tree");
OSQLParseNode * pColumnRef = pOrderingSpec->getChild(0); OSQLParseNode * pColumnRef = pOrderingSpec->getChild(0);
aTableRange = ::rtl::OUString(); aTableRange = ::rtl::OUString();
@@ -700,16 +700,16 @@ void OSQLParseTreeIterator::traverseOrderByColumnNames(const OSQLParseNode* pSel
else // eine Expression else // eine Expression
pColumnRef->parseNodeToStr(aColumnName,m_xDatabaseMetaData,NULL,sal_False,sal_False); pColumnRef->parseNodeToStr(aColumnName,m_xDatabaseMetaData,NULL,sal_False,sal_False);
OSL_ENSHURE(aColumnName.getLength(),"aColumnName darf nicht leer sein"); OSL_ENSURE(aColumnName.getLength(),"aColumnName darf nicht leer sein");
} }
else else
{ // here I found a predicate { // here I found a predicate
pColumnRef->parseNodeToStr(aColumnName,m_xDatabaseMetaData,NULL,sal_False,sal_False); pColumnRef->parseNodeToStr(aColumnName,m_xDatabaseMetaData,NULL,sal_False,sal_False);
} }
OSL_ENSHURE(pColumnRef != NULL,"OSQLParseTreeIterator: Fehler im Parse Tree"); OSL_ENSURE(pColumnRef != NULL,"OSQLParseTreeIterator: Fehler im Parse Tree");
// Ascending/Descending // Ascending/Descending
OSQLParseNode * pOptAscDesc = pOrderingSpec->getChild(1); OSQLParseNode * pOptAscDesc = pOrderingSpec->getChild(1);
OSL_ENSHURE(pOptAscDesc != NULL,"OSQLParseTreeIterator: Fehler im Parse Tree"); OSL_ENSURE(pOptAscDesc != NULL,"OSQLParseTreeIterator: Fehler im Parse Tree");
sal_Bool bAscending = sal_True; sal_Bool bAscending = sal_True;
if(pOptAscDesc) if(pOptAscDesc)
@@ -752,22 +752,22 @@ void OSQLParseTreeIterator::traverseSelectionCriteria(const OSQLParseNode* pSele
traverseSelectionCriteria(pSelectNode->getChild(3)); traverseSelectionCriteria(pSelectNode->getChild(3));
return; return;
} }
OSL_ENSHURE(pSelectNode->count() >= 4,"OSQLParseTreeIterator: Fehler im Parse Tree"); OSL_ENSURE(pSelectNode->count() >= 4,"OSQLParseTreeIterator: Fehler im Parse Tree");
OSQLParseNode * pTableExp = pSelectNode->getChild(3); OSQLParseNode * pTableExp = pSelectNode->getChild(3);
OSL_ENSHURE(pTableExp != NULL,"OSQLParseTreeIterator: Fehler im Parse Tree"); OSL_ENSURE(pTableExp != NULL,"OSQLParseTreeIterator: Fehler im Parse Tree");
OSL_ENSHURE(SQL_ISRULE(pTableExp,table_exp),"OSQLParseTreeIterator: Fehler im Parse Tree"); OSL_ENSURE(SQL_ISRULE(pTableExp,table_exp),"OSQLParseTreeIterator: Fehler im Parse Tree");
OSL_ENSHURE(pTableExp->count() == 5,"OSQLParseTreeIterator: Fehler im Parse Tree"); OSL_ENSURE(pTableExp->count() == 5,"OSQLParseTreeIterator: Fehler im Parse Tree");
pWhereClause = pTableExp->getChild(1); pWhereClause = pTableExp->getChild(1);
} else if (SQL_ISRULE(pSelectNode,update_statement_searched)) { } else if (SQL_ISRULE(pSelectNode,update_statement_searched)) {
OSL_ENSHURE(pSelectNode->count() == 5,"OSQLParseTreeIterator: Fehler im Parse Tree"); OSL_ENSURE(pSelectNode->count() == 5,"OSQLParseTreeIterator: Fehler im Parse Tree");
pWhereClause = pSelectNode->getChild(4); pWhereClause = pSelectNode->getChild(4);
} else if (SQL_ISRULE(pSelectNode,update_statement_positioned)) { } else if (SQL_ISRULE(pSelectNode,update_statement_positioned)) {
// nyi // nyi
OSL_ASSERT("OSQLParseTreeIterator::getSelectionCriteria: positioned nyi"); OSL_ASSERT("OSQLParseTreeIterator::getSelectionCriteria: positioned nyi");
} else if (SQL_ISRULE(pSelectNode,delete_statement_searched)) { } else if (SQL_ISRULE(pSelectNode,delete_statement_searched)) {
OSL_ENSHURE(pSelectNode->count() == 4,"OSQLParseTreeIterator: Fehler im Parse Tree"); OSL_ENSURE(pSelectNode->count() == 4,"OSQLParseTreeIterator: Fehler im Parse Tree");
pWhereClause = pSelectNode->getChild(3); pWhereClause = pSelectNode->getChild(3);
} else if (SQL_ISRULE(pSelectNode,delete_statement_positioned)) { } else if (SQL_ISRULE(pSelectNode,delete_statement_positioned)) {
// nyi // nyi
@@ -780,15 +780,15 @@ void OSQLParseTreeIterator::traverseSelectionCriteria(const OSQLParseNode* pSele
if (! SQL_ISRULE(pWhereClause,where_clause)) { if (! SQL_ISRULE(pWhereClause,where_clause)) {
// Die Where Clause ist meistens optional, d. h. es koennte sich auch // Die Where Clause ist meistens optional, d. h. es koennte sich auch
// um "optional_where_clause" handeln. // um "optional_where_clause" handeln.
OSL_ENSHURE(SQL_ISRULE(pWhereClause,opt_where_clause),"OSQLParseTreeIterator: Fehler im Parse Tree"); OSL_ENSURE(SQL_ISRULE(pWhereClause,opt_where_clause),"OSQLParseTreeIterator: Fehler im Parse Tree");
return; return;
} }
// Wenn es aber eine where_clause ist, dann darf sie nicht leer sein: // Wenn es aber eine where_clause ist, dann darf sie nicht leer sein:
OSL_ENSHURE(pWhereClause->count() == 2,"OSQLParseTreeIterator: Fehler im Parse Tree"); OSL_ENSURE(pWhereClause->count() == 2,"OSQLParseTreeIterator: Fehler im Parse Tree");
OSQLParseNode * pComparisonPredicate = pWhereClause->getChild(1); OSQLParseNode * pComparisonPredicate = pWhereClause->getChild(1);
OSL_ENSHURE(pComparisonPredicate != NULL,"OSQLParseTreeIterator: Fehler im Parse Tree"); OSL_ENSURE(pComparisonPredicate != NULL,"OSQLParseTreeIterator: Fehler im Parse Tree");
// //
@@ -929,7 +929,7 @@ void OSQLParseTreeIterator::traverseANDCriteria(OSQLParseNode * pSearchCondition
{ {
OSQLPredicateType ePredicateType; OSQLPredicateType ePredicateType;
OSL_ENSHURE(pSearchCondition->count() >= 4,"OSQLParseTreeIterator: Fehler im Parse Tree"); OSL_ENSURE(pSearchCondition->count() >= 4,"OSQLParseTreeIterator: Fehler im Parse Tree");
sal_Int32 nCurentPos = pSearchCondition->count()-2; sal_Int32 nCurentPos = pSearchCondition->count()-2;
@@ -941,8 +941,8 @@ void OSQLParseTreeIterator::traverseANDCriteria(OSQLParseNode * pSearchCondition
else else
ePredicateType = SQL_PRED_LIKE; ePredicateType = SQL_PRED_LIKE;
OSL_ENSHURE(pNum_value_exp != NULL,"OSQLParseTreeIterator: Fehler im Parse Tree"); OSL_ENSURE(pNum_value_exp != NULL,"OSQLParseTreeIterator: Fehler im Parse Tree");
OSL_ENSHURE(pOptEscape != NULL,"OSQLParseTreeIterator: Fehler im Parse Tree"); OSL_ENSURE(pOptEscape != NULL,"OSQLParseTreeIterator: Fehler im Parse Tree");
if (pOptEscape->count() != 0) if (pOptEscape->count() != 0)
{ {
@@ -971,8 +971,8 @@ void OSQLParseTreeIterator::traverseANDCriteria(OSQLParseNode * pSearchCondition
{ {
OSQLPredicateType ePredicateType; OSQLPredicateType ePredicateType;
OSL_ENSHURE(pSearchCondition->count() >= 3,"OSQLParseTreeIterator: Fehler im Parse Tree"); OSL_ENSURE(pSearchCondition->count() >= 3,"OSQLParseTreeIterator: Fehler im Parse Tree");
OSL_ENSHURE(SQL_ISTOKEN(pSearchCondition->getChild(1),IS),"OSQLParseTreeIterator: Fehler im Parse Tree"); OSL_ENSURE(SQL_ISTOKEN(pSearchCondition->getChild(1),IS),"OSQLParseTreeIterator: Fehler im Parse Tree");
if (SQL_ISTOKEN(pSearchCondition->getChild(2),NOT) ) if (SQL_ISTOKEN(pSearchCondition->getChild(2),NOT) )
ePredicateType = SQL_PRED_ISNOTNULL; ePredicateType = SQL_PRED_ISNOTNULL;
@@ -1009,7 +1009,7 @@ void OSQLParseTreeIterator::traverseOnePredicate(
{ {
if (SQL_ISRULE(pParseNode,parameter)) if (SQL_ISRULE(pParseNode,parameter))
{ {
OSL_ENSHURE(pParseNode->count() > 0,"OSQLParseTreeIterator: Fehler im Parse Tree"); OSL_ENSURE(pParseNode->count() > 0,"OSQLParseTreeIterator: Fehler im Parse Tree");
OSQLParseNode * pMark = pParseNode->getChild(0); OSQLParseNode * pMark = pParseNode->getChild(0);
::rtl::OUString aParameterName; ::rtl::OUString aParameterName;
@@ -1449,11 +1449,11 @@ const OSQLParseNode* OSQLParseTreeIterator::getWhereTree() const
OSQLParseNode * pWhereClause = NULL; OSQLParseNode * pWhereClause = NULL;
if(getStatementType() == SQL_STATEMENT_SELECT) if(getStatementType() == SQL_STATEMENT_SELECT)
{ {
OSL_ENSHURE(m_pParseTree->count() >= 4,"ParseTreeIterator: Fehler im Parse Tree"); OSL_ENSURE(m_pParseTree->count() >= 4,"ParseTreeIterator: Fehler im Parse Tree");
OSQLParseNode * pTableExp = m_pParseTree->getChild(3); OSQLParseNode * pTableExp = m_pParseTree->getChild(3);
OSL_ENSHURE(pTableExp != NULL,"OSQLParseTreeIterator: Fehler im Parse Tree"); OSL_ENSURE(pTableExp != NULL,"OSQLParseTreeIterator: Fehler im Parse Tree");
OSL_ENSHURE(SQL_ISRULE(pTableExp,table_exp),"OSQLParseTreeIterator: Fehler im Parse Tree"); OSL_ENSURE(SQL_ISRULE(pTableExp,table_exp),"OSQLParseTreeIterator: Fehler im Parse Tree");
OSL_ENSHURE(pTableExp->count() == 5,"OSQLParseTreeIterator: Fehler im Parse Tree"); OSL_ENSURE(pTableExp->count() == 5,"OSQLParseTreeIterator: Fehler im Parse Tree");
pWhereClause = pTableExp->getChild(1); pWhereClause = pTableExp->getChild(1);
} }
@@ -1478,11 +1478,11 @@ const OSQLParseNode* OSQLParseTreeIterator::getOrderTree() const
// Parse Tree analysieren (je nach Statement-Typ) // Parse Tree analysieren (je nach Statement-Typ)
// und Zeiger auf ORDER-Klausel setzen: // und Zeiger auf ORDER-Klausel setzen:
OSQLParseNode * pOrderClause = NULL; OSQLParseNode * pOrderClause = NULL;
OSL_ENSHURE(m_pParseTree->count() >= 4,"ParseTreeIterator: Fehler im Parse Tree"); OSL_ENSURE(m_pParseTree->count() >= 4,"ParseTreeIterator: Fehler im Parse Tree");
OSQLParseNode * pTableExp = m_pParseTree->getChild(3); OSQLParseNode * pTableExp = m_pParseTree->getChild(3);
OSL_ENSHURE(pTableExp != NULL,"OSQLParseTreeIterator: Fehler im Parse Tree"); OSL_ENSURE(pTableExp != NULL,"OSQLParseTreeIterator: Fehler im Parse Tree");
OSL_ENSHURE(SQL_ISRULE(pTableExp,table_exp),"OSQLParseTreeIterator: Fehler im Parse Tree"); OSL_ENSURE(SQL_ISRULE(pTableExp,table_exp),"OSQLParseTreeIterator: Fehler im Parse Tree");
OSL_ENSHURE(pTableExp->count() == 5,"OSQLParseTreeIterator: Fehler im Parse Tree"); OSL_ENSURE(pTableExp->count() == 5,"OSQLParseTreeIterator: Fehler im Parse Tree");
pOrderClause = pTableExp->getChild(4); pOrderClause = pTableExp->getChild(4);
// Wenn es aber eine order_by ist, dann darf sie nicht leer sein: // Wenn es aber eine order_by ist, dann darf sie nicht leer sein:
@@ -1501,11 +1501,11 @@ const OSQLParseNode* OSQLParseTreeIterator::getGroupByTree() const
// Parse Tree analysieren (je nach Statement-Typ) // Parse Tree analysieren (je nach Statement-Typ)
// und Zeiger auf ORDER-Klausel setzen: // und Zeiger auf ORDER-Klausel setzen:
OSQLParseNode * pGroupClause = NULL; OSQLParseNode * pGroupClause = NULL;
OSL_ENSHURE(m_pParseTree->count() >= 4,"ParseTreeIterator: Fehler im Parse Tree"); OSL_ENSURE(m_pParseTree->count() >= 4,"ParseTreeIterator: Fehler im Parse Tree");
OSQLParseNode * pTableExp = m_pParseTree->getChild(3); OSQLParseNode * pTableExp = m_pParseTree->getChild(3);
OSL_ENSHURE(pTableExp != NULL,"OSQLParseTreeIterator: Fehler im Parse Tree"); OSL_ENSURE(pTableExp != NULL,"OSQLParseTreeIterator: Fehler im Parse Tree");
OSL_ENSHURE(SQL_ISRULE(pTableExp,table_exp),"OSQLParseTreeIterator: Fehler im Parse Tree"); OSL_ENSURE(SQL_ISRULE(pTableExp,table_exp),"OSQLParseTreeIterator: Fehler im Parse Tree");
OSL_ENSHURE(pTableExp->count() == 5,"OSQLParseTreeIterator: Fehler im Parse Tree"); OSL_ENSURE(pTableExp->count() == 5,"OSQLParseTreeIterator: Fehler im Parse Tree");
pGroupClause = pTableExp->getChild(3); pGroupClause = pTableExp->getChild(3);
// Wenn es aber eine order_by ist, dann darf sie nicht leer sein: // Wenn es aber eine order_by ist, dann darf sie nicht leer sein:
@@ -1524,11 +1524,11 @@ const OSQLParseNode* OSQLParseTreeIterator::getHavingTree() const
// Parse Tree analysieren (je nach Statement-Typ) // Parse Tree analysieren (je nach Statement-Typ)
// und Zeiger auf ORDER-Klausel setzen: // und Zeiger auf ORDER-Klausel setzen:
OSQLParseNode * pHavingClause = NULL; OSQLParseNode * pHavingClause = NULL;
OSL_ENSHURE(m_pParseTree->count() >= 4,"ParseTreeIterator: Fehler im Parse Tree"); OSL_ENSURE(m_pParseTree->count() >= 4,"ParseTreeIterator: Fehler im Parse Tree");
OSQLParseNode * pTableExp = m_pParseTree->getChild(3); OSQLParseNode * pTableExp = m_pParseTree->getChild(3);
OSL_ENSHURE(pTableExp != NULL,"OSQLParseTreeIterator: Fehler im Parse Tree"); OSL_ENSURE(pTableExp != NULL,"OSQLParseTreeIterator: Fehler im Parse Tree");
OSL_ENSHURE(SQL_ISRULE(pTableExp,table_exp),"OSQLParseTreeIterator: Fehler im Parse Tree"); OSL_ENSURE(SQL_ISRULE(pTableExp,table_exp),"OSQLParseTreeIterator: Fehler im Parse Tree");
OSL_ENSHURE(pTableExp->count() == 5,"OSQLParseTreeIterator: Fehler im Parse Tree"); OSL_ENSURE(pTableExp->count() == 5,"OSQLParseTreeIterator: Fehler im Parse Tree");
pHavingClause = pTableExp->getChild(3); pHavingClause = pTableExp->getChild(3);
// Wenn es aber eine order_by ist, dann darf sie nicht leer sein: // Wenn es aber eine order_by ist, dann darf sie nicht leer sein:

View File

@@ -2,9 +2,9 @@
* *
* $RCSfile: sqlnode.cxx,v $ * $RCSfile: sqlnode.cxx,v $
* *
* $Revision: 1.12 $ * $Revision: 1.13 $
* *
* last change: $Author: oj $ $Date: 2001-03-13 08:24:04 $ * last change: $Author: jl $ $Date: 2001-03-21 13:52:43 $
* *
* The Contents of this file are made available subject to the terms of * The Contents of this file are made available subject to the terms of
* either of the following licenses * either of the following licenses
@@ -226,7 +226,7 @@ OSQLParseNode::OSQLParseNode(const sal_Char * pNewValue,
, m_pParent(NULL) , m_pParent(NULL)
{ {
OSL_ENSHURE(m_eNodeType >= SQL_NODE_RULE && m_eNodeType <= SQL_NODE_ACCESS_DATE,"OSQLParseNode: mit unzulaessigem NodeType konstruiert"); OSL_ENSURE(m_eNodeType >= SQL_NODE_RULE && m_eNodeType <= SQL_NODE_ACCESS_DATE,"OSQLParseNode: mit unzulaessigem NodeType konstruiert");
} }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
OSQLParseNode::OSQLParseNode(const ::rtl::OString &_rNewValue, OSQLParseNode::OSQLParseNode(const ::rtl::OString &_rNewValue,
@@ -238,7 +238,7 @@ OSQLParseNode::OSQLParseNode(const ::rtl::OString &_rNewValue,
, m_pParent(NULL) , m_pParent(NULL)
{ {
OSL_ENSHURE(m_eNodeType >= SQL_NODE_RULE && m_eNodeType <= SQL_NODE_ACCESS_DATE,"OSQLParseNode: mit unzulaessigem NodeType konstruiert"); OSL_ENSURE(m_eNodeType >= SQL_NODE_RULE && m_eNodeType <= SQL_NODE_ACCESS_DATE,"OSQLParseNode: mit unzulaessigem NodeType konstruiert");
} }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
OSQLParseNode::OSQLParseNode(const sal_Unicode * pNewValue, OSQLParseNode::OSQLParseNode(const sal_Unicode * pNewValue,
@@ -250,7 +250,7 @@ OSQLParseNode::OSQLParseNode(const sal_Unicode * pNewValue,
, m_pParent(NULL) , m_pParent(NULL)
{ {
OSL_ENSHURE(m_eNodeType >= SQL_NODE_RULE && m_eNodeType <= SQL_NODE_ACCESS_DATE,"OSQLParseNode: mit unzulaessigem NodeType konstruiert"); OSL_ENSURE(m_eNodeType >= SQL_NODE_RULE && m_eNodeType <= SQL_NODE_ACCESS_DATE,"OSQLParseNode: mit unzulaessigem NodeType konstruiert");
} }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
OSQLParseNode::OSQLParseNode(const ::rtl::OUString &_rNewValue, OSQLParseNode::OSQLParseNode(const ::rtl::OUString &_rNewValue,
@@ -262,7 +262,7 @@ OSQLParseNode::OSQLParseNode(const ::rtl::OUString &_rNewValue,
, m_pParent(NULL) , m_pParent(NULL)
{ {
OSL_ENSHURE(m_eNodeType >= SQL_NODE_RULE && m_eNodeType <= SQL_NODE_ACCESS_DATE,"OSQLParseNode: mit unzulaessigem NodeType konstruiert"); OSL_ENSURE(m_eNodeType >= SQL_NODE_RULE && m_eNodeType <= SQL_NODE_ACCESS_DATE,"OSQLParseNode: mit unzulaessigem NodeType konstruiert");
} }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
OSQLParseNode::OSQLParseNode(const OSQLParseNode& rParseNode) OSQLParseNode::OSQLParseNode(const OSQLParseNode& rParseNode)
@@ -345,9 +345,9 @@ OSQLParseNode::~OSQLParseNode()
void OSQLParseNode::append(OSQLParseNode* pNewNode) void OSQLParseNode::append(OSQLParseNode* pNewNode)
{ {
OSL_ENSHURE(pNewNode != NULL, "OSQLParseNode: ungueltiger NewSubTree"); OSL_ENSURE(pNewNode != NULL, "OSQLParseNode: ungueltiger NewSubTree");
OSL_ENSHURE(pNewNode->getParent() == NULL, "OSQLParseNode: Knoten ist kein Waise"); OSL_ENSURE(pNewNode->getParent() == NULL, "OSQLParseNode: Knoten ist kein Waise");
OSL_ENSHURE(::std::find(m_aChilds.begin(), m_aChilds.end(), pNewNode) == m_aChilds.end(), OSL_ENSURE(::std::find(m_aChilds.begin(), m_aChilds.end(), pNewNode) == m_aChilds.end(),
"OSQLParseNode::append() Node already element of parent"); "OSQLParseNode::append() Node already element of parent");
// stelle Verbindung zum getParent her: // stelle Verbindung zum getParent her:
@@ -377,7 +377,7 @@ void OSQLParseNode::parseNodeToPredicateStr(::rtl::OUString& rString,
const OParseContext* pContext ) const const OParseContext* pContext ) const
{ {
OSL_ENSHURE(xFormatter.is(), "OSQLParseNode::parseNodeToPredicateStr:: no formatter!"); OSL_ENSURE(xFormatter.is(), "OSQLParseNode::parseNodeToPredicateStr:: no formatter!");
if (xFormatter.is()) if (xFormatter.is())
parseNodeToStr(rString, xMeta, xFormatter, Reference< XPropertySet >(), rIntl, pContext, sal_True, sal_True, _cDec, sal_True); parseNodeToStr(rString, xMeta, xFormatter, Reference< XPropertySet >(), rIntl, pContext, sal_True, sal_True, _cDec, sal_True);
@@ -393,7 +393,7 @@ void OSQLParseNode::parseNodeToPredicateStr(::rtl::OUString& rString,
const OParseContext* pContext ) const const OParseContext* pContext ) const
{ {
OSL_ENSHURE(xFormatter.is(), "OSQLParseNode::parseNodeToPredicateStr:: no formatter!"); OSL_ENSURE(xFormatter.is(), "OSQLParseNode::parseNodeToPredicateStr:: no formatter!");
if (xFormatter.is()) if (xFormatter.is())
parseNodeToStr(rString, xMeta, xFormatter, _xField, rIntl, pContext, sal_True, sal_True, _cDec, sal_True); parseNodeToStr(rString, xMeta, xFormatter, _xField, rIntl, pContext, sal_True, sal_True, _cDec, sal_True);
@@ -412,7 +412,7 @@ void OSQLParseNode::parseNodeToStr(::rtl::OUString& rString,
sal_Bool bPredicate) const sal_Bool bPredicate) const
{ {
OSL_ENSHURE(xMeta.is(), "OSQLParseNode::parseNodeToStr:: no meta data!"); OSL_ENSURE(xMeta.is(), "OSQLParseNode::parseNodeToStr:: no meta data!");
if (xMeta.is()) if (xMeta.is())
{ {
@@ -728,7 +728,7 @@ void OSQLParseNode::tableRangeNodeToStr(::rtl::OUString& rString, const SQLParse
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
void OSQLParseNode::likeNodeToStr(::rtl::OUString& rString, const SQLParseNodeParameter& rParam) const void OSQLParseNode::likeNodeToStr(::rtl::OUString& rString, const SQLParseNodeParameter& rParam) const
{ {
OSL_ENSHURE(count() >= 4,"count != 5: Prepare for GPF"); OSL_ENSURE(count() >= 4,"count != 5: Prepare for GPF");
const OSQLParseNode* pEscNode = NULL; const OSQLParseNode* pEscNode = NULL;
const OSQLParseNode* pParaNode = NULL; const OSQLParseNode* pParaNode = NULL;
@@ -751,7 +751,7 @@ void OSQLParseNode::likeNodeToStr(::rtl::OUString& rString, const SQLParseNodePa
} }
catch ( Exception& ) catch ( Exception& )
{ {
OSL_ENSHURE(0,"OSQLParseNode::likeNodeToStr Exception occured!"); OSL_ENSURE(0,"OSQLParseNode::likeNodeToStr Exception occured!");
} }
const OSQLParseNode* pCol = m_aChilds[0]->getChild(m_aChilds[0]->count()-1); const OSQLParseNode* pCol = m_aChilds[0]->getChild(m_aChilds[0]->count()-1);
@@ -1325,8 +1325,8 @@ void OSQLParseNode::showParseTree(::rtl::OUString& rString, sal_uInt32 nLevel)
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
void OSQLParseNode::insert(sal_uInt32 nPos, OSQLParseNode* pNewSubTree) void OSQLParseNode::insert(sal_uInt32 nPos, OSQLParseNode* pNewSubTree)
{ {
OSL_ENSHURE(pNewSubTree != NULL, "OSQLParseNode: ungueltiger NewSubTree"); OSL_ENSURE(pNewSubTree != NULL, "OSQLParseNode: ungueltiger NewSubTree");
OSL_ENSHURE(pNewSubTree->getParent() == NULL, "OSQLParseNode: Knoten ist kein Waise"); OSL_ENSURE(pNewSubTree->getParent() == NULL, "OSQLParseNode: Knoten ist kein Waise");
// stelle Verbindung zum getParent her: // stelle Verbindung zum getParent her:
pNewSubTree->setParent( this ); pNewSubTree->setParent( this );
@@ -1349,7 +1349,7 @@ OSQLParseNode* OSQLParseNode::removeAt(sal_uInt32 nPos)
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
OSQLParseNode* OSQLParseNode::remove(OSQLParseNode* pSubTree) OSQLParseNode* OSQLParseNode::remove(OSQLParseNode* pSubTree)
{ {
OSL_ENSHURE(pSubTree != NULL, "OSQLParseNode: ungueltiger SubTree"); OSL_ENSURE(pSubTree != NULL, "OSQLParseNode: ungueltiger SubTree");
::std::vector<OSQLParseNode*>::iterator aPos = ::std::find(m_aChilds.begin(), m_aChilds.end(), pSubTree); ::std::vector<OSQLParseNode*>::iterator aPos = ::std::find(m_aChilds.begin(), m_aChilds.end(), pSubTree);
if (aPos != m_aChilds.end()) if (aPos != m_aChilds.end())
{ {
@@ -1366,10 +1366,10 @@ OSQLParseNode* OSQLParseNode::remove(OSQLParseNode* pSubTree)
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
OSQLParseNode* OSQLParseNode::replaceAt(sal_uInt32 nPos, OSQLParseNode* pNewSubNode) OSQLParseNode* OSQLParseNode::replaceAt(sal_uInt32 nPos, OSQLParseNode* pNewSubNode)
{ {
OSL_ENSHURE(pNewSubNode != NULL, "OSQLParseNode: invalid nodes"); OSL_ENSURE(pNewSubNode != NULL, "OSQLParseNode: invalid nodes");
OSL_ENSHURE(pNewSubNode->getParent() == NULL, "OSQLParseNode: node already has getParent"); OSL_ENSURE(pNewSubNode->getParent() == NULL, "OSQLParseNode: node already has getParent");
OSL_ENSHURE(nPos < m_aChilds.size(), "OSQLParseNode: invalid position"); OSL_ENSURE(nPos < m_aChilds.size(), "OSQLParseNode: invalid position");
OSL_ENSHURE(::std::find(m_aChilds.begin(), m_aChilds.end(), pNewSubNode) == m_aChilds.end(), OSL_ENSURE(::std::find(m_aChilds.begin(), m_aChilds.end(), pNewSubNode) == m_aChilds.end(),
"OSQLParseNode::Replace() Node already element of parent"); "OSQLParseNode::Replace() Node already element of parent");
OSQLParseNode* pOldSubNode = m_aChilds[nPos]; OSQLParseNode* pOldSubNode = m_aChilds[nPos];
@@ -1385,11 +1385,11 @@ OSQLParseNode* OSQLParseNode::replaceAt(sal_uInt32 nPos, OSQLParseNode* pNewSubN
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
OSQLParseNode* OSQLParseNode::replace (OSQLParseNode* pOldSubNode, OSQLParseNode* pNewSubNode ) OSQLParseNode* OSQLParseNode::replace (OSQLParseNode* pOldSubNode, OSQLParseNode* pNewSubNode )
{ {
OSL_ENSHURE(pOldSubNode != NULL && pNewSubNode != NULL, "OSQLParseNode: invalid nodes"); OSL_ENSURE(pOldSubNode != NULL && pNewSubNode != NULL, "OSQLParseNode: invalid nodes");
OSL_ENSHURE(pNewSubNode->getParent() == NULL, "OSQLParseNode: node already has getParent"); OSL_ENSURE(pNewSubNode->getParent() == NULL, "OSQLParseNode: node already has getParent");
OSL_ENSHURE(::std::find(m_aChilds.begin(), m_aChilds.end(), pOldSubNode) != m_aChilds.end(), OSL_ENSURE(::std::find(m_aChilds.begin(), m_aChilds.end(), pOldSubNode) != m_aChilds.end(),
"OSQLParseNode::Replace() Node not element of parent"); "OSQLParseNode::Replace() Node not element of parent");
OSL_ENSHURE(::std::find(m_aChilds.begin(), m_aChilds.end(), pNewSubNode) == m_aChilds.end(), OSL_ENSURE(::std::find(m_aChilds.begin(), m_aChilds.end(), pNewSubNode) == m_aChilds.end(),
"OSQLParseNode::Replace() Node already element of parent"); "OSQLParseNode::Replace() Node already element of parent");
pOldSubNode->setParent( NULL ); pOldSubNode->setParent( NULL );