diff --git a/mozilla/extensions/transformiix/source/xpath/Expr.h b/mozilla/extensions/transformiix/source/xpath/Expr.h index f816a5d8945..81a42d00df6 100644 --- a/mozilla/extensions/transformiix/source/xpath/Expr.h +++ b/mozilla/extensions/transformiix/source/xpath/Expr.h @@ -41,6 +41,7 @@ #include "nsString.h" #include "nsIAtom.h" #include "TxObject.h" +#include "nsAutoPtr.h" /* XPath class definitions. @@ -343,18 +344,13 @@ public: * @param nodeExpr the NodeExpr to use when matching Nodes * @param axisIdentifier the Axis Identifier in which to search for nodes **/ - LocationStep(txNodeTest* aNodeTest, LocationStepType aAxisIdentifier); - - /** - * Destructor, will delete all predicates and the given NodeExpr - **/ - virtual ~LocationStep(); + LocationStep(nsAutoPtr aNodeTest, LocationStepType aAxisIdentifier); TX_DECL_EXPR; private: - txNodeTest* mNodeTest; + nsAutoPtr mNodeTest; LocationStepType mAxisIdentifier; void fromDescendants(Node* node, txIMatchContext* aContext, diff --git a/mozilla/extensions/transformiix/source/xpath/ExprParser.cpp b/mozilla/extensions/transformiix/source/xpath/ExprParser.cpp index c6740e36761..981665f3f98 100644 --- a/mozilla/extensions/transformiix/source/xpath/ExprParser.cpp +++ b/mozilla/extensions/transformiix/source/xpath/ExprParser.cpp @@ -537,7 +537,7 @@ LocationStep* ExprParser::createLocationStep(ExprLexer& lexer, { //-- child axis is default LocationStep::LocationStepType axisIdentifier = LocationStep::CHILD_AXIS; - txNodeTest* nodeTest = 0; + nsAutoPtr nodeTest; //-- get Axis Identifier or AbbreviatedStep, if present Token* tok = lexer.peek(); @@ -677,7 +677,6 @@ LocationStep* ExprParser::createLocationStep(ExprLexer& lexer, LocationStep* lstep = new LocationStep(nodeTest, axisIdentifier); if (!lstep) { //XXX out of memory - delete nodeTest; return 0; } diff --git a/mozilla/extensions/transformiix/source/xpath/LocationStep.cpp b/mozilla/extensions/transformiix/source/xpath/LocationStep.cpp index 3d88510b25b..dc40f3cfe05 100644 --- a/mozilla/extensions/transformiix/source/xpath/LocationStep.cpp +++ b/mozilla/extensions/transformiix/source/xpath/LocationStep.cpp @@ -36,21 +36,12 @@ * @param nodeExpr the NodeExpr to use when matching Nodes * @param axisIdentifier the Axis Identifier in which to search for nodes **/ -LocationStep::LocationStep(txNodeTest* aNodeTest, +LocationStep::LocationStep(nsAutoPtr aNodeTest, LocationStepType aAxisIdentifier) : mNodeTest(aNodeTest), mAxisIdentifier(aAxisIdentifier) { } //-- LocationStep -/** - * Destroys this LocationStep - * All predicates will be deleted - * The NodeExpr will be deleted -**/ -LocationStep::~LocationStep() { - delete mNodeTest; -} //-- ~LocationStep - //-----------------------------/ //- Virtual methods from Expr -/ //-----------------------------/