summaryrefslogtreecommitdiff
path: root/unoxml
diff options
context:
space:
mode:
authorMichael Stahl <mst@openoffice.org>2011-01-19 20:27:25 +0100
committerMichael Stahl <mst@openoffice.org>2011-01-19 20:27:25 +0100
commit46716bcf7fd75a2a293722a6a458e4138c91f394 (patch)
tree6e4ba2b0ef026d55b94d9fe3a025c0cc3ac59c7c /unoxml
parent06ebc79a5d723211d55be7a1c014299e71acfc20 (diff)
xmlfix3: unoxml: all node ctors get CDocument parameter
(and in the next patch, an actual CDocument, not just 0 :)
Diffstat (limited to 'unoxml')
-rw-r--r--unoxml/source/dom/attr.cxx4
-rw-r--r--unoxml/source/dom/attr.hxx10
-rw-r--r--unoxml/source/dom/cdatasection.cxx7
-rw-r--r--unoxml/source/dom/cdatasection.hxx7
-rw-r--r--unoxml/source/dom/characterdata.cxx12
-rw-r--r--unoxml/source/dom/characterdata.hxx15
-rw-r--r--unoxml/source/dom/comment.cxx7
-rw-r--r--unoxml/source/dom/comment.hxx7
-rw-r--r--unoxml/source/dom/document.cxx2
-rw-r--r--unoxml/source/dom/document.hxx2
-rw-r--r--unoxml/source/dom/documentfragment.cxx8
-rw-r--r--unoxml/source/dom/documentfragment.hxx7
-rw-r--r--unoxml/source/dom/documenttype.cxx17
-rw-r--r--unoxml/source/dom/documenttype.hxx9
-rw-r--r--unoxml/source/dom/element.cxx23
-rw-r--r--unoxml/source/dom/element.hxx10
-rw-r--r--unoxml/source/dom/entity.cxx11
-rw-r--r--unoxml/source/dom/entity.hxx13
-rw-r--r--unoxml/source/dom/entityreference.cxx9
-rw-r--r--unoxml/source/dom/entityreference.hxx10
-rw-r--r--unoxml/source/dom/node.cxx27
-rw-r--r--unoxml/source/dom/node.hxx3
-rw-r--r--unoxml/source/dom/notation.cxx12
-rw-r--r--unoxml/source/dom/notation.hxx10
-rw-r--r--unoxml/source/dom/processinginstruction.cxx14
-rw-r--r--unoxml/source/dom/processinginstruction.hxx11
-rw-r--r--unoxml/source/dom/text.cxx12
-rw-r--r--unoxml/source/dom/text.hxx16
28 files changed, 174 insertions, 121 deletions
diff --git a/unoxml/source/dom/attr.cxx b/unoxml/source/dom/attr.cxx
index 4b552db74029..6cd335c38b4d 100644
--- a/unoxml/source/dom/attr.cxx
+++ b/unoxml/source/dom/attr.cxx
@@ -32,8 +32,8 @@
namespace DOM
{
- CAttr::CAttr(const xmlAttrPtr pAttr)
- : CAttr_Base(
+ CAttr::CAttr(CDocument const& rDocument, xmlAttrPtr const pAttr)
+ : CAttr_Base(rDocument,
NodeType_ATTRIBUTE_NODE, reinterpret_cast<xmlNodePtr>(pAttr))
, m_aAttrPtr(pAttr)
{
diff --git a/unoxml/source/dom/attr.hxx b/unoxml/source/dom/attr.hxx
index 2b47061c9dd7..bff00353b7cb 100644
--- a/unoxml/source/dom/attr.hxx
+++ b/unoxml/source/dom/attr.hxx
@@ -28,13 +28,15 @@
#ifndef DOM_ATTR_HXX
#define DOM_ATTR_HXX
+#include <libxml/tree.h>
+
#include <cppuhelper/implbase1.hxx>
+
#include <com/sun/star/uno/Reference.h>
-#include <com/sun/star/uno/Exception.hpp>
#include <com/sun/star/xml/dom/XNode.hpp>
#include <com/sun/star/xml/dom/XAttr.hpp>
-#include "node.hxx"
-#include <libxml/tree.h>
+
+#include <node.hxx>
using ::rtl::OUString;
using namespace com::sun::star::uno;
@@ -53,7 +55,7 @@ namespace DOM
xmlAttrPtr m_aAttrPtr;
protected:
- CAttr(const xmlAttrPtr aAttrPtr);
+ CAttr(CDocument const& rDocument, xmlAttrPtr const pAttr);
public:
/**
diff --git a/unoxml/source/dom/cdatasection.cxx b/unoxml/source/dom/cdatasection.cxx
index 9f166b8cacf7..8579988a7b89 100644
--- a/unoxml/source/dom/cdatasection.cxx
+++ b/unoxml/source/dom/cdatasection.cxx
@@ -25,14 +25,15 @@
*
************************************************************************/
-#include "cdatasection.hxx"
+#include <cdatasection.hxx>
#include <com/sun/star/xml/sax/XExtendedDocumentHandler.hpp>
namespace DOM
{
- CCDATASection::CCDATASection(const xmlNodePtr aNodePtr)
- : CCDATASection_Base(NodeType_CDATA_SECTION_NODE, aNodePtr)
+ CCDATASection::CCDATASection(CDocument const& rDocument,
+ xmlNodePtr const pNode)
+ : CCDATASection_Base(rDocument, NodeType_CDATA_SECTION_NODE, pNode)
{
}
diff --git a/unoxml/source/dom/cdatasection.hxx b/unoxml/source/dom/cdatasection.hxx
index f32773a4fe4d..ca278319089c 100644
--- a/unoxml/source/dom/cdatasection.hxx
+++ b/unoxml/source/dom/cdatasection.hxx
@@ -29,10 +29,10 @@
#define DOM_CDATASECTION_HXX
#include <com/sun/star/uno/Reference.h>
-#include <com/sun/star/uno/Exception.hpp>
#include <com/sun/star/xml/dom/XCDATASection.hpp>
-#include "text.hxx"
+#include <text.hxx>
+
using ::rtl::OUString;
using namespace com::sun::star::uno;
@@ -47,8 +47,9 @@ namespace DOM
: public CCDATASection_Base
{
friend class CNode;
+
protected:
- CCDATASection(const xmlNodePtr aNodePtr);
+ CCDATASection(CDocument const& rDocument, xmlNodePtr const pNode);
public:
diff --git a/unoxml/source/dom/characterdata.cxx b/unoxml/source/dom/characterdata.cxx
index cc76c203114f..aa7abaf1561a 100644
--- a/unoxml/source/dom/characterdata.cxx
+++ b/unoxml/source/dom/characterdata.cxx
@@ -25,17 +25,21 @@
*
************************************************************************/
+#include <characterdata.hxx>
+
+#include <string.h>
+
#include <com/sun/star/xml/dom/events/XDocumentEvent.hpp>
-#include "characterdata.hxx"
+
#include "../events/mutationevent.hxx"
-#include <string.h>
+
namespace DOM
{
- CCharacterData::CCharacterData(
+ CCharacterData::CCharacterData(CDocument const& rDocument,
NodeType const& reNodeType, xmlNodePtr const& rpNode)
- : CCharacterData_Base(reNodeType, rpNode)
+ : CCharacterData_Base(rDocument, reNodeType, rpNode)
{
}
diff --git a/unoxml/source/dom/characterdata.hxx b/unoxml/source/dom/characterdata.hxx
index 962749a4527a..906fa929832f 100644
--- a/unoxml/source/dom/characterdata.hxx
+++ b/unoxml/source/dom/characterdata.hxx
@@ -28,16 +28,18 @@
#ifndef DOM_CHARACTERDATA_HXX
#define DOM_CHARACTERDATA_HXX
+#include <libxml/tree.h>
+
#include <sal/types.h>
+
#include <cppuhelper/implbase1.hxx>
+
#include <com/sun/star/uno/Reference.h>
-#include <com/sun/star/uno/Exception.hpp>
#include <com/sun/star/xml/dom/XNode.hpp>
#include <com/sun/star/xml/dom/XCharacterData.hpp>
-#include <com/sun/star/xml/dom/XElement.hpp>
-#include <com/sun/star/xml/dom/XDOMImplementation.hpp>
-#include <libxml/tree.h>
-#include "node.hxx"
+
+#include <node.hxx>
+
using ::rtl::OUString;
using namespace com::sun::star::uno;
@@ -53,7 +55,8 @@ namespace DOM
{
protected:
- CCharacterData(NodeType const& reNodeType, xmlNodePtr const& rpNode);
+ CCharacterData(CDocument const& rDocument,
+ NodeType const& reNodeType, xmlNodePtr const& rpNode);
void _dispatchEvent(const OUString& prevValue, const OUString& newValue);
public:
diff --git a/unoxml/source/dom/comment.cxx b/unoxml/source/dom/comment.cxx
index f01e8ae75f9d..605796523b88 100644
--- a/unoxml/source/dom/comment.cxx
+++ b/unoxml/source/dom/comment.cxx
@@ -25,14 +25,15 @@
*
************************************************************************/
-#include "comment.hxx"
+#include <comment.hxx>
#include <com/sun/star/xml/sax/XExtendedDocumentHandler.hpp>
+
namespace DOM
{
- CComment::CComment(const xmlNodePtr aNodePtr)
- : CComment_Base(NodeType_COMMENT_NODE, aNodePtr)
+ CComment::CComment(CDocument const& rDocument, xmlNodePtr const pNode)
+ : CComment_Base(rDocument, NodeType_COMMENT_NODE, pNode)
{
}
diff --git a/unoxml/source/dom/comment.hxx b/unoxml/source/dom/comment.hxx
index cd8169662fa9..208a075d4ea5 100644
--- a/unoxml/source/dom/comment.hxx
+++ b/unoxml/source/dom/comment.hxx
@@ -29,9 +29,10 @@
#define DOM_COMMENT_HXX
#include <com/sun/star/uno/Reference.h>
-#include <com/sun/star/uno/Exception.hpp>
#include <com/sun/star/xml/dom/XComment.hpp>
-#include "characterdata.hxx"
+
+#include <characterdata.hxx>
+
using ::rtl::OUString;
using namespace com::sun::star::uno;
@@ -48,7 +49,7 @@ namespace DOM
friend class CNode;
protected:
- CComment(const xmlNodePtr aNodePtr);
+ CComment(CDocument const& rDocument, xmlNodePtr const pNode);
public:
diff --git a/unoxml/source/dom/document.cxx b/unoxml/source/dom/document.cxx
index 6e9915f550bd..a84358fd69d8 100644
--- a/unoxml/source/dom/document.cxx
+++ b/unoxml/source/dom/document.cxx
@@ -74,7 +74,7 @@ namespace DOM
}
CDocument::CDocument(xmlDocPtr aDocPtr)
- : CDocument_Base(
+ : CDocument_Base(*this,
NodeType_DOCUMENT_NODE, reinterpret_cast<xmlNodePtr>(aDocPtr))
, m_aDocPtr(aDocPtr)
, m_streamListeners()
diff --git a/unoxml/source/dom/document.hxx b/unoxml/source/dom/document.hxx
index 0743e39d797c..8a5758bfe415 100644
--- a/unoxml/source/dom/document.hxx
+++ b/unoxml/source/dom/document.hxx
@@ -86,7 +86,7 @@ namespace DOM
typedef set< Reference< XStreamListener > > listenerlist_t;
private:
- xmlDocPtr m_aDocPtr;
+ xmlDocPtr const m_aDocPtr;
// datacontrol/source state
listenerlist_t m_streamListeners;
diff --git a/unoxml/source/dom/documentfragment.cxx b/unoxml/source/dom/documentfragment.cxx
index e6ca5f140f27..a2da624b4528 100644
--- a/unoxml/source/dom/documentfragment.cxx
+++ b/unoxml/source/dom/documentfragment.cxx
@@ -25,12 +25,14 @@
*
************************************************************************/
-#include "documentfragment.hxx"
+#include <documentfragment.hxx>
namespace DOM
{
- CDocumentFragment::CDocumentFragment(const xmlNodePtr aNodePtr)
- : CDocumentFragment_Base(NodeType_DOCUMENT_FRAGMENT_NODE, aNodePtr)
+ CDocumentFragment::CDocumentFragment(
+ CDocument const& rDocument, xmlNodePtr const pNode)
+ : CDocumentFragment_Base(rDocument,
+ NodeType_DOCUMENT_FRAGMENT_NODE, pNode)
{
}
diff --git a/unoxml/source/dom/documentfragment.hxx b/unoxml/source/dom/documentfragment.hxx
index 8ea1e38a0d8a..56fd0b55b269 100644
--- a/unoxml/source/dom/documentfragment.hxx
+++ b/unoxml/source/dom/documentfragment.hxx
@@ -29,10 +29,10 @@
#define DOM_DOCUMENTFRAGMENT_HXX
#include <com/sun/star/uno/Reference.h>
-#include <com/sun/star/uno/Exception.hpp>
#include <com/sun/star/xml/dom/XDocumentFragment.hpp>
-#include "node.hxx"
+#include <node.hxx>
+
using ::rtl::OUString;
using namespace com::sun::star::uno;
@@ -48,7 +48,8 @@ namespace DOM
{
friend class CNode;
protected:
- CDocumentFragment(const xmlNodePtr aNodePtr);
+ CDocumentFragment(CDocument const& rDocument,
+ xmlNodePtr const pNode);
public:
// ---- resolve uno inheritance problems...
diff --git a/unoxml/source/dom/documenttype.cxx b/unoxml/source/dom/documenttype.cxx
index 132991781b5d..7f970ca68369 100644
--- a/unoxml/source/dom/documenttype.cxx
+++ b/unoxml/source/dom/documenttype.cxx
@@ -25,19 +25,22 @@
*
************************************************************************/
-#include "documenttype.hxx"
-#include "entitiesmap.hxx"
-#include "notationsmap.hxx"
+#include <documenttype.hxx>
#include <string.h>
+#include <entitiesmap.hxx>
+#include <notationsmap.hxx>
+
+
namespace DOM
{
- CDocumentType::CDocumentType(const xmlDtdPtr aDtdPtr)
- : CDocumentType_Base(
- NodeType_DOCUMENT_TYPE_NODE, reinterpret_cast<xmlNodePtr>(aDtdPtr))
- , m_aDtdPtr(aDtdPtr)
+ CDocumentType::CDocumentType(
+ CDocument const& rDocument, xmlDtdPtr const pDtd)
+ : CDocumentType_Base(rDocument,
+ NodeType_DOCUMENT_TYPE_NODE, reinterpret_cast<xmlNodePtr>(pDtd))
+ , m_aDtdPtr(pDtd)
{
}
diff --git a/unoxml/source/dom/documenttype.hxx b/unoxml/source/dom/documenttype.hxx
index fd4859ab0d2f..654c88c3062d 100644
--- a/unoxml/source/dom/documenttype.hxx
+++ b/unoxml/source/dom/documenttype.hxx
@@ -28,16 +28,17 @@
#ifndef DOM_DOCUMENTTYPE_HXX
#define DOM_DOCUMENTTYPE_HXX
+#include <libxml/tree.h>
+
#include <sal/types.h>
+
#include <com/sun/star/uno/Reference.h>
-#include <com/sun/star/uno/Exception.hpp>
#include <com/sun/star/xml/dom/XDocumentType.hpp>
#include <com/sun/star/xml/dom/XNodeList.hpp>
#include <com/sun/star/xml/dom/XNamedNodeMap.hpp>
-#include "node.hxx"
+#include <node.hxx>
-#include <libxml/tree.h>
using ::rtl::OUString;
using namespace com::sun::star::uno;
@@ -56,7 +57,7 @@ namespace DOM
xmlDtdPtr m_aDtdPtr;
protected:
- CDocumentType(const xmlDtdPtr aDtdPtr);
+ CDocumentType(CDocument const& rDocument, xmlDtdPtr const pDtd);
public:
/**
diff --git a/unoxml/source/dom/element.cxx b/unoxml/source/dom/element.cxx
index 4267579bf934..6d779599cc96 100644
--- a/unoxml/source/dom/element.cxx
+++ b/unoxml/source/dom/element.cxx
@@ -25,24 +25,27 @@
*
************************************************************************/
-#include "node.hxx"
-#include "element.hxx"
-#include "attr.hxx"
-#include "elementlist.hxx"
-#include "attributesmap.hxx"
-#include "../events/mutationevent.hxx"
+#include <element.hxx>
+
+#include <string.h>
-#include "comphelper/attributelist.hxx"
#include <com/sun/star/xml/sax/FastToken.hdl>
-#include <string.h>
+#include <comphelper/attributelist.hxx>
+
+#include <node.hxx>
+#include <attr.hxx>
+#include <elementlist.hxx>
+#include <attributesmap.hxx>
+
+#include "../events/mutationevent.hxx"
namespace DOM
{
- CElement::CElement(const xmlNodePtr aNodePtr)
- : CElement_Base(NodeType_ELEMENT_NODE, aNodePtr)
+ CElement::CElement(CDocument const& rDocument, xmlNodePtr const pNode)
+ : CElement_Base(rDocument, NodeType_ELEMENT_NODE, pNode)
{
}
diff --git a/unoxml/source/dom/element.hxx b/unoxml/source/dom/element.hxx
index b708ed23617a..89ff9b349ded 100644
--- a/unoxml/source/dom/element.hxx
+++ b/unoxml/source/dom/element.hxx
@@ -28,14 +28,16 @@
#ifndef DOM_ELEMENT_HXX
#define DOM_ELEMENT_HXX
+#include <libxml/tree.h>
+
#include <com/sun/star/uno/Reference.h>
-#include <com/sun/star/uno/Exception.hpp>
#include <com/sun/star/xml/dom/XNode.hpp>
#include <com/sun/star/xml/dom/XNodeList.hpp>
#include <com/sun/star/xml/dom/XNamedNodeMap.hpp>
#include <com/sun/star/xml/dom/NodeType.hpp>
-#include <libxml/tree.h>
-#include "node.hxx"
+
+#include <node.hxx>
+
using ::rtl::OUString;
using namespace com::sun::star::uno;
@@ -54,7 +56,7 @@ namespace DOM
throw (RuntimeException);
protected:
- CElement(const xmlNodePtr aNodePtr);
+ CElement(CDocument const& rDocument, xmlNodePtr const pNode);
public:
diff --git a/unoxml/source/dom/entity.cxx b/unoxml/source/dom/entity.cxx
index 5af71fa896e3..c64f39ea11f6 100644
--- a/unoxml/source/dom/entity.cxx
+++ b/unoxml/source/dom/entity.cxx
@@ -25,17 +25,18 @@
*
************************************************************************/
-#include "entity.hxx"
+#include <entity.hxx>
#include <string.h>
+
namespace DOM
{
- CEntity::CEntity(const xmlEntityPtr aEntityPtr)
- : CEntity_Base(
- NodeType_ENTITY_NODE, reinterpret_cast<xmlNodePtr>(aEntityPtr))
- , m_aEntityPtr(aEntityPtr)
+ CEntity::CEntity(CDocument const& rDocument, xmlEntityPtr const pEntity)
+ : CEntity_Base(rDocument,
+ NodeType_ENTITY_NODE, reinterpret_cast<xmlNodePtr>(pEntity))
+ , m_aEntityPtr(pEntity)
{
}
diff --git a/unoxml/source/dom/entity.hxx b/unoxml/source/dom/entity.hxx
index 2c879e18ea9b..58e4b53dbb21 100644
--- a/unoxml/source/dom/entity.hxx
+++ b/unoxml/source/dom/entity.hxx
@@ -28,13 +28,16 @@
#ifndef DOM_ENTITY_HXX
#define DOM_ENTITY_HXX
+#include <libxml/tree.h>
+#include <libxml/entities.h>
+
#include <sal/types.h>
+
#include <com/sun/star/uno/Reference.h>
-#include <com/sun/star/uno/Exception.hpp>
#include <com/sun/star/xml/dom/XEntity.hpp>
-#include "node.hxx"
-#include <libxml/tree.h>
-#include <libxml/entities.h>
+
+#include <node.hxx>
+
using ::rtl::OUString;
using namespace com::sun::star::uno;
@@ -52,7 +55,7 @@ namespace DOM
xmlEntityPtr m_aEntityPtr;
protected:
- CEntity(const xmlEntityPtr aEntityPtr);
+ CEntity(CDocument const& rDocument, xmlEntityPtr const pEntity);
public:
diff --git a/unoxml/source/dom/entityreference.cxx b/unoxml/source/dom/entityreference.cxx
index c6fc07fe6b88..8b24bbde8ce4 100644
--- a/unoxml/source/dom/entityreference.cxx
+++ b/unoxml/source/dom/entityreference.cxx
@@ -25,13 +25,16 @@
*
************************************************************************/
-#include "entityreference.hxx"
+#include <entityreference.hxx>
+
#include <string.h>
namespace DOM
{
- CEntityReference::CEntityReference(const xmlNodePtr aNodePtr)
- : CEntityReference_Base(NodeType_ENTITY_REFERENCE_NODE, aNodePtr)
+ CEntityReference::CEntityReference(
+ CDocument const& rDocument, xmlNodePtr const pNode)
+ : CEntityReference_Base(rDocument,
+ NodeType_ENTITY_REFERENCE_NODE, pNode)
{
}
diff --git a/unoxml/source/dom/entityreference.hxx b/unoxml/source/dom/entityreference.hxx
index 5ebe5cd7be0e..63cad5fe302e 100644
--- a/unoxml/source/dom/entityreference.hxx
+++ b/unoxml/source/dom/entityreference.hxx
@@ -28,11 +28,13 @@
#ifndef DOM_ENTITYREFERENCE_HXX
#define DOM_ENTITYREFERENCE_HXX
+#include <libxml/tree.h>
+
#include <com/sun/star/uno/Reference.h>
-#include <com/sun/star/uno/Exception.hpp>
#include <com/sun/star/xml/dom/XEntityReference.hpp>
-#include "node.hxx"
-#include <libxml/tree.h>
+
+#include <node.hxx>
+
using ::rtl::OUString;
using namespace com::sun::star::uno;
@@ -48,7 +50,7 @@ namespace DOM
{
friend class CNode;
protected:
- CEntityReference(const xmlNodePtr aNodePtr);
+ CEntityReference(CDocument const& rDocument, xmlNodePtr const pNode);
public:
// ---- resolve uno inheritance problems...
diff --git a/unoxml/source/dom/node.cxx b/unoxml/source/dom/node.cxx
index 0aa42d5d6d17..85de84c71e30 100644
--- a/unoxml/source/dom/node.cxx
+++ b/unoxml/source/dom/node.cxx
@@ -209,32 +209,32 @@ namespace DOM
{
case XML_ELEMENT_NODE:
// m_aNodeType = NodeType::ELEMENT_NODE;
- pCNode = static_cast< CNode* >(new CElement(pNode));
+ pCNode = static_cast< CNode* >(new CElement(*(CDocument*)0, pNode));
break;
case XML_TEXT_NODE:
// m_aNodeType = NodeType::TEXT_NODE;
- pCNode = static_cast< CNode* >(new CText(pNode));
+ pCNode = static_cast< CNode* >(new CText(*(CDocument*)0, pNode));
break;
case XML_CDATA_SECTION_NODE:
// m_aNodeType = NodeType::CDATA_SECTION_NODE;
- pCNode = static_cast< CNode* >(new CCDATASection(pNode));
+ pCNode = static_cast< CNode* >(new CCDATASection(*(CDocument*)0, pNode));
break;
case XML_ENTITY_REF_NODE:
// m_aNodeType = NodeType::ENTITY_REFERENCE_NODE;
- pCNode = static_cast< CNode* >(new CEntityReference(pNode));
+ pCNode = static_cast< CNode* >(new CEntityReference(*(CDocument*)0, pNode));
break;
case XML_ENTITY_NODE:
// m_aNodeType = NodeType::ENTITY_NODE;
- pCNode = static_cast< CNode* >(new CEntity(
+ pCNode = static_cast< CNode* >(new CEntity(*(CDocument*)0,
reinterpret_cast<xmlEntityPtr>(pNode)));
break;
case XML_PI_NODE:
// m_aNodeType = NodeType::PROCESSING_INSTRUCTION_NODE;
- pCNode = static_cast< CNode* >(new CProcessingInstruction(pNode));
+ pCNode = static_cast< CNode* >(new CProcessingInstruction(*(CDocument*)0, pNode));
break;
case XML_COMMENT_NODE:
// m_aNodeType = NodeType::COMMENT_NODE;
- pCNode = static_cast< CNode* >(new CComment(pNode));
+ pCNode = static_cast< CNode* >(new CComment(*(CDocument*)0, pNode));
break;
case XML_DOCUMENT_NODE:
// m_aNodeType = NodeType::DOCUMENT_NODE;
@@ -244,21 +244,21 @@ namespace DOM
case XML_DOCUMENT_TYPE_NODE:
case XML_DTD_NODE:
// m_aNodeType = NodeType::DOCUMENT_TYPE_NODE;
- pCNode = static_cast< CNode* >(new CDocumentType(
+ pCNode = static_cast< CNode* >(new CDocumentType(*(CDocument*)0,
reinterpret_cast<xmlDtdPtr>(pNode)));
break;
case XML_DOCUMENT_FRAG_NODE:
// m_aNodeType = NodeType::DOCUMENT_FRAGMENT_NODE;
- pCNode = static_cast< CNode* >(new CDocumentFragment(pNode));
+ pCNode = static_cast< CNode* >(new CDocumentFragment(*(CDocument*)0, pNode));
break;
case XML_NOTATION_NODE:
// m_aNodeType = NodeType::NOTATION_NODE;
- pCNode = static_cast< CNode* >(new CNotation(
+ pCNode = static_cast< CNode* >(new CNotation(*(CDocument*)0,
reinterpret_cast<xmlNotationPtr>(pNode)));
break;
case XML_ATTRIBUTE_NODE:
// m_aNodeType = NodeType::ATTRIBUTE_NODE;
- pCNode = static_cast< CNode* >(new CAttr(
+ pCNode = static_cast< CNode* >(new CAttr(*(CDocument*)0,
reinterpret_cast<xmlAttrPtr>(pNode)));
break;
// unsupported node types
@@ -300,14 +300,15 @@ namespace DOM
}
- CNode::CNode(NodeType const& reNodeType, xmlNodePtr const& rpNode)
+ CNode::CNode(CDocument const& rDocument,
+ NodeType const& reNodeType, xmlNodePtr const& rpNode)
: m_bUnlinked(false)
, m_aNodeType(reNodeType)
, m_aNodePtr(rpNode)
// keep containing document alive
// (but not if this is a document; that would create a leak!)
, m_xDocument( (m_aNodePtr->type != XML_DOCUMENT_NODE)
- ? GetOwnerDocument_Impl() : 0 )
+ ? &const_cast<CDocument&>(rDocument) : 0 )
{
OSL_ASSERT(m_aNodePtr);
}
diff --git a/unoxml/source/dom/node.hxx b/unoxml/source/dom/node.hxx
index 2ad773b725bb..5ea34f548264 100644
--- a/unoxml/source/dom/node.hxx
+++ b/unoxml/source/dom/node.hxx
@@ -135,7 +135,8 @@ namespace DOM
::rtl::Reference< CDocument > const m_xDocument;
// for initialization by classes derived through ImplInheritanceHelper
- CNode(NodeType const& reNodeType, xmlNodePtr const& rpNode);
+ CNode(CDocument const& rDocument,
+ NodeType const& reNodeType, xmlNodePtr const& rpNode);
void invalidate();
void dispatchSubtreeModified();
diff --git a/unoxml/source/dom/notation.cxx b/unoxml/source/dom/notation.cxx
index f380b856ecf0..ff35fae60129 100644
--- a/unoxml/source/dom/notation.cxx
+++ b/unoxml/source/dom/notation.cxx
@@ -25,15 +25,17 @@
*
************************************************************************/
-#include "notation.hxx"
+#include <notation.hxx>
+
#include <string.h>
namespace DOM
{
- CNotation::CNotation(const xmlNotationPtr aNotationPtr)
- : CNotation_Base(
- NodeType_NOTATION_NODE, reinterpret_cast<xmlNodePtr>(aNotationPtr))
- , m_aNotationPtr(aNotationPtr)
+ CNotation::CNotation(CDocument const& rDocument,
+ xmlNotationPtr const pNotation)
+ : CNotation_Base(rDocument,
+ NodeType_NOTATION_NODE, reinterpret_cast<xmlNodePtr>(pNotation))
+ , m_aNotationPtr(pNotation)
{
}
diff --git a/unoxml/source/dom/notation.hxx b/unoxml/source/dom/notation.hxx
index d7ce54a64646..6ec98bce7212 100644
--- a/unoxml/source/dom/notation.hxx
+++ b/unoxml/source/dom/notation.hxx
@@ -28,11 +28,13 @@
#ifndef DOM_NOTATION_HXX
#define DOM_NOTATION_HXX
+#include <libxml/tree.h>
+
#include <com/sun/star/uno/Reference.h>
-#include <com/sun/star/uno/Exception.hpp>
#include <com/sun/star/xml/dom/XNotation.hpp>
-#include "node.hxx"
-#include <libxml/tree.h>
+
+#include <node.hxx>
+
using ::rtl::OUString;
using namespace com::sun::star::uno;
@@ -50,7 +52,7 @@ namespace DOM
xmlNotationPtr m_aNotationPtr;
protected:
- CNotation(const xmlNotationPtr);
+ CNotation(CDocument const& rDocument, xmlNotationPtr const pNotation);
/**
The public identifier of this notation.
diff --git a/unoxml/source/dom/processinginstruction.cxx b/unoxml/source/dom/processinginstruction.cxx
index 5f39174cf50f..c75f3d9d6b29 100644
--- a/unoxml/source/dom/processinginstruction.cxx
+++ b/unoxml/source/dom/processinginstruction.cxx
@@ -25,15 +25,19 @@
*
************************************************************************/
-#include "processinginstruction.hxx"
-#include <com/sun/star/xml/sax/XExtendedDocumentHandler.hpp>
+#include <processinginstruction.hxx>
+
#include <string.h>
+#include <com/sun/star/xml/sax/XExtendedDocumentHandler.hpp>
+
+
namespace DOM
{
- CProcessingInstruction::CProcessingInstruction(const xmlNodePtr aNodePtr)
- : CProcessingInstruction_Base(
- NodeType_PROCESSING_INSTRUCTION_NODE, aNodePtr)
+ CProcessingInstruction::CProcessingInstruction(
+ CDocument const& rDocument, xmlNodePtr const pNode)
+ : CProcessingInstruction_Base(rDocument,
+ NodeType_PROCESSING_INSTRUCTION_NODE, pNode)
{
}
diff --git a/unoxml/source/dom/processinginstruction.hxx b/unoxml/source/dom/processinginstruction.hxx
index d8546d28a2c6..26f561a02e37 100644
--- a/unoxml/source/dom/processinginstruction.hxx
+++ b/unoxml/source/dom/processinginstruction.hxx
@@ -28,11 +28,13 @@
#ifndef DOM_PROCESSINGINSTRUCTION_HXX
#define DOM_PROCESSINGINSTRUCTION_HXX
+#include <libxml/tree.h>
+
#include <com/sun/star/uno/Reference.h>
-#include <com/sun/star/uno/Exception.hpp>
#include <com/sun/star/xml/dom/XProcessingInstruction.hpp>
-#include "node.hxx"
-#include <libxml/tree.h>
+
+#include <node.hxx>
+
using ::rtl::OUString;
using namespace com::sun::star::uno;
@@ -49,7 +51,8 @@ namespace DOM
friend class CNode;
protected:
- CProcessingInstruction(const xmlNodePtr aNodePtr);
+ CProcessingInstruction(CDocument const& rDocument,
+ xmlNodePtr const pNode);
public:
diff --git a/unoxml/source/dom/text.cxx b/unoxml/source/dom/text.cxx
index 690aef57d7c3..a5fff96d30dc 100644
--- a/unoxml/source/dom/text.cxx
+++ b/unoxml/source/dom/text.cxx
@@ -25,17 +25,19 @@
*
************************************************************************/
-#include "text.hxx"
+#include <text.hxx>
+
namespace DOM
{
- CText::CText(NodeType const& reNodeType, xmlNodePtr const& rpNode)
- : CText_Base(reNodeType, rpNode)
+ CText::CText(CDocument const& rDocument,
+ NodeType const& reNodeType, xmlNodePtr const& rpNode)
+ : CText_Base(rDocument, reNodeType, rpNode)
{
}
- CText::CText(const xmlNodePtr aNodePtr)
- : CText_Base(NodeType_TEXT_NODE, aNodePtr)
+ CText::CText(CDocument const& rDocument, xmlNodePtr const pNode)
+ : CText_Base(rDocument, NodeType_TEXT_NODE, pNode)
{
}
diff --git a/unoxml/source/dom/text.hxx b/unoxml/source/dom/text.hxx
index f342cfa334f5..6449ff8afc2e 100644
--- a/unoxml/source/dom/text.hxx
+++ b/unoxml/source/dom/text.hxx
@@ -28,15 +28,18 @@
#ifndef DOM_TEXT_HXX
#define DOM_TEXT_HXX
+#include <libxml/tree.h>
+
#include <sal/types.h>
+
#include <cppuhelper/implbase1.hxx>
+
#include <com/sun/star/uno/Reference.h>
-#include <com/sun/star/uno/Exception.hpp>
#include <com/sun/star/xml/dom/XNode.hpp>
#include <com/sun/star/xml/dom/XText.hpp>
-#include <com/sun/star/xml/dom/XCharacterData.hpp>
-#include <libxml/tree.h>
-#include "characterdata.hxx"
+
+#include <characterdata.hxx>
+
using ::rtl::OUString;
using namespace com::sun::star::uno;
@@ -52,8 +55,9 @@ namespace DOM
friend class CNode;
protected:
- CText(NodeType const& reNodeType, xmlNodePtr const& rpNode);
- CText(const xmlNodePtr aNodePtr);
+ CText(CDocument const& rDocument,
+ NodeType const& reNodeType, xmlNodePtr const& rpNode);
+ CText(CDocument const& rDocument, xmlNodePtr const pNode);
public: