diff options
author | Caolán McNamara <caolanm@redhat.com> | 2011-03-02 11:09:41 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2011-03-02 11:09:41 +0000 |
commit | e2cb41babdcc39ba9224f2cddf7d0eb84dd25368 (patch) | |
tree | a950c167dfbb110eadd6f12aa5cf9c51d4ea90d7 /unoxml/source | |
parent | 634789b6faf6fac03d4c865f90805150d9fcfb3a (diff) |
Resolves: fdo#33701 ensure node outlives path
The xpath on destruction needs the xmldoc to exist, so the reference
to the doc-owning nodelist needs to be the first reference listed
in the class in order that its dtor is called *after* the xpath
dtor
Diffstat (limited to 'unoxml/source')
-rw-r--r-- | unoxml/source/xpath/nodelist.cxx | 4 | ||||
-rw-r--r-- | unoxml/source/xpath/nodelist.hxx | 4 | ||||
-rw-r--r-- | unoxml/source/xpath/xpathobject.cxx | 2 |
3 files changed, 5 insertions, 5 deletions
diff --git a/unoxml/source/xpath/nodelist.cxx b/unoxml/source/xpath/nodelist.cxx index 734df439eb24..49a1484939d2 100644 --- a/unoxml/source/xpath/nodelist.cxx +++ b/unoxml/source/xpath/nodelist.cxx @@ -31,8 +31,8 @@ namespace XPath { - CNodeList::CNodeList(boost::shared_ptr<xmlXPathObject>& rxpathObj, const Reference< XNode >& contextNode) - : m_xContextNode(contextNode) + CNodeList::CNodeList(const Reference< XNode >& rContextNode, boost::shared_ptr<xmlXPathObject>& rxpathObj) + : m_xContextNode(rContextNode) , m_pNodeSet(0) { if (rxpathObj != NULL && rxpathObj->type == XPATH_NODESET) diff --git a/unoxml/source/xpath/nodelist.hxx b/unoxml/source/xpath/nodelist.hxx index de0b1d287155..af8770199dda 100644 --- a/unoxml/source/xpath/nodelist.hxx +++ b/unoxml/source/xpath/nodelist.hxx @@ -53,12 +53,12 @@ namespace XPath class CNodeList : public cppu::WeakImplHelper1< XNodeList > { private: - boost::shared_ptr<xmlXPathObject> m_pXPathObj; const Reference< XNode > m_xContextNode; + boost::shared_ptr<xmlXPathObject> m_pXPathObj; xmlNodeSetPtr m_pNodeSet; public: - CNodeList(boost::shared_ptr<xmlXPathObject> &rxpathObj, const Reference< XNode >& contextNode); + CNodeList(const Reference< XNode >& contextNode, boost::shared_ptr<xmlXPathObject> &rxpathObj); /** The number of nodes in the list. */ diff --git a/unoxml/source/xpath/xpathobject.cxx b/unoxml/source/xpath/xpathobject.cxx index 1e20179a0d01..c33eeb6477dc 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, m_xContextNode)); + return Reference< XNodeList >(new CNodeList(m_xContextNode, m_pXPathObj)); } /** |