fdo#30825# someone needs to hold the originating node

This commit is contained in:
Caolán McNamara 2010-10-14 11:40:14 +01:00
parent 4dafaa30e9
commit 2c8fc9289f
3 changed files with 5 additions and 4 deletions

View file

@ -353,7 +353,7 @@ namespace XPath
throw XPathException();
}
xmlXPathFreeContext(xpathCtx);
Reference< XXPathObject > aObj(new CXPathObject(xpathObj));
Reference< XXPathObject > aObj(new CXPathObject(xpathObj, contextNode));
return aObj;
}

View file

@ -32,8 +32,8 @@
namespace XPath
{
CXPathObject::CXPathObject(xmlXPathObjectPtr xpathObj)
: m_pXPathObj(xpathObj, xmlXPathFreeObject)
CXPathObject::CXPathObject(xmlXPathObjectPtr xpathObj, const Reference< XNode >& contextNode)
: m_pXPathObj(xpathObj, xmlXPathFreeObject), m_xContextNode(contextNode)
{
switch (m_pXPathObj->type)
{

View file

@ -52,10 +52,11 @@ namespace XPath
{
private:
boost::shared_ptr<xmlXPathObject> m_pXPathObj;
const Reference< XNode > m_xContextNode;
XPathObjectType m_xPathObjectType;
public:
CXPathObject(xmlXPathObjectPtr xpathObj);
CXPathObject(xmlXPathObjectPtr xpathObj, const Reference< XNode >& contextNode);
/**
get object type