diff options
author | Michael Stahl <mst@openoffice.org> | 2011-01-19 20:27:28 +0100 |
---|---|---|
committer | Michael Stahl <mst@openoffice.org> | 2011-01-19 20:27:28 +0100 |
commit | d76639d5d833a05a3181f7293e38a250dc6c1299 (patch) | |
tree | f868f4025d12b17c45c2b202c3879326d0d645c6 /unoxml/source/dom/attr.hxx | |
parent | 76eac88260284d6c85c693f7186186a05e053c54 (diff) |
xmlfix3: unoxml: eradicate the bizarre concept of "carrier nodes":
add namespace data member to CAttr.
CAttr overrides getPrefix(), setPrefix(), getNamespaceURI().
CDocument::createAttributeNS() uses this new CAttr member instead of creating
a dummy carrier element.
CElement::setAttributeNode_Impl_Lock() and CNode::appendChild() do not free
the no longer existing dummy carrier element.
CNode::insertBefore() calls appendChild() for attributes
instead of ignoring namespace.
CNode::appendChild() does not invalidate attributes, because they are copied.
Diffstat (limited to 'unoxml/source/dom/attr.hxx')
-rw-r--r-- | unoxml/source/dom/attr.hxx | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/unoxml/source/dom/attr.hxx b/unoxml/source/dom/attr.hxx index 609a97a35c49..6d9f6758c2c1 100644 --- a/unoxml/source/dom/attr.hxx +++ b/unoxml/source/dom/attr.hxx @@ -28,6 +28,8 @@ #ifndef DOM_ATTR_HXX #define DOM_ATTR_HXX +#include <memory> + #include <libxml/tree.h> #include <cppuhelper/implbase1.hxx> @@ -44,6 +46,8 @@ using namespace com::sun::star::xml::dom; namespace DOM { + typedef ::std::pair< ::rtl::OString, ::rtl::OString > stringpair_t; + typedef ::cppu::ImplInheritanceHelper1< CNode, XAttr > CAttr_Base; class CAttr @@ -54,12 +58,16 @@ namespace DOM private: xmlAttrPtr m_aAttrPtr; + ::std::auto_ptr< stringpair_t > m_pNamespace; protected: CAttr(CDocument const& rDocument, ::osl::Mutex const& rMutex, xmlAttrPtr const pAttr); public: + /// return the libxml namespace corresponding to m_pNamespace on pNode + xmlNsPtr GetNamespace(xmlNodePtr const pNode); + /** Returns the name of this attribute. */ @@ -129,10 +137,7 @@ namespace DOM return CNode::getLastChild(); } virtual OUString SAL_CALL getNamespaceURI() - throw (RuntimeException) - { - return CNode::getNamespaceURI(); - } + throw (RuntimeException); virtual Reference< XNode > SAL_CALL getNextSibling() throw (RuntimeException) { @@ -154,10 +159,7 @@ namespace DOM return CNode::getParentNode(); } virtual OUString SAL_CALL getPrefix() - throw (RuntimeException) - { - return CNode::getPrefix(); - } + throw (RuntimeException); virtual Reference< XNode > SAL_CALL getPreviousSibling() throw (RuntimeException) { @@ -206,10 +208,7 @@ namespace DOM return setValue(nodeValue); } virtual void SAL_CALL setPrefix(const OUString& prefix) - throw (RuntimeException, DOMException) - { - return CNode::setPrefix(prefix); - } + throw (RuntimeException, DOMException); }; } |