From 3b60758a74b95ed9454a81fe7fc1abca6952085a Mon Sep 17 00:00:00 2001 From: Scott Cantor Date: Thu, 19 Aug 2010 13:59:28 +0000 Subject: [PATCH] Cleaned up conditional in setDOM method. --- xmltooling/AbstractDOMCachingXMLObject.cpp | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) 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); } } -- 2.1.4