knoaman 2002/07/30 06:31:07 Modified: c/src/xercesc/dom/impl DOMEntityImpl.hpp DOMEntityImpl.cpp Log: Clone entity ref nodes only once. Revision Changes Path 1.3 +2 -2 xml-xerces/c/src/xercesc/dom/impl/DOMEntityImpl.hpp Index: DOMEntityImpl.hpp =================================================================== RCS file: /home/cvs/xml-xerces/c/src/xercesc/dom/impl/DOMEntityImpl.hpp,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- DOMEntityImpl.hpp 7 Jun 2002 18:39:47 -0000 1.2 +++ DOMEntityImpl.hpp 30 Jul 2002 13:31:07 -0000 1.3 @@ -92,7 +92,7 @@ XMLCh* fActualEncoding; XMLCh* fEncoding; XMLCh* fVersion; - + bool fEntityRefNodeCloned; // private helper function void cloneEntityRefTree() const; 1.7 +10 -3 xml-xerces/c/src/xercesc/dom/impl/DOMEntityImpl.cpp Index: DOMEntityImpl.cpp =================================================================== RCS file: /home/cvs/xml-xerces/c/src/xercesc/dom/impl/DOMEntityImpl.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- DOMEntityImpl.cpp 15 Jul 2002 19:22:22 -0000 1.6 +++ DOMEntityImpl.cpp 30 Jul 2002 13:31:07 -0000 1.7 @@ -72,7 +72,8 @@ fSystemId(0), fActualEncoding(0), fEncoding(0), - fVersion(0) + fVersion(0), + fEntityRefNodeCloned(false) { fRefEntity = 0; fName = ((DOMDocumentImpl *)ownerDoc)->getPooledString(eName); @@ -85,7 +86,8 @@ fParent(other.fParent), fActualEncoding(other.fActualEncoding), fEncoding(other.fEncoding), - fVersion(other.fVersion) + fVersion(other.fVersion), + fEntityRefNodeCloned(false) { fName = other.fName; if (deep) @@ -178,10 +180,14 @@ void DOMEntityImpl::cloneEntityRefTree() const { + if (fEntityRefNodeCloned) + return; + // cast off const. This method is const because it is // called from a bunch of logically const methods, like // getFirstChild(). DOMEntityImpl *ncThis = (DOMEntityImpl *)this; + //lazily clone the entityRef tree to this entity if (fParent.fFirstChild != 0) return; @@ -189,6 +195,7 @@ if (!fRefEntity) return; + ncThis->fEntityRefNodeCloned = true; ncThis->fNode.setReadOnly(false, true); ncThis->fParent.cloneChildren(fRefEntity); ncThis->fNode.setReadOnly(true, true);
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]