diff options
Diffstat (limited to 'unoxml/source/dom/attr.hxx')
-rw-r--r-- | unoxml/source/dom/attr.hxx | 50 |
1 files changed, 29 insertions, 21 deletions
diff --git a/unoxml/source/dom/attr.hxx b/unoxml/source/dom/attr.hxx index 75876e68d269..9a712ccf715b 100644 --- a/unoxml/source/dom/attr.hxx +++ b/unoxml/source/dom/attr.hxx @@ -26,16 +26,20 @@ * ************************************************************************/ -#ifndef _ATTR_HXX -#define _ATTR_HXX +#ifndef DOM_ATTR_HXX +#define DOM_ATTR_HXX + +#include <memory> + +#include <libxml/tree.h> #include <cppuhelper/implbase1.hxx> + #include <com/sun/star/uno/Reference.h> -#include <com/sun/star/uno/Exception.hpp> #include <com/sun/star/xml/dom/XNode.hpp> #include <com/sun/star/xml/dom/XAttr.hpp> -#include "node.hxx" -#include <libxml/tree.h> + +#include <node.hxx> using ::rtl::OUString; using namespace com::sun::star::uno; @@ -43,17 +47,30 @@ using namespace com::sun::star::xml::dom; namespace DOM { - class CAttr : public cppu::ImplInheritanceHelper1< CNode, XAttr > + typedef ::std::pair< ::rtl::OString, ::rtl::OString > stringpair_t; + + typedef ::cppu::ImplInheritanceHelper1< CNode, XAttr > CAttr_Base; + + class CAttr + : public CAttr_Base { - friend class CNode; - friend class CElement; + private: + friend class CDocument; + private: xmlAttrPtr m_aAttrPtr; + ::std::auto_ptr< stringpair_t > m_pNamespace; protected: - CAttr(const xmlAttrPtr aAttrPtr); + 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); + + virtual bool IsChildTypeAllowed(NodeType const nodeType); + /** Returns the name of this attribute. */ @@ -123,10 +140,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) { @@ -148,10 +162,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) { @@ -200,10 +211,7 @@ namespace DOM return setValue(nodeValue); } virtual void SAL_CALL setPrefix(const OUString& prefix) - throw (RuntimeException, DOMException) - { - return CNode::setPrefix(prefix); - } + throw (RuntimeException, DOMException); }; } |