Cleaned up conditional in setDOM method.
authorcantor <cantor@de75baf8-a10c-0410-a50a-987c0e22f00f>
Thu, 19 Aug 2010 13:59:28 +0000 (13:59 +0000)
committercantor <cantor@de75baf8-a10c-0410-a50a-987c0e22f00f>
Thu, 19 Aug 2010 13:59:28 +0000 (13:59 +0000)
git-svn-id: https://svn.middleware.georgetown.edu/cpp-xmltooling/branches/REL_1@770 de75baf8-a10c-0410-a50a-987c0e22f00f

xmltooling/AbstractDOMCachingXMLObject.cpp

index 38c25cc..684b466 100644 (file)
@@ -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);
     }
 }