From 0e70d593ef28636a54f204b9a395e73f2308f4c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= Date: Thu, 14 Oct 2010 13:04:33 +0100 Subject: [PATCH] fdo#30825# fix more ownership issues --- unoxml/source/xpath/nodelist.cxx | 3 ++- unoxml/source/xpath/nodelist.hxx | 3 ++- unoxml/source/xpath/xpathobject.cxx | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/unoxml/source/xpath/nodelist.cxx b/unoxml/source/xpath/nodelist.cxx index 5ae839a4e09b..4d7241e5b738 100644 --- a/unoxml/source/xpath/nodelist.cxx +++ b/unoxml/source/xpath/nodelist.cxx @@ -31,8 +31,9 @@ namespace XPath { - CNodeList::CNodeList(boost::shared_ptr& rxpathObj) + CNodeList::CNodeList(boost::shared_ptr& rxpathObj, const Reference< XNode >& contextNode) : m_pNodeSet(0) + , m_xContextNode(contextNode) { if (rxpathObj != NULL && rxpathObj->type == XPATH_NODESET) { diff --git a/unoxml/source/xpath/nodelist.hxx b/unoxml/source/xpath/nodelist.hxx index 68f419f10174..110e048b103c 100644 --- a/unoxml/source/xpath/nodelist.hxx +++ b/unoxml/source/xpath/nodelist.hxx @@ -53,10 +53,11 @@ namespace XPath { private: boost::shared_ptr m_pXPathObj; + const Reference< XNode > m_xContextNode; xmlNodeSetPtr m_pNodeSet; public: - CNodeList(boost::shared_ptr &rxpathObj); + CNodeList(boost::shared_ptr &rxpathObj, const Reference< XNode >& contextNode); /** The number of nodes in the list. */ diff --git a/unoxml/source/xpath/xpathobject.cxx b/unoxml/source/xpath/xpathobject.cxx index 8d5343edbe97..1e20179a0d01 100644 --- a/unoxml/source/xpath/xpathobject.cxx +++ b/unoxml/source/xpath/xpathobject.cxx @@ -86,7 +86,7 @@ namespace XPath */ Reference< XNodeList > SAL_CALL CXPathObject::getNodeList() throw (RuntimeException) { - return Reference< XNodeList >(new CNodeList(m_pXPathObj)); + return Reference< XNodeList >(new CNodeList(m_pXPathObj, m_xContextNode)); } /**