Backing out patch from bug 210528 to fix ports bustage

This commit is contained in:
sicking%bigfoot.com 2003-06-30 20:11:13 +00:00
Родитель 4c3aa76c2a
Коммит 4adfa335e0
17 изменённых файлов: 184 добавлений и 101 удалений

Просмотреть файл

@ -38,13 +38,16 @@
/**
* Creates a new AdditiveExpr using the given operator
**/
AdditiveExpr::AdditiveExpr(nsAutoPtr<Expr> aLeftExpr,
nsAutoPtr<Expr> aRightExpr, short aOp)
: op(aOp),
leftExpr(aLeftExpr),
rightExpr(aRightExpr)
{
}
AdditiveExpr::AdditiveExpr(Expr* leftExpr, Expr* rightExpr, short op) {
this->op = op;
this->leftExpr = leftExpr;
this->rightExpr = rightExpr;
} //-- AdditiveExpr
AdditiveExpr::~AdditiveExpr() {
delete leftExpr;
delete rightExpr;
} //-- ~AdditiveExpr
/**
* Evaluates this Expr based on the given context node and processor state

Просмотреть файл

@ -31,6 +31,11 @@
#include "ExprResult.h"
#include "txIXPathContext.h"
/**
* Create a new AttributeValueTemplate
**/
AttributeValueTemplate::AttributeValueTemplate() {};
/**
* Default destructor
**/
@ -44,15 +49,8 @@ AttributeValueTemplate::~AttributeValueTemplate() {
/**
* Adds the given Expr to this AttributeValueTemplate
**/
nsresult
AttributeValueTemplate::addExpr(nsAutoPtr<Expr> aExpr)
{
nsresult rv = expressions.add(aExpr);
NS_ENSURE_SUCCESS(rv, rv);
aExpr.forget();
return NS_OK;
void AttributeValueTemplate::addExpr(Expr* expr) {
if (expr) expressions.add(expr);
} //-- addExpr
/**

Просмотреть файл

@ -41,12 +41,15 @@
/**
* Creates a new BooleanExpr using the given operator
**/
BooleanExpr::BooleanExpr(nsAutoPtr<Expr> aLeftExpr,
nsAutoPtr<Expr> aRightExpr, short aOp)
: op(aOp),
leftExpr(aLeftExpr),
rightExpr(aRightExpr)
{
BooleanExpr::BooleanExpr(Expr* leftExpr, Expr* rightExpr, short op) {
this->op = op;
this->leftExpr = leftExpr;
this->rightExpr = rightExpr;
} //-- BooleanExpr
BooleanExpr::~BooleanExpr() {
delete leftExpr;
delete rightExpr;
} //-- ~BooleanExpr
/**

Просмотреть файл

@ -119,7 +119,7 @@ public:
* Adds the given parameter to this FunctionCall's parameter list
* @param expr the Expr to add to this FunctionCall's parameter list
**/
nsresult addParam(nsAutoPtr<Expr> aExpr);
nsresult addParam(Expr* aExpr);
/**
* Check if the number of parameters falls within a range.
@ -140,6 +140,8 @@ protected:
txList params;
FunctionCall();
/*
* Evaluates the given Expression and converts its result to a String.
* The value is appended to the given destination String
@ -177,12 +179,15 @@ protected:
class AttributeValueTemplate: public Expr {
public:
AttributeValueTemplate();
virtual ~AttributeValueTemplate();
/**
* Adds the given Expr to this AttributeValueTemplate
**/
nsresult addExpr(nsAutoPtr<Expr> expr);
void addExpr(Expr* expr);
TX_DECL_EXPR;
@ -227,8 +232,11 @@ public:
txNameTest(nsIAtom* aPrefix, nsIAtom* aLocalName, PRInt32 aNSID,
Node::NodeType aNodeType);
~txNameTest();
TX_DECL_NODE_TEST;
private:
nsCOMPtr<nsIAtom> mPrefix;
nsCOMPtr<nsIAtom> mLocalName;
PRInt32 mNamespace;
@ -253,6 +261,8 @@ public:
*/
txNodeTypeTest(NodeType aNodeType);
~txNodeTypeTest();
/*
* Sets the name of the node to match. Only availible for pi nodes
*/
@ -272,6 +282,11 @@ private:
class PredicateList {
public:
/**
* Creates a new PredicateList
**/
PredicateList();
/**
* Destructor, will delete all Expressions in the list, so remove
* any you may need
@ -282,7 +297,7 @@ public:
* Adds the given Expr to the list
* @param expr the Expr to add to the list
**/
nsresult add(nsAutoPtr<Expr> aExpr);
void add(Expr* expr);
nsresult evaluatePredicates(NodeSet* aNodes, txIMatchContext* aContext);
@ -358,12 +373,17 @@ public:
* Creates a new FilterExpr using the given Expr
* @param expr the Expr to use for evaluation
**/
FilterExpr(nsAutoPtr<Expr> aExpr);
FilterExpr(Expr* aExpr);
/**
* Destructor, will delete all predicates and the given Expr
**/
virtual ~FilterExpr();
TX_DECL_EXPR;
private:
nsAutoPtr<Expr> expr;
Expr* expr;
}; //-- FilterExpr
@ -393,15 +413,15 @@ public:
//-- LF, changed from static const short to enum
enum _AdditiveExprType { ADDITION = 1, SUBTRACTION };
AdditiveExpr(nsAutoPtr<Expr> aLeftExpr, nsAutoPtr<Expr> aRightExpr,
short aOp);
AdditiveExpr(Expr* leftExpr, Expr* rightExpr, short op);
~AdditiveExpr();
TX_DECL_EXPR;
private:
short op;
nsAutoPtr<Expr> leftExpr;
nsAutoPtr<Expr> rightExpr;
Expr* leftExpr;
Expr* rightExpr;
}; //-- AdditiveExpr
/**
@ -411,12 +431,13 @@ class UnaryExpr : public Expr {
public:
UnaryExpr(nsAutoPtr<Expr> aExpr);
UnaryExpr(Expr* expr);
~UnaryExpr();
TX_DECL_EXPR;
private:
nsAutoPtr<Expr> expr;
Expr* expr;
}; //-- UnaryExpr
/**
@ -430,15 +451,15 @@ public:
//-- BooleanExpr Types
enum _BooleanExprType { AND = 1, OR };
BooleanExpr(nsAutoPtr<Expr> aLeftExpr, nsAutoPtr<Expr> aRightExpr,
short aOp);
BooleanExpr(Expr* leftExpr, Expr* rightExpr, short op);
~BooleanExpr();
TX_DECL_EXPR;
private:
short op;
nsAutoPtr<Expr> leftExpr;
nsAutoPtr<Expr> rightExpr;
Expr* leftExpr;
Expr* rightExpr;
}; //-- BooleanExpr
/**
@ -457,15 +478,15 @@ public:
//-- LF, changed from static const short to enum
enum _MultiplicativeExprType { DIVIDE = 1, MULTIPLY, MODULUS };
MultiplicativeExpr(nsAutoPtr<Expr> aLeftExpr, nsAutoPtr<Expr> aRightExpr,
short aOp);
MultiplicativeExpr(Expr* leftExpr, Expr* rightExpr, short op);
~MultiplicativeExpr();
TX_DECL_EXPR;
private:
short op;
nsAutoPtr<Expr> leftExpr;
nsAutoPtr<Expr> rightExpr;
Expr* leftExpr;
Expr* rightExpr;
}; //-- MultiplicativeExpr
/**
@ -490,8 +511,7 @@ public:
GREATER_OR_EQUAL
};
RelationalExpr(nsAutoPtr<Expr> aLeftExpr, nsAutoPtr<Expr> aRightExpr,
RelationalExprType aOp);
RelationalExpr(Expr* aLeftExpr, Expr* aRightExpr, RelationalExprType aOp);
TX_DECL_EXPR;
@ -513,6 +533,7 @@ class VariableRefExpr : public Expr {
public:
VariableRefExpr(nsIAtom* aPrefix, nsIAtom* aLocalName, PRInt32 aNSID);
~VariableRefExpr();
TX_DECL_EXPR;
@ -534,6 +555,11 @@ public:
//-- LF, changed from static const short to enum
enum PathOperator { RELATIVE_OP, DESCENDANT_OP };
/**
* Creates a new PathExpr
**/
PathExpr();
/**
* Destructor, will delete all Expressions
**/
@ -543,13 +569,13 @@ public:
* Adds the Expr to this PathExpr
* @param expr the Expr to add to this PathExpr
**/
nsresult addExpr(nsAutoPtr<Expr> aExpr, PathOperator aPathOp);
void addExpr(Expr* expr, PathOperator pathOp);
TX_DECL_EXPR;
private:
struct PathExprItem {
nsAutoPtr<Expr> expr;
Expr* expr;
PathOperator pathOp;
};
@ -593,6 +619,11 @@ class UnionExpr : public Expr {
public:
/**
* Creates a new UnionExpr
**/
UnionExpr();
/**
* Destructor, will delete all Path Expressions
**/
@ -602,7 +633,7 @@ public:
* Adds the PathExpr to this UnionExpr
* @param expr the Expr to add to this UnionExpr
**/
nsresult addExpr(nsAutoPtr<Expr> aExpr);
void addExpr(Expr* expr);
TX_DECL_EXPR;

Просмотреть файл

@ -35,11 +35,17 @@
* Creates a new FilterExpr using the given Expr
* @param expr the Expr to use for evaluation
**/
FilterExpr::FilterExpr(nsAutoPtr<Expr> aExpr)
: expr(aExpr)
{
FilterExpr::FilterExpr(Expr* expr) : PredicateList() {
this->expr = expr;
} //-- FilterExpr
/**
* Destroys this FilterExpr, all predicates and the expr will be deleted
**/
FilterExpr::~FilterExpr() {
delete expr;
} //-- ~FilterExpr
//-----------------------------/
//- Virtual methods from Expr -/
//-----------------------------/

Просмотреть файл

@ -33,6 +33,10 @@
* This class represents a FunctionCall as defined by the XSL Working Draft
**/
FunctionCall::FunctionCall()
{
}
/**
* Destructor
**/
@ -52,14 +56,10 @@ FunctionCall::~FunctionCall()
* Adds the given parameter to this FunctionCall's parameter list
* @param expr the Expr to add to this FunctionCall's parameter list
**/
nsresult
FunctionCall::addParam(nsAutoPtr<Expr> aExpr)
nsresult FunctionCall::addParam(Expr* aExpr)
{
nsresult rv = params.add(aExpr);
NS_ENSURE_SUCCESS(rv, rv);
aExpr.forget();
if (aExpr)
params.add(aExpr);
return NS_OK;
} //-- addParam

Просмотреть файл

@ -44,13 +44,16 @@
/**
* Creates a new MultiplicativeExpr using the given operator
**/
MultiplicativeExpr::MultiplicativeExpr(nsAutoPtr<Expr> aLeftExpr,
nsAutoPtr<Expr> aRightExpr, short aOp)
: op(aOp),
leftExpr(aLeftExpr),
rightExpr(aRightExpr)
{
}
MultiplicativeExpr::MultiplicativeExpr(Expr* leftExpr, Expr* rightExpr, short op) {
this->op = op;
this->leftExpr = leftExpr;
this->rightExpr = rightExpr;
} //-- MultiplicativeExpr
MultiplicativeExpr::~MultiplicativeExpr() {
delete leftExpr;
delete rightExpr;
} //-- ~MultiplicativeExpr
/**
* Evaluates this Expr based on the given context node and processor state

Просмотреть файл

@ -41,6 +41,14 @@
//- PathExpr -/
//------------/
/**
* Creates a new PathExpr
**/
PathExpr::PathExpr()
{
//-- do nothing
}
/**
* Destructor, will delete all Expressions
**/
@ -49,6 +57,7 @@ PathExpr::~PathExpr()
txListIterator iter(&expressions);
while (iter.hasNext()) {
PathExprItem* pxi = (PathExprItem*)iter.next();
delete pxi->expr;
delete pxi;
}
} //-- ~PathExpr
@ -57,20 +66,21 @@ PathExpr::~PathExpr()
* Adds the Expr to this PathExpr
* @param expr the Expr to add to this PathExpr
**/
nsresult
PathExpr::addExpr(nsAutoPtr<Expr> aExpr, PathOperator aPathOp)
void PathExpr::addExpr(Expr* expr, PathOperator pathOp)
{
NS_ASSERTION(expressions.getLength() > 0 || aPathOp == RELATIVE_OP,
NS_ASSERTION(expressions.getLength() > 0 || pathOp == RELATIVE_OP,
"First step has to be relative in PathExpr");
nsAutoPtr<PathExprItem> pxi(new PathExprItem);
NS_ENSURE_TRUE(pxi, NS_ERROR_OUT_OF_MEMORY);
pxi->expr = aExpr;
pxi->pathOp = aPathOp;
nsresult rv = expressions.add(pxi);
NS_ENSURE_SUCCESS(rv, rv);
return NS_OK;
if (expr) {
PathExprItem* pxi = new PathExprItem;
if (!pxi) {
// XXX ErrorReport: out of memory
NS_ASSERTION(0, "out of memory");
return;
}
pxi->expr = expr;
pxi->pathOp = pathOp;
expressions.add(pxi);
}
} //-- addPattenExpr
//-----------------------------/

Просмотреть файл

@ -32,6 +32,10 @@
* for use with Step and Filter Expressions
*/
PredicateList::PredicateList()
{
} // PredicateList
/*
* Destructor, will delete all Expressions in the list
*/
@ -47,15 +51,9 @@ PredicateList::~PredicateList()
* Adds the given Expr to the list
* @param expr the Expr to add to the list
*/
nsresult
PredicateList::add(nsAutoPtr<Expr> aExpr)
void PredicateList::add(Expr* expr)
{
nsresult rv = predicates.add(aExpr);
NS_ENSURE_SUCCESS(rv, rv);
aExpr.forget();
return NS_OK;
predicates.add(expr);
} // add
nsresult

Просмотреть файл

@ -32,12 +32,9 @@
#include "XMLDOMUtils.h"
#include "txIXPathContext.h"
RelationalExpr::RelationalExpr(nsAutoPtr<Expr> aLeftExpr,
nsAutoPtr<Expr> aRightExpr,
RelationalExpr::RelationalExpr(Expr* aLeftExpr, Expr* aRightExpr,
RelationalExprType aOp)
: mLeftExpr(aLeftExpr),
mRightExpr(aRightExpr),
mOp(aOp)
: mLeftExpr(aLeftExpr), mRightExpr(aRightExpr), mOp(aOp)
{
}

Просмотреть файл

@ -27,9 +27,14 @@
#include "ExprResult.h"
#include "txIXPathContext.h"
UnaryExpr::UnaryExpr(nsAutoPtr<Expr> aExpr)
: expr(aExpr)
UnaryExpr::UnaryExpr(Expr* expr)
{
this->expr = expr;
}
UnaryExpr::~UnaryExpr()
{
delete expr;
}
/*

Просмотреть файл

@ -32,6 +32,13 @@
//-------------/
/**
* Creates a new UnionExpr
**/
UnionExpr::UnionExpr() {
//-- do nothing
}
/**
* Destructor, will delete all Path Expressions
**/
@ -46,15 +53,9 @@ UnionExpr::~UnionExpr() {
* Adds the Expr to this UnionExpr
* @param expr the Expr to add to this UnionExpr
**/
nsresult
UnionExpr::addExpr(nsAutoPtr<Expr> aExpr)
{
nsresult rv = expressions.add(aExpr);
NS_ENSURE_SUCCESS(rv, rv);
aExpr.forget();
return NS_OK;
void UnionExpr::addExpr(Expr* expr) {
if (expr)
expressions.add(expr);
} //-- addExpr
//-----------------------------/

Просмотреть файл

@ -44,6 +44,13 @@ VariableRefExpr::VariableRefExpr(nsIAtom* aPrefix, nsIAtom* aLocalName,
mPrefix = 0;
}
/*
* Release the local name atom
*/
VariableRefExpr::~VariableRefExpr()
{
}
/**
* Evaluates this Expr based on the given context node and processor state
* @param context the context node for evaluation of this Expr

Просмотреть файл

@ -37,6 +37,10 @@ txNameTest::txNameTest(nsIAtom* aPrefix, nsIAtom* aLocalName, PRInt32 aNSID,
NS_ASSERTION(aLocalName, "txNameTest without a local name?");
}
txNameTest::~txNameTest()
{
}
/*
* Determines whether this txNodeTest matches the given node
*/

Просмотреть файл

@ -35,6 +35,10 @@ txNodeTypeTest::txNodeTypeTest(NodeType aNodeType)
{
}
txNodeTypeTest::~txNodeTypeTest()
{
}
void txNodeTypeTest::setNodeName(const nsAString& aName)
{
mNodeName = do_GetAtom(aName);

Просмотреть файл

@ -459,6 +459,11 @@ void txKeyPattern::toString(nsAString& aDest)
* a txPattern to hold the NodeTest and the Predicates of a StepPattern
*/
txStepPattern::~txStepPattern()
{
delete mNodeTest;
}
MBool txStepPattern::matches(Node* aNode, txIMatchContext* aContext)
{
NS_ASSERTION(mNodeTest && aNode, "Internal error");

Просмотреть файл

@ -131,7 +131,12 @@ private:
{
}
nsAutoPtr<txPattern> pattern;
~Step()
{
delete pattern;
}
txPattern* pattern;
MBool isChild;
};
@ -193,9 +198,12 @@ public:
{
}
~txStepPattern();
TX_DECL_PATTERN;
nsAutoPtr<txNodeTest> mNodeTest;
private:
txNodeTest* mNodeTest;
MBool mIsAttr;
};