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(); throw XPathException();
} }
xmlXPathFreeContext(xpathCtx); xmlXPathFreeContext(xpathCtx);
Reference< XXPathObject > aObj(new CXPathObject(xpathObj)); Reference< XXPathObject > aObj(new CXPathObject(xpathObj, contextNode));
return aObj; return aObj;
} }

View file

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

View file

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