diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-01-19 08:47:57 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-01-19 13:06:47 +0200 |
commit | 43e8797add78ba172abdc75457500d68c15473eb (patch) | |
tree | 780c3d401b61c5c76ca64ddd72060c238ac058b1 /xmlscript | |
parent | 935231896925461f36eff5aee58aa64921ccb0e5 (diff) |
use rtl::Reference in ExtendedAttributes
instead of manual acquire/release
Change-Id: Ibf91b19ecace75b7c304f2a1b2acdd8a4ca28452
Diffstat (limited to 'xmlscript')
-rw-r--r-- | xmlscript/source/xml_helper/xml_impctx.cxx | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/xmlscript/source/xml_helper/xml_impctx.cxx b/xmlscript/source/xml_helper/xml_impctx.cxx index 52999fa83d9c..859197517bd4 100644 --- a/xmlscript/source/xml_helper/xml_impctx.cxx +++ b/xmlscript/source/xml_helper/xml_impctx.cxx @@ -31,6 +31,7 @@ #include <com/sun/star/uno/XComponentContext.hpp> #include <com/sun/star/lang/XServiceInfo.hpp> #include <sal/log.hxx> +#include <rtl/ref.hxx> #include <memory> #include <unordered_map> @@ -332,7 +333,7 @@ class ExtendedAttributes : OUString * m_pQNames; OUString * m_pValues; - DocumentHandlerImpl * m_pHandler; + rtl::Reference<DocumentHandlerImpl> m_xHandler; public: inline ExtendedAttributes( @@ -383,10 +384,8 @@ inline ExtendedAttributes::ExtendedAttributes( , m_pLocalNames( pLocalNames ) , m_pQNames( pQNames ) , m_pValues( new OUString[ nAttributes ] ) - , m_pHandler( pHandler ) + , m_xHandler( pHandler ) { - m_pHandler->acquire(); - for ( sal_Int32 nPos = 0; nPos < nAttributes; ++nPos ) { m_pValues[ nPos ] = xAttributeList->getValueByIndex( nPos ); @@ -395,8 +394,6 @@ inline ExtendedAttributes::ExtendedAttributes( ExtendedAttributes::~ExtendedAttributes() throw () { - m_pHandler->release(); - delete [] m_pUids; delete [] m_pLocalNames; delete [] m_pQNames; |