You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by le...@locus.apache.org on 2000/04/07 22:58:37 UTC
cvs commit: xml-xerces/c/src/dom DocumentTypeImpl.cpp ElementDefinitionImpl.cpp ElementImpl.cpp NamedNodeMapImpl.cpp NamedNodeMapImpl.hpp
lehors 00/04/07 13:58:37
Modified: c/src/dom DocumentTypeImpl.cpp ElementDefinitionImpl.cpp
ElementImpl.cpp NamedNodeMapImpl.cpp
NamedNodeMapImpl.hpp
Log:
fixed all cloneMap so that the ownerNode is correct
Revision Changes Path
1.15 +4 -4 xml-xerces/c/src/dom/DocumentTypeImpl.cpp
Index: DocumentTypeImpl.cpp
===================================================================
RCS file: /home/cvs/xml-xerces/c/src/dom/DocumentTypeImpl.cpp,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- DocumentTypeImpl.cpp 2000/04/07 00:51:45 1.14
+++ DocumentTypeImpl.cpp 2000/04/07 20:58:36 1.15
@@ -55,7 +55,7 @@
*/
/*
- * $Id: DocumentTypeImpl.cpp,v 1.14 2000/04/07 00:51:45 lehors Exp $
+ * $Id: DocumentTypeImpl.cpp,v 1.15 2000/04/07 20:58:36 lehors Exp $
*/
#include "DocumentTypeImpl.hpp"
@@ -103,11 +103,11 @@
name = other.name.clone();
if (deep)
cloneChildren(other);
- entities = other.entities->cloneMap();
- notations= other.notations->cloneMap();
+ entities = other.entities->cloneMap(this);
+ notations= other.notations->cloneMap(this);
// NON-DOM
- elements = other.elements->cloneMap();
+ elements = other.elements->cloneMap(this);
//DOM Level 2
publicId = other.publicId.clone();
1.8 +2 -2 xml-xerces/c/src/dom/ElementDefinitionImpl.cpp
Index: ElementDefinitionImpl.cpp
===================================================================
RCS file: /home/cvs/xml-xerces/c/src/dom/ElementDefinitionImpl.cpp,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- ElementDefinitionImpl.cpp 2000/04/07 00:51:45 1.7
+++ ElementDefinitionImpl.cpp 2000/04/07 20:58:36 1.8
@@ -55,7 +55,7 @@
*/
/*
- * $Id: ElementDefinitionImpl.cpp,v 1.7 2000/04/07 00:51:45 lehors Exp $
+ * $Id: ElementDefinitionImpl.cpp,v 1.8 2000/04/07 20:58:36 lehors Exp $
*/
#include "ElementDefinitionImpl.hpp"
@@ -81,7 +81,7 @@
// NamedNodeMap must be explicitly replicated to avoid sharing
attributes = 0;
if (other.attributes)
- attributes = other.attributes->cloneMap();
+ attributes = other.attributes->cloneMap(this);
};
1.19 +2 -2 xml-xerces/c/src/dom/ElementImpl.cpp
Index: ElementImpl.cpp
===================================================================
RCS file: /home/cvs/xml-xerces/c/src/dom/ElementImpl.cpp,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -r1.18 -r1.19
--- ElementImpl.cpp 2000/04/07 00:51:45 1.18
+++ ElementImpl.cpp 2000/04/07 20:58:36 1.19
@@ -55,7 +55,7 @@
*/
/*
- * $Id: ElementImpl.cpp,v 1.18 2000/04/07 00:51:45 lehors Exp $
+ * $Id: ElementImpl.cpp,v 1.19 2000/04/07 20:58:36 lehors Exp $
*/
#include "DeepNodeListImpl.hpp"
@@ -95,7 +95,7 @@
name = other.name.clone();
if (deep)
cloneChildren(other);
- attributes = other.attributes->cloneMap();
+ attributes = other.attributes->cloneMap(this);
};
1.12 +5 -6 xml-xerces/c/src/dom/NamedNodeMapImpl.cpp
Index: NamedNodeMapImpl.cpp
===================================================================
RCS file: /home/cvs/xml-xerces/c/src/dom/NamedNodeMapImpl.cpp,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- NamedNodeMapImpl.cpp 2000/04/06 21:17:48 1.11
+++ NamedNodeMapImpl.cpp 2000/04/07 20:58:36 1.12
@@ -55,7 +55,7 @@
*/
/*
- * $Id: NamedNodeMapImpl.cpp,v 1.11 2000/04/06 21:17:48 lehors Exp $
+ * $Id: NamedNodeMapImpl.cpp,v 1.12 2000/04/07 20:58:36 lehors Exp $
*/
#include "NamedNodeMapImpl.hpp"
@@ -106,16 +106,15 @@
};
-NamedNodeMapImpl *NamedNodeMapImpl::cloneMap()
+NamedNodeMapImpl *NamedNodeMapImpl::cloneMap(NodeImpl *ownerNode)
{
- bool deep = true;
NamedNodeMapImpl *newmap = new NamedNodeMapImpl(ownerNode, defaults);
if (nodes != null)
{
newmap->nodes = new NodeVector(nodes->size());
for (unsigned int i = 0; i < nodes->size(); ++i)
{
- NodeImpl *n = nodes->elementAt(i)->cloneNode(deep);
+ NodeImpl *n = nodes->elementAt(i)->cloneNode(true);
n->ownerNode = ownerNode;
newmap->nodes->addElement(n);
}
@@ -465,7 +464,6 @@
*/
NamedNodeMapImpl *NamedNodeMapImpl::exportNode(NodeImpl *node)
{
- bool deep = true;
NamedNodeMapImpl *newdefs =
defaults == null ? null : defaults->exportNode(node);
NamedNodeMapImpl *newmap = new NamedNodeMapImpl(node, newdefs);
@@ -474,7 +472,8 @@
newmap->nodes = new NodeVector(nodes->size());
for (unsigned int i = 0; i < nodes->size(); ++i)
{
- NodeImpl *n = node->ownerDocument->importNode(nodes->elementAt(i), deep);
+ NodeImpl *n =
+ node->ownerDocument->importNode(nodes->elementAt(i), true);
n->ownerNode = ownerNode;
newmap->nodes->addElement(n);
}
1.10 +5 -1 xml-xerces/c/src/dom/NamedNodeMapImpl.hpp
Index: NamedNodeMapImpl.hpp
===================================================================
RCS file: /home/cvs/xml-xerces/c/src/dom/NamedNodeMapImpl.hpp,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- NamedNodeMapImpl.hpp 2000/04/06 21:17:48 1.9
+++ NamedNodeMapImpl.hpp 2000/04/07 20:58:36 1.10
@@ -59,6 +59,9 @@
/*
* $Log: NamedNodeMapImpl.hpp,v $
+ * Revision 1.10 2000/04/07 20:58:36 lehors
+ * fixed all cloneMap so that the ownerNode is correct
+ *
* Revision 1.9 2000/04/06 21:17:48 lehors
* got rid of the owned attribute,
* renamed parentNode to ownerNode to make it clear it's not always the parent
@@ -137,7 +140,7 @@
virtual void reconcileDefaults();
virtual ~NamedNodeMapImpl();
- virtual NamedNodeMapImpl *cloneMap();
+ virtual NamedNodeMapImpl *cloneMap(NodeImpl *ownerNode);
static void addRef(NamedNodeMapImpl *);
virtual int findNamePoint(const DOMString &name);
virtual unsigned int getLength();