X-Git-Url: http://www.project-moonshot.org/gitweb/?a=blobdiff_plain;f=xmltooling%2FAbstractDOMCachingXMLObject.cpp;fp=xmltooling%2FAbstractDOMCachingXMLObject.cpp;h=684b466fd36e0fa1710dd2535974b9d63364bcd3;hb=3b60758a74b95ed9454a81fe7fc1abca6952085a;hp=38c25ccc34c7b2e52220efa1a9cd94f932d1a748;hpb=58e11535fa0bd6844fd6a386eaac3a102d9ba93e;p=shibboleth%2Fcpp-xmltooling.git diff --git a/xmltooling/AbstractDOMCachingXMLObject.cpp b/xmltooling/AbstractDOMCachingXMLObject.cpp index 38c25cc..684b466 100644 --- a/xmltooling/AbstractDOMCachingXMLObject.cpp +++ b/xmltooling/AbstractDOMCachingXMLObject.cpp @@ -56,18 +56,14 @@ DOMElement* AbstractDOMCachingXMLObject::getDOM() const void AbstractDOMCachingXMLObject::setDOM(DOMElement* dom, bool bindDocument) const { m_dom = dom; - if (dom) { - if (bindDocument) { - DOMDocument* doc = dom->getOwnerDocument(); - setDocument(doc); - if (dom) { - DOMElement* documentRoot = doc->getDocumentElement(); - if (!documentRoot) - doc->appendChild(dom); - else if (documentRoot != dom) - doc->replaceChild(dom, documentRoot); - } - } + if (dom && bindDocument) { + DOMDocument* doc = dom->getOwnerDocument(); + setDocument(doc); + DOMElement* documentRoot = doc->getDocumentElement(); + if (!documentRoot) + doc->appendChild(dom); + else if (documentRoot != dom) + doc->replaceChild(dom, documentRoot); } }