You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by am...@apache.org on 2004/03/02 14:26:16 UTC

cvs commit: xml-xerces/c/src/xercesc/dom/impl DOMDocumentImpl.cpp

amassari    2004/03/02 05:26:16

  Modified:    c/src/xercesc/dom/impl DOMDocumentImpl.cpp
  Log:
  When cloning a DOMDocument, clone also the encoding, version and standalone info (bug#13056)
  
  Revision  Changes    Path
  1.53      +7 -5      xml-xerces/c/src/xercesc/dom/impl/DOMDocumentImpl.cpp
  
  Index: DOMDocumentImpl.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/xercesc/dom/impl/DOMDocumentImpl.cpp,v
  retrieving revision 1.52
  retrieving revision 1.53
  diff -u -r1.52 -r1.53
  --- DOMDocumentImpl.cpp	29 Jan 2004 11:44:26 -0000	1.52
  +++ DOMDocumentImpl.cpp	2 Mar 2004 13:26:16 -0000	1.53
  @@ -71,7 +71,6 @@
   #include "XSDElementNSImpl.hpp"
   #include "DOMEntityImpl.hpp"
   #include "DOMEntityReferenceImpl.hpp"
  -#include "DOMNamedNodeMapImpl.hpp"
   #include "DOMNormalizer.hpp"
   #include "DOMNotationImpl.hpp"
   #include "DOMProcessingInstructionImpl.hpp"
  @@ -238,10 +237,13 @@
   
   DOMNode *DOMDocumentImpl::cloneNode(bool deep) const {
   
  -    // Note:  the cloned document node goes on the system heap.  All other
  -    //   nodes added to the new document will go on that document's heap,
  -    //   but we need to construct the document first, before its heap exists.
  +    // Note:  the cloned document node goes on the same heap we live in.
       DOMDocumentImpl *newdoc = new (fMemoryManager) DOMDocumentImpl(fMemoryManager);
  +    if(fEncoding && *fEncoding)
  +        newdoc->setEncoding(fEncoding);
  +    if(fVersion && *fVersion)
  +        newdoc->setVersion(fVersion);
  +    newdoc->setStandalone(fStandalone);
   
       // then the children by _importing_ them
       if (deep)
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-cvs-help@xml.apache.org