diff --git a/unoxml/source/xpath/xpathapi.cxx b/unoxml/source/xpath/xpathapi.cxx index 296629fedeea..22307f4e52ae 100644 --- a/unoxml/source/xpath/xpathapi.cxx +++ b/unoxml/source/xpath/xpathapi.cxx @@ -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; } diff --git a/unoxml/source/xpath/xpathobject.cxx b/unoxml/source/xpath/xpathobject.cxx index 3a68cfd34ce0..8d5343edbe97 100644 --- a/unoxml/source/xpath/xpathobject.cxx +++ b/unoxml/source/xpath/xpathobject.cxx @@ -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) { diff --git a/unoxml/source/xpath/xpathobject.hxx b/unoxml/source/xpath/xpathobject.hxx index 8e256bc8a994..348fae8e21e6 100644 --- a/unoxml/source/xpath/xpathobject.hxx +++ b/unoxml/source/xpath/xpathobject.hxx @@ -52,10 +52,11 @@ namespace XPath { private: boost::shared_ptr m_pXPathObj; + const Reference< XNode > m_xContextNode; XPathObjectType m_xPathObjectType; public: - CXPathObject(xmlXPathObjectPtr xpathObj); + CXPathObject(xmlXPathObjectPtr xpathObj, const Reference< XNode >& contextNode); /** get object type