From ec5159a8f4038f155097a95aaa311fd26d3c1fa3 Mon Sep 17 00:00:00 2001 From: jez_higgins <> Date: Wed, 28 Jan 2004 21:38:17 +0000 Subject: [PATCH] Fix to addElement --- DOM/Simple/DocumentTypeImpl.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/DOM/Simple/DocumentTypeImpl.h b/DOM/Simple/DocumentTypeImpl.h index 8a9d2ad4..bfa14edb 100644 --- a/DOM/Simple/DocumentTypeImpl.h +++ b/DOM/Simple/DocumentTypeImpl.h @@ -141,6 +141,11 @@ class DocumentTypeImpl : public DOM::DocumentType_impl, void addElement(SimpleDOM::ElementImpl* element) { + if(elements_.getNamedItem(element->getNodeName()) != 0) + { + delete element; + return; // already have an element decl for it + } // if ... element->setOwnerDoc(ownerDoc_); elements_.setNamedItem(element); } // addElements