summaryrefslogtreecommitdiffstats
path: root/unoxml/source/dom/element.cxx
diff options
context:
space:
mode:
authorMichael Stahl <mst@openoffice.org>2011-02-10 16:45:03 +0100
committerMichael Stahl <mst@openoffice.org>2011-02-10 16:45:03 +0100
commit141773454451569127d388a1f3fd1fdc65f5554a (patch)
tree517a18f27d1d630a865aeaebad9c9a4e0846a182 /unoxml/source/dom/element.cxx
parentxmlfix3: #i113683#: finish CAttributesMap (diff)
downloadcore-141773454451569127d388a1f3fd1fdc65f5554a.tar.gz
core-141773454451569127d388a1f3fd1fdc65f5554a.zip
xmlfix3: unoxml: fix various bugs uncovered by complex test:
CAttr::getSpecified() should return true. CAttr::getValue() and CElement::setAttributeNode() could crash if no children. CAttributesMap::*NS() methods ignored namespaceURI parameter. CDATASection::getNodeValue() forwarded to wrong base class. CDocument needs to override cloneNode(). CDocument::importNode(), CDocumentBuilder::parseURI() deref null argument. CElement::getAttributes() should return an empty map. CElementList could be created for null element. CNode::insertBefore() did not set parent/children pointers. CNode::setPrefix() should only work on element/attribute. CXPathAPI had inverted check for null argument (xmlfix3 regression).
Diffstat (limited to 'unoxml/source/dom/element.cxx')
-rw-r--r--unoxml/source/dom/element.cxx8
1 files changed, 4 insertions, 4 deletions
diff --git a/unoxml/source/dom/element.cxx b/unoxml/source/dom/element.cxx
index 12ea9123294b..8fee8d63d63f 100644
--- a/unoxml/source/dom/element.cxx
+++ b/unoxml/source/dom/element.cxx
@@ -555,13 +555,14 @@ namespace DOM
}
xmlAttrPtr res = NULL;
+ xmlChar const*const pContent(
+ (pAttr->children) ? pAttr->children->content : 0);
if (bNS) {
xmlNsPtr const pNs( pCAttr->GetNamespace(m_aNodePtr) );
- res = xmlNewNsProp(m_aNodePtr,
- pNs, pAttr->name, pAttr->children->content);
+ res = xmlNewNsProp(m_aNodePtr, pNs, pAttr->name, pContent);
} else {
- res = xmlNewProp(m_aNodePtr, pAttr->name, pAttr->children->content);
+ res = xmlNewProp(m_aNodePtr, pAttr->name, pContent);
}
// get the new attr node
@@ -738,7 +739,6 @@ namespace DOM
{
::osl::MutexGuard const g(m_rMutex);
- if (!hasAttributes()) { return 0; }
Reference< XNamedNodeMap > const xMap(
new CAttributesMap(this, m_rMutex));
return xMap;