Kaydet (Commit) 711668c7 authored tarafından Michael Stahl's avatar Michael Stahl

xmlfix3: unoxml: fix CEntitiesMap: member pointer does not keep document alive

üst 2619efc1
......@@ -25,12 +25,15 @@
*
************************************************************************/
#include "entitiesmap.hxx"
#include <entitiesmap.hxx>
#include <documenttype.hxx>
namespace DOM
{
CEntitiesMap::CEntitiesMap(const CDocumentType* aDocType)
: m_pDocType(aDocType)
CEntitiesMap::CEntitiesMap(::rtl::Reference<CDocumentType> const& pDocType)
: m_pDocType(pDocType)
{
}
......@@ -45,7 +48,8 @@ namespace DOM
/**
Retrieves a node specified by local name
*/
Reference< XNode > SAL_CALL CEntitiesMap::getNamedItem(const OUString& /*name*/) throw (RuntimeException)
Reference< XNode > SAL_CALL
CEntitiesMap::getNamedItem(OUString const& /*name*/) throw (RuntimeException)
{
return Reference< XNode >();
}
......@@ -53,7 +57,10 @@ namespace DOM
/**
Retrieves a node specified by local name and namespace URI.
*/
Reference< XNode > SAL_CALL CEntitiesMap::getNamedItemNS(const OUString& /*namespaceURI*/,const OUString& /*localName*/) throw (RuntimeException)
Reference< XNode > SAL_CALL
CEntitiesMap::getNamedItemNS(
OUString const& /*namespaceURI*/, OUString const& /*localName*/)
throw (RuntimeException)
{
return Reference< XNode >();
}
......@@ -61,7 +68,8 @@ namespace DOM
/**
Returns the indexth item in the map.
*/
Reference< XNode > SAL_CALL CEntitiesMap::item(sal_Int32 /*index*/) throw (RuntimeException)
Reference< XNode > SAL_CALL
CEntitiesMap::item(sal_Int32 /*index*/) throw (RuntimeException)
{
return Reference< XNode >();
}
......@@ -69,7 +77,9 @@ namespace DOM
/**
Removes a node specified by name.
*/
Reference< XNode > SAL_CALL CEntitiesMap::removeNamedItem(const OUString& /*name*/) throw (RuntimeException)
Reference< XNode > SAL_CALL
CEntitiesMap::removeNamedItem(OUString const& /*name*/)
throw (RuntimeException)
{
return Reference< XNode >();
}
......@@ -77,7 +87,10 @@ namespace DOM
/**
// Removes a node specified by local name and namespace URI.
*/
Reference< XNode > SAL_CALL CEntitiesMap::removeNamedItemNS(const OUString& /*namespaceURI*/, const OUString& /*localName*/) throw (RuntimeException)
Reference< XNode > SAL_CALL
CEntitiesMap::removeNamedItemNS(
OUString const& /*namespaceURI*/, OUString const& /*localName*/)
throw (RuntimeException)
{
return Reference< XNode >();
}
......@@ -85,7 +98,9 @@ namespace DOM
/**
// Adds a node using its nodeName attribute.
*/
Reference< XNode > SAL_CALL CEntitiesMap::setNamedItem(const Reference< XNode >& /*arg*/) throw (RuntimeException)
Reference< XNode > SAL_CALL
CEntitiesMap::setNamedItem(Reference< XNode > const& /*arg*/)
throw (RuntimeException)
{
return Reference< XNode >();
}
......@@ -93,7 +108,9 @@ namespace DOM
/**
Adds a node using its namespaceURI and localName.
*/
Reference< XNode > SAL_CALL CEntitiesMap::setNamedItemNS(const Reference< XNode >& /*arg*/) throw (RuntimeException)
Reference< XNode > SAL_CALL
CEntitiesMap::setNamedItemNS(Reference< XNode > const& /*arg*/)
throw (RuntimeException)
{
return Reference< XNode >();
}
......
......@@ -25,18 +25,18 @@
*
************************************************************************/
#ifndef _ENTITIESMAP_HXX
#define _ENTITIESMAP_HXX
#ifndef DOM_ENTITIESMAP_HXX
#define DOM_ENTITIESMAP_HXX
#include <map>
#include <sal/types.h>
#include <cppuhelper/implbase1.hxx>
#include <rtl/ref.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/XNamedNodeMap.hpp>
#include "document.hxx"
#include "documenttype.hxx"
#include <cppuhelper/implbase1.hxx>
using ::rtl::OUString;
using namespace com::sun::star::uno;
......@@ -45,12 +45,16 @@ using namespace com::sun::star::xml::dom;
namespace DOM
{
class CEntitiesMap : public cppu::WeakImplHelper1< XNamedNodeMap >
class CDocumentType;
class CEntitiesMap
: public cppu::WeakImplHelper1< XNamedNodeMap >
{
private:
const CDocumentType* m_pDocType;
::rtl::Reference<CDocumentType> const m_pDocType;
public:
CEntitiesMap(const CDocumentType* aDocType);
CEntitiesMap(::rtl::Reference<CDocumentType> const& pDocType);
/**
The number of nodes in this map.
......@@ -60,37 +64,48 @@ namespace DOM
/**
Retrieves a node specified by local name
*/
virtual Reference< XNode > SAL_CALL getNamedItem(const OUString& name) throw (RuntimeException);
virtual Reference< XNode > SAL_CALL
getNamedItem(const OUString& name) throw (RuntimeException);
/**
Retrieves a node specified by local name and namespace URI.
*/
virtual Reference< XNode > SAL_CALL getNamedItemNS(const OUString& namespaceURI, const OUString& localName) throw (RuntimeException);
virtual Reference< XNode > SAL_CALL getNamedItemNS(
OUString const& namespaceURI, OUString const& localName)
throw (RuntimeException);
/**
Returns the indexth item in the map.
*/
virtual Reference< XNode > SAL_CALL item(sal_Int32 index) throw (RuntimeException);
virtual Reference< XNode > SAL_CALL
item(sal_Int32 index) throw (RuntimeException);
/**
Removes a node specified by name.
*/
virtual Reference< XNode > SAL_CALL removeNamedItem(const OUString& name) throw (RuntimeException);
virtual Reference< XNode > SAL_CALL
removeNamedItem(OUString const& name) throw (RuntimeException);
/**
// Removes a node specified by local name and namespace URI.
*/
virtual Reference< XNode > SAL_CALL removeNamedItemNS(const OUString& namespaceURI, const OUString& localName) throw (RuntimeException);
virtual Reference< XNode > SAL_CALL removeNamedItemNS(
OUString const& namespaceURI, OUString const& localName)
throw (RuntimeException);
/**
// Adds a node using its nodeName attribute.
*/
virtual Reference< XNode > SAL_CALL setNamedItem(const Reference< XNode >& arg) throw (RuntimeException);
virtual Reference< XNode > SAL_CALL
setNamedItem(Reference< XNode > const& arg)
throw (RuntimeException);
/**
Adds a node using its namespaceURI and localName.
*/
virtual Reference< XNode > SAL_CALL setNamedItemNS(const Reference< XNode >& arg) throw (RuntimeException);
virtual Reference< XNode > SAL_CALL
setNamedItemNS(Reference< XNode > const& arg)
throw (RuntimeException);
};
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment