summaryrefslogtreecommitdiff
path: root/xmloff
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2016-05-23 13:53:42 +0200
committerNoel Grandin <noelgrandin@gmail.com>2016-05-24 06:54:06 +0000
commit111de438ea3e512a541281dc0716cc728ea8d152 (patch)
tree2c9ca866e79ed0cfc9299e553a87239345c515a6 /xmloff
parentd3f21849ec8580fdb59a1f0b35453657f4050e0f (diff)
remove some manual ref-counting
triggered when I noticed a class doing acquire() in the constructor and then release() in the destructor. found mostly by git grep -n -B5 -e '->release()' Change-Id: Ie1abeaed75c1f861df185e3bde680272dbadc97f Reviewed-on: https://gerrit.libreoffice.org/25363 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'xmloff')
-rw-r--r--xmloff/source/draw/animationexport.cxx14
1 files changed, 3 insertions, 11 deletions
diff --git a/xmloff/source/draw/animationexport.cxx b/xmloff/source/draw/animationexport.cxx
index 97ae81c7b97a..9d6a5d92fa10 100644
--- a/xmloff/source/draw/animationexport.cxx
+++ b/xmloff/source/draw/animationexport.cxx
@@ -531,7 +531,7 @@ private:
SvXMLExport& mrExport;
Reference< XInterface > mxExport;
Reference< XPropertySet > mxPageProps;
- XMLSdPropHdlFactory* mpSdPropHdlFactory;
+ rtl::Reference<XMLSdPropHdlFactory> mxSdPropHdlFactory;
};
AnimationsExporterImpl::AnimationsExporterImpl( SvXMLExport& rExport, const Reference< XPropertySet >& xPageProps )
@@ -548,19 +548,11 @@ AnimationsExporterImpl::AnimationsExporterImpl( SvXMLExport& rExport, const Refe
OSL_FAIL( "xmloff::AnimationsExporterImpl::AnimationsExporterImpl(), RuntimeException caught!" );
}
- mpSdPropHdlFactory = new XMLSdPropHdlFactory( mrExport.GetModel(), mrExport );
- // set lock to avoid deletion
- mpSdPropHdlFactory->acquire();
+ mxSdPropHdlFactory = new XMLSdPropHdlFactory( mrExport.GetModel(), mrExport );
}
AnimationsExporterImpl::~AnimationsExporterImpl()
{
- // cleanup factory, decrease refcount. Should lead to destruction.
- if(mpSdPropHdlFactory)
- {
- mpSdPropHdlFactory->release();
- mpSdPropHdlFactory = nullptr;
- }
}
void AnimationsExporterImpl::exportTransitionNode()
@@ -1527,7 +1519,7 @@ void AnimationsExporterImpl::convertValue( XMLTokenEnum eAttributeName, OUString
}
//const XMLPropertyHandler* pHandler = static_cast<SdXMLExport*>(&mrExport)->GetSdPropHdlFactory()->GetPropertyHandler( nType );
- const XMLPropertyHandler* pHandler = mpSdPropHdlFactory->GetPropertyHandler( nType );
+ const XMLPropertyHandler* pHandler = mxSdPropHdlFactory->GetPropertyHandler( nType );
if( pHandler )
{
pHandler->exportXML( aString, rValue, mrExport.GetMM100UnitConverter() );