You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by tn...@apache.org on 2002/07/16 16:04:07 UTC
cvs commit: xml-xerces/c/src/xercesc/dom/impl DOMDocumentTypeImpl.cpp DOMDocumentTypeImpl.hpp
tng 2002/07/16 07:04:07
Modified: c/src/xercesc/dom/impl DOMDocumentTypeImpl.cpp
DOMDocumentTypeImpl.hpp
Log:
DOM fix: internal subset is incorrectly overwritten instead of being appended
Revision Changes Path
1.7 +12 -21 xml-xerces/c/src/xercesc/dom/impl/DOMDocumentTypeImpl.cpp
Index: DOMDocumentTypeImpl.cpp
===================================================================
RCS file: /home/cvs/xml-xerces/c/src/xercesc/dom/impl/DOMDocumentTypeImpl.cpp,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- DOMDocumentTypeImpl.cpp 15 Jul 2002 19:22:22 -0000 1.6
+++ DOMDocumentTypeImpl.cpp 16 Jul 2002 14:04:07 -0000 1.7
@@ -75,7 +75,6 @@
publicId(0),
systemId(0),
name(0),
- internalSubset(0), //DOM Level 2
intSubsetReading(false),
entities(0),
notations(0),
@@ -108,7 +107,6 @@
publicId(0),
systemId(0),
name(0),
- internalSubset(0), //DOM Level 2
intSubsetReading(false),
entities(0),
notations(0),
@@ -145,7 +143,6 @@
publicId(0),
systemId(0),
name(0),
- internalSubset(0), //DOM Level 2
intSubsetReading(other.intSubsetReading),
entities(0),
notations(0),
@@ -159,15 +156,14 @@
//DOM Level 2
publicId = other.publicId;
systemId = other.systemId;
- internalSubset = other.internalSubset;
}
else {
name = XMLString::replicate(other.name);
publicId = XMLString::replicate(other.publicId);
systemId = XMLString::replicate(other.systemId);
- internalSubset = XMLString::replicate(other.internalSubset);
}
+ internalSubset.set(other.internalSubset.getRawBuffer());
entities = ((DOMNamedNodeMapImpl *)other.entities)->cloneMap(this);
notations= ((DOMNamedNodeMapImpl *)other.notations)->cloneMap(this);
elements = ((DOMNamedNodeMapImpl *)other.elements)->cloneMap(this);
@@ -187,9 +183,6 @@
temp = (XMLCh*) systemId;
delete [] temp;
- temp = (XMLCh*) internalSubset;
- delete [] temp;
-
delete entities;
delete notations;
delete elements;
@@ -230,10 +223,6 @@
systemId = docImpl->cloneString(systemId);
delete [] temp;
- temp = (XMLCh*) internalSubset; // cast off const
- internalSubset = docImpl->cloneString(internalSubset);
- delete [] temp;
-
temp = (XMLCh*) name; // cast off const
name = docImpl->cloneString(name);
delete [] temp;
@@ -325,7 +314,7 @@
const XMLCh * DOMDocumentTypeImpl::getInternalSubset() const
{
- return internalSubset;
+ return internalSubset.getRawBuffer();
}
bool DOMDocumentTypeImpl::isIntSubsetReading() const
@@ -370,13 +359,15 @@
if (value == 0)
return;
- if ((DOMDocumentImpl *)castToNodeImpl(this)->getOwnerDocument())
- internalSubset = ((DOMDocumentImpl *)castToNodeImpl(this)->getOwnerDocument())->getPooledString(value);
- else {
- XMLCh* temp = (XMLCh*) internalSubset; // cast off const
- delete [] temp;
- internalSubset = XMLString::replicate(value);
- }
+ internalSubset.set(value);
+}
+
+void DOMDocumentTypeImpl::appendInternalSubset(const XMLCh *value)
+{
+ if (value == 0)
+ return;
+
+ internalSubset.append(value);
}
void DOMDocumentTypeImpl::release()
1.4 +4 -2 xml-xerces/c/src/xercesc/dom/impl/DOMDocumentTypeImpl.hpp
Index: DOMDocumentTypeImpl.hpp
===================================================================
RCS file: /home/cvs/xml-xerces/c/src/xercesc/dom/impl/DOMDocumentTypeImpl.hpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- DOMDocumentTypeImpl.hpp 25 Jun 2002 16:17:16 -0000 1.3
+++ DOMDocumentTypeImpl.hpp 16 Jul 2002 14:04:07 -0000 1.4
@@ -73,6 +73,7 @@
#include <xercesc/util/XercesDefs.hpp>
+#include <xercesc/framework/XMLBuffer.hpp>
#include <xercesc/dom/DOMDocumentType.hpp>
#include "DOMNodeImpl.hpp"
#include "DOMChildNode.hpp"
@@ -94,7 +95,7 @@
DOMNamedNodeMap* elements;
const XMLCh * publicId;
const XMLCh * systemId;
- const XMLCh * internalSubset;
+ XMLBuffer internalSubset;
bool intSubsetReading;
bool fIsCreatedFromHeap;
@@ -102,6 +103,7 @@
virtual void setPublicId(const XMLCh * value);
virtual void setSystemId(const XMLCh * value);
virtual void setInternalSubset(const XMLCh *value);
+ void appendInternalSubset(const XMLCh *value);
bool isIntSubsetReading() const;
friend class AbstractDOMParser;
---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-cvs-help@xml.apache.org