fdo#30825# fix more ownership issues

This commit is contained in:
Caolán McNamara 2010-10-14 13:04:33 +01:00
parent 2c8fc9289f
commit 0e70d593ef
3 changed files with 5 additions and 3 deletions

View file

@ -31,8 +31,9 @@
namespace XPath namespace XPath
{ {
CNodeList::CNodeList(boost::shared_ptr<xmlXPathObject>& rxpathObj) CNodeList::CNodeList(boost::shared_ptr<xmlXPathObject>& rxpathObj, const Reference< XNode >& contextNode)
: m_pNodeSet(0) : m_pNodeSet(0)
, m_xContextNode(contextNode)
{ {
if (rxpathObj != NULL && rxpathObj->type == XPATH_NODESET) if (rxpathObj != NULL && rxpathObj->type == XPATH_NODESET)
{ {

View file

@ -53,10 +53,11 @@ namespace XPath
{ {
private: private:
boost::shared_ptr<xmlXPathObject> m_pXPathObj; boost::shared_ptr<xmlXPathObject> m_pXPathObj;
const Reference< XNode > m_xContextNode;
xmlNodeSetPtr m_pNodeSet; xmlNodeSetPtr m_pNodeSet;
public: public:
CNodeList(boost::shared_ptr<xmlXPathObject> &rxpathObj); CNodeList(boost::shared_ptr<xmlXPathObject> &rxpathObj, const Reference< XNode >& contextNode);
/** /**
The number of nodes in the list. The number of nodes in the list.
*/ */

View file

@ -86,7 +86,7 @@ namespace XPath
*/ */
Reference< XNodeList > SAL_CALL CXPathObject::getNodeList() throw (RuntimeException) Reference< XNodeList > SAL_CALL CXPathObject::getNodeList() throw (RuntimeException)
{ {
return Reference< XNodeList >(new CNodeList(m_pXPathObj)); return Reference< XNodeList >(new CNodeList(m_pXPathObj, m_xContextNode));
} }
/** /**