diff options
Diffstat (limited to 'unoxml/source/xpath/nodelist.hxx')
-rw-r--r-- | unoxml/source/xpath/nodelist.hxx | 29 |
1 files changed, 22 insertions, 7 deletions
diff --git a/unoxml/source/xpath/nodelist.hxx b/unoxml/source/xpath/nodelist.hxx index 68f419f10174..fd6b428af27e 100644 --- a/unoxml/source/xpath/nodelist.hxx +++ b/unoxml/source/xpath/nodelist.hxx @@ -25,38 +25,52 @@ * ************************************************************************/ -#ifndef _NODELIST_HXX -#define _NODELIST_HXX +#ifndef XPATH_NODELIST_HXX +#define XPATH_NODELIST_HXX -#include <vector> #include <sal/types.h> +#include <rtl/ref.hxx> + #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/XNodeList.hpp> #include <com/sun/star/xml/xpath/XXPathObject.hpp> + #include "libxml/tree.h" #include "libxml/xpath.h" + #include <boost/shared_ptr.hpp> + using ::rtl::OUString; using namespace com::sun::star::uno; -using namespace com::sun::star::lang; using namespace com::sun::star::xml::dom; using namespace com::sun::star::xml::xpath; +namespace DOM { + class CDocument; +} + namespace XPath { class CNodeList : public cppu::WeakImplHelper1< XNodeList > { private: + /// #i115995# keep document alive + ::rtl::Reference< DOM::CDocument > const m_pDocument; + ::osl::Mutex & m_rMutex; + /// retain the result set in case the CXPathObject is released boost::shared_ptr<xmlXPathObject> m_pXPathObj; xmlNodeSetPtr m_pNodeSet; public: - CNodeList(boost::shared_ptr<xmlXPathObject> &rxpathObj); + CNodeList( + ::rtl::Reference<DOM::CDocument> const& pDocument, + ::osl::Mutex & rMutex, + boost::shared_ptr<xmlXPathObject> const& rxpathObj); /** The number of nodes in the list. */ @@ -64,7 +78,8 @@ namespace XPath /** Returns the indexth item in the collection. */ - virtual Reference< XNode > SAL_CALL item(sal_Int32 index) throw (RuntimeException); + virtual Reference< XNode > SAL_CALL item(sal_Int32 index) + throw (RuntimeException); }; } |