[Libreoffice-commits] .: 2 commits - unoxml/source
Caolán McNamara
caolan at kemper.freedesktop.org
Thu Oct 14 05:34:25 PDT 2010
unoxml/source/xpath/nodelist.cxx | 3 ++-
unoxml/source/xpath/nodelist.hxx | 3 ++-
unoxml/source/xpath/xpathapi.cxx | 2 +-
unoxml/source/xpath/xpathobject.cxx | 6 +++---
unoxml/source/xpath/xpathobject.hxx | 3 ++-
5 files changed, 10 insertions(+), 7 deletions(-)
New commits:
commit 3e46d50d71eb3861ce73120e06dc6b8a4b17a36a
Author: Caolán McNamara <caolanm at redhat.com>
Date: Thu Oct 14 13:04:33 2010 +0100
fdo#30825# fix more ownership issues
diff --git a/unoxml/source/xpath/nodelist.cxx b/unoxml/source/xpath/nodelist.cxx
index 67a2914..4b5c469 100644
--- a/unoxml/source/xpath/nodelist.cxx
+++ b/unoxml/source/xpath/nodelist.cxx
@@ -31,8 +31,9 @@
namespace XPath
{
- CNodeList::CNodeList(boost::shared_ptr<xmlXPathObject>& rxpathObj)
+ CNodeList::CNodeList(boost::shared_ptr<xmlXPathObject>& 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 6c7ae1c..5ab978a 100644
--- a/unoxml/source/xpath/nodelist.hxx
+++ b/unoxml/source/xpath/nodelist.hxx
@@ -53,10 +53,11 @@ namespace XPath
{
private:
boost::shared_ptr<xmlXPathObject> m_pXPathObj;
+ const Reference< XNode > m_xContextNode;
xmlNodeSetPtr m_pNodeSet;
public:
- CNodeList(boost::shared_ptr<xmlXPathObject> &rxpathObj);
+ CNodeList(boost::shared_ptr<xmlXPathObject> &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 ad505c5..67a8f59 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));
}
/**
commit d98da8e16e3a7d282bbfadd8a382b0a103aaf54e
Author: Caolán McNamara <caolanm at redhat.com>
Date: Thu Oct 14 11:40:14 2010 +0100
fdo#30825# someone needs to hold the originating node
diff --git a/unoxml/source/xpath/xpathapi.cxx b/unoxml/source/xpath/xpathapi.cxx
index 213a295..cb88a51 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 049122a..ad505c5 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 a726def..95c2e78 100644
--- a/unoxml/source/xpath/xpathobject.hxx
+++ b/unoxml/source/xpath/xpathobject.hxx
@@ -52,10 +52,11 @@ namespace XPath
{
private:
boost::shared_ptr<xmlXPathObject> m_pXPathObj;
+ const Reference< XNode > m_xContextNode;
XPathObjectType m_xPathObjectType;
public:
- CXPathObject(xmlXPathObjectPtr xpathObj);
+ CXPathObject(xmlXPathObjectPtr xpathObj, const Reference< XNode >& contextNode);
/**
get object type
More information about the Libreoffice-commits
mailing list