diff options
author | Michael Stahl <mst@openoffice.org> | 2011-02-10 16:45:03 +0100 |
---|---|---|
committer | Michael Stahl <mst@openoffice.org> | 2011-02-10 16:45:03 +0100 |
commit | 83588ab3b791910e6a55cc70a45cbb47452011b2 (patch) | |
tree | f2368b54b71af07a4b8561b38bcd8fc16f22a4b2 /unoxml/source | |
parent | 9f235cfecf6e910323a63326101c0aa5bf1d2796 (diff) |
xmlfix3: #i113683#: finish CAttributesMap
Diffstat (limited to 'unoxml/source')
-rw-r--r-- | unoxml/source/dom/attributesmap.cxx | 30 |
1 files changed, 24 insertions, 6 deletions
diff --git a/unoxml/source/dom/attributesmap.cxx b/unoxml/source/dom/attributesmap.cxx index 229324823f63..89e9ecd69d99 100644 --- a/unoxml/source/dom/attributesmap.cxx +++ b/unoxml/source/dom/attributesmap.cxx @@ -233,21 +233,39 @@ namespace DOM // Adds a node using its nodeName attribute. */ Reference< XNode > SAL_CALL - CAttributesMap::setNamedItem(Reference< XNode > const& arg) + CAttributesMap::setNamedItem(Reference< XNode > const& xNode) throw (RuntimeException) { - return arg; - // return Reference< XNode >(); + Reference< XAttr > const xAttr(xNode, UNO_QUERY); + if (!xNode.is()) { + throw DOMException(OUString(RTL_CONSTASCII_USTRINGPARAM( + "CAttributesMap::setNamedItem: XAttr argument expected")), + static_cast<OWeakObject*>(this), + DOMExceptionType_HIERARCHY_REQUEST_ERR); + } + // no MutexGuard needed: m_pElement is const + Reference< XNode > const xRet( + m_pElement->setAttributeNode(xAttr), UNO_QUERY); + return xRet; } /** Adds a node using its namespaceURI and localName. */ Reference< XNode > SAL_CALL - CAttributesMap::setNamedItemNS(Reference< XNode > const& arg) + CAttributesMap::setNamedItemNS(Reference< XNode > const& xNode) throw (RuntimeException) { - return arg; - // return Reference< XNode >(); + Reference< XAttr > const xAttr(xNode, UNO_QUERY); + if (!xNode.is()) { + throw DOMException(OUString(RTL_CONSTASCII_USTRINGPARAM( + "CAttributesMap::setNamedItemNS: XAttr argument expected")), + static_cast<OWeakObject*>(this), + DOMExceptionType_HIERARCHY_REQUEST_ERR); + } + // no MutexGuard needed: m_pElement is const + Reference< XNode > const xRet( + m_pElement->setAttributeNodeNS(xAttr), UNO_QUERY); + return xRet; } } |