diff options
Diffstat (limited to 'unoxml/source/dom')
-rw-r--r-- | unoxml/source/dom/element.cxx | 6 | ||||
-rw-r--r-- | unoxml/source/dom/node.cxx | 3 |
2 files changed, 7 insertions, 2 deletions
diff --git a/unoxml/source/dom/element.cxx b/unoxml/source/dom/element.cxx index 7de79e39e3e4..e116f3883e5d 100644 --- a/unoxml/source/dom/element.cxx +++ b/unoxml/source/dom/element.cxx @@ -380,7 +380,8 @@ namespace DOM Reference< XAttr > aAttr; if(m_aNodePtr != NULL) { - xmlAttrPtr pAttr = (xmlAttrPtr) CNode::getNodePtr(oldAttr.get()); + xmlNodePtr const pNode = CNode::getNodePtr(oldAttr.get()); + xmlAttrPtr const pAttr = (xmlAttrPtr) pNode; if (pAttr->parent != m_aNodePtr) { @@ -402,7 +403,8 @@ namespace DOM aAttr = oldAttr->getOwnerDocument()->createAttribute(oldAttr->getName()); aAttr->setValue(oldAttr->getValue()); xmlRemoveProp(pAttr); - + CNode *const pCNode( CNode::get(pNode) ); + pCNode->m_aNodePtr = NULL; // freed by xmlRemoveProp } return aAttr; } diff --git a/unoxml/source/dom/node.cxx b/unoxml/source/dom/node.cxx index 35344b8fe72b..c14389ed4ba9 100644 --- a/unoxml/source/dom/node.cxx +++ b/unoxml/source/dom/node.cxx @@ -831,6 +831,7 @@ namespace DOM { xmlAttrPtr pAttr = (xmlAttrPtr) old; xmlRemoveProp( pAttr ); + pOld->m_aNodePtr = NULL; // freed by xmlRemoveProp xReturn.clear(); } else @@ -900,6 +901,8 @@ namespace DOM xmlAttrPtr pAttr = (xmlAttrPtr)pOld; xmlRemoveProp( pAttr ); + CNode *const pOldNode( CNode::get(pOld) ); + pOldNode->m_aNodePtr = NULL; // freed by xmlRemoveProp appendChild( newChild ); } else |