diff options
author | Michael Stahl <mst@openoffice.org> | 2011-01-19 20:27:25 +0100 |
---|---|---|
committer | Michael Stahl <mst@openoffice.org> | 2011-01-19 20:27:25 +0100 |
commit | dd377d72a5ef66daee850b66ab7b7308939a7626 (patch) | |
tree | 0e646ac37439bc4717bb8dd4005728d4af082271 /unoxml/source/xpath | |
parent | 46716bcf7fd75a2a293722a6a458e4138c91f394 (diff) |
xmlfix3: #i113682#: unoxml: no more globals in CNode:
instead now the CDocument contains a node map member.
Diffstat (limited to 'unoxml/source/xpath')
-rw-r--r-- | unoxml/source/xpath/nodelist.cxx | 4 | ||||
-rw-r--r-- | unoxml/source/xpath/xpathapi.cxx | 22 |
2 files changed, 14 insertions, 12 deletions
diff --git a/unoxml/source/xpath/nodelist.cxx b/unoxml/source/xpath/nodelist.cxx index 3f24205309fb..8e37e70f5590 100644 --- a/unoxml/source/xpath/nodelist.cxx +++ b/unoxml/source/xpath/nodelist.cxx @@ -63,8 +63,8 @@ namespace XPath if (0 == m_pNodeSet) { return 0; } - Reference< XNode > const xNode( - DOM::CNode::getCNode(xmlXPathNodeSetItem(m_pNodeSet, index)).get()); + xmlNodePtr const pNode = xmlXPathNodeSetItem(m_pNodeSet, index); + Reference< XNode > const xNode(m_pDocument->GetCNode(pNode).get()); return xNode; } } diff --git a/unoxml/source/xpath/xpathapi.cxx b/unoxml/source/xpath/xpathapi.cxx index 2b515d0a9241..6fad00f99c8f 100644 --- a/unoxml/source/xpath/xpathapi.cxx +++ b/unoxml/source/xpath/xpathapi.cxx @@ -143,12 +143,13 @@ namespace XPath } // get all ns decls on a node (and parent nodes, if any) and register them - static void _collectNamespaces( - CXPathAPI* pAPI, - const Reference< XNode >& namespaceNode) + static void lcl_collectNamespaces( + CXPathAPI *const pAPI, + Reference< XNode > const& xNamespaceNode) { // get namespace decls from node... - xmlNodePtr pNode = DOM::CNode::getNodePtr(namespaceNode); + DOM::CNode *const pCNode(DOM::CNode::GetImplementation(xNamespaceNode)); + xmlNodePtr pNode = pCNode->GetNodePtr(); while (pNode != 0) { xmlNsPtr curDef = pNode->nsDef; while (curDef != 0) { @@ -214,7 +215,7 @@ namespace XPath const Reference< XNode >& namespaceNode) throw (RuntimeException, XPathException) { - _collectNamespaces(this, namespaceNode); + lcl_collectNamespaces(this, namespaceNode); return selectNodeList(contextNode, expr); } @@ -241,7 +242,7 @@ namespace XPath const Reference< XNode >& namespaceNode ) throw (RuntimeException, XPathException) { - _collectNamespaces(this, namespaceNode); + lcl_collectNamespaces(this, namespaceNode); return selectSingleNode(contextNode, expr); } @@ -320,7 +321,9 @@ namespace XPath xmlXPathObjectPtr xpathObj; // get the node and document - xmlNodePtr pNode = DOM::CNode::getNodePtr(contextNode); + DOM::CNode *const pCNode = DOM::CNode::GetImplementation(contextNode); + if (!pCNode) { throw RuntimeException(); } + xmlNodePtr const pNode = pCNode->GetNodePtr(); if (!pNode) { throw RuntimeException(); } xmlDocPtr pDoc = pNode->doc; @@ -359,8 +362,7 @@ namespace XPath } xmlXPathFreeContext(xpathCtx); ::rtl::Reference<DOM::CDocument> const pCDoc( - dynamic_cast<DOM::CDocument*>(DOM::CNode::getCNode( - reinterpret_cast<xmlNodePtr>(pDoc)).get())); + & pCNode->GetOwnerDocument()); OSL_ASSERT(pCDoc.is()); Reference<XXPathObject> const xObj(new CXPathObject(pCDoc, xpathObj)); return xObj; @@ -375,7 +377,7 @@ namespace XPath const Reference< XNode >& namespaceNode) throw (RuntimeException, XPathException) { - _collectNamespaces(this, namespaceNode); + lcl_collectNamespaces(this, namespaceNode); return eval(contextNode, expr); } |