summaryrefslogtreecommitdiff
path: root/lotuswordpro
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-01-23 16:09:10 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-01-24 07:03:11 +0200
commitb1211e965aa7883b0c3fc157f6c56b48c8bb0462 (patch)
tree88ebc974969c41772fabbbe62bb13b83da6cc249 /lotuswordpro
parentbd281dc6e1f3cd5e4785baeeb908a3eca25a7481 (diff)
use rtl::Reference in XFSaxAttrList
instead of storing both a raw pointer and an uno::Reference Change-Id: I227ac624b03a172e10840c4d1e2c4ca0362b33a4
Diffstat (limited to 'lotuswordpro')
-rw-r--r--lotuswordpro/source/filter/xfilter/xfsaxattrlist.cxx20
-rw-r--r--lotuswordpro/source/filter/xfilter/xfsaxattrlist.hxx11
2 files changed, 14 insertions, 17 deletions
diff --git a/lotuswordpro/source/filter/xfilter/xfsaxattrlist.cxx b/lotuswordpro/source/filter/xfilter/xfsaxattrlist.cxx
index 6415f3c53a45..ffd36284f8c4 100644
--- a/lotuswordpro/source/filter/xfilter/xfsaxattrlist.cxx
+++ b/lotuswordpro/source/filter/xfilter/xfsaxattrlist.cxx
@@ -62,24 +62,26 @@
XFSaxAttrList::XFSaxAttrList()
{
- m_pSvAttrList = new SvXMLAttributeList();
- m_xAttrList.set(m_pSvAttrList);
+ m_xSvAttrList = new SvXMLAttributeList();
}
XFSaxAttrList::~XFSaxAttrList()
{
- //pls don't delete m_pSvAttrList,because when m_xAttrList release,the object will be automatic deleted.
-// if( m_pSvAttrList )
-// delete m_pSvAttrList;
}
-void XFSaxAttrList::AddAttribute(const OUString& name, const OUString& value)
+void XFSaxAttrList::AddAttribute(const OUString& name, const OUString& value)
{
- m_pSvAttrList->AddAttribute(name,value);
+ m_xSvAttrList->AddAttribute(name,value);
}
-void XFSaxAttrList::Clear()
+void XFSaxAttrList::Clear()
{
- m_pSvAttrList->Clear();
+ m_xSvAttrList->Clear();
}
+
+css::uno::Reference<css::xml::sax::XAttributeList> XFSaxAttrList::GetAttributeList() const
+{
+ return m_xSvAttrList.get();
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/lotuswordpro/source/filter/xfilter/xfsaxattrlist.hxx b/lotuswordpro/source/filter/xfilter/xfsaxattrlist.hxx
index 23e1ebe12e5c..1cbc37cc22c0 100644
--- a/lotuswordpro/source/filter/xfilter/xfsaxattrlist.hxx
+++ b/lotuswordpro/source/filter/xfilter/xfsaxattrlist.hxx
@@ -61,6 +61,7 @@
#define INCLUDED_LOTUSWORDPRO_SOURCE_FILTER_XFILTER_XFSAXATTRLIST_HXX
#include "ixfattrlist.hxx"
+#include <rtl/ref.hxx>
#include <xmloff/attrlist.hxx>
#include <com/sun/star/xml/sax/XDocumentHandler.hpp>
@@ -77,20 +78,14 @@ public:
virtual void Clear() override;
- const css::uno::Reference<css::xml::sax::XAttributeList>& GetAttributeList() const;
+ css::uno::Reference<css::xml::sax::XAttributeList> GetAttributeList() const;
friend class XFSaxStream;
private:
- SvXMLAttributeList *m_pSvAttrList;
- css::uno::Reference<css::xml::sax::XAttributeList> m_xAttrList;
+ rtl::Reference<SvXMLAttributeList> m_xSvAttrList;
};
-inline const css::uno::Reference<css::xml::sax::XAttributeList>& XFSaxAttrList::GetAttributeList() const
-{
- return m_xAttrList;
-}
-
#endif //XFSAXATTRLIST_INC
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */