summaryrefslogtreecommitdiff
path: root/xmloff
diff options
context:
space:
mode:
authorDavid Tardon <dtardon@redhat.com>2016-09-08 11:18:15 +0200
committerDavid Tardon <dtardon@redhat.com>2016-09-09 07:30:30 +0200
commit3ef084c9bd7a7952a0e69efb9dbda81473c7856b (patch)
tree8c50c000f7cb29c28152c95ef7d0391ad122a38f /xmloff
parent4f776e0ff2d7b3635dc504c3251dddd03f76c205 (diff)
remove direct memory management
Change-Id: Id0278f15e0c46a32cf07900dffdf27b3acb2649c
Diffstat (limited to 'xmloff')
-rw-r--r--xmloff/source/draw/ximp3dscene.cxx17
1 files changed, 4 insertions, 13 deletions
diff --git a/xmloff/source/draw/ximp3dscene.cxx b/xmloff/source/draw/ximp3dscene.cxx
index 7680acf0bfbb..31ce368758df 100644
--- a/xmloff/source/draw/ximp3dscene.cxx
+++ b/xmloff/source/draw/ximp3dscene.cxx
@@ -226,24 +226,15 @@ SdXML3DSceneAttributesHelper::SdXML3DSceneAttributesHelper( SvXMLImport& rImport
{
}
-SdXML3DSceneAttributesHelper::~SdXML3DSceneAttributesHelper()
-{
- // release remembered light contexts, they are no longer needed
- for ( size_t i = maList.size(); i > 0; )
- maList[ --i ]->ReleaseRef();
- maList.clear();
-}
-
/** creates a 3d light context and adds it to the internal list for later processing */
SvXMLImportContext * SdXML3DSceneAttributesHelper::create3DLightContext( sal_uInt16 nPrfx, const OUString& rLName, const css::uno::Reference< css::xml::sax::XAttributeList >& xAttrList)
{
- SvXMLImportContext* pContext = new SdXML3DLightContext(mrImport, nPrfx, rLName, xAttrList);
+ const uno::Reference<SdXML3DLightContext> xContext{new SdXML3DLightContext(mrImport, nPrfx, rLName, xAttrList)};
// remember SdXML3DLightContext for later evaluation
- pContext->AddFirstRef();
- maList.push_back( static_cast<SdXML3DLightContext*>(pContext) );
+ maList.push_back(xContext);
- return pContext;
+ return xContext.get();
}
/** this should be called for each scene attribute */
@@ -376,7 +367,7 @@ void SdXML3DSceneAttributesHelper::setSceneAttributes( const css::uno::Reference
// set lights
for( size_t a = 0; a < maList.size(); a++)
{
- SdXML3DLightContext* pCtx = maList[ a ];
+ SdXML3DLightContext* pCtx = maList[ a ].get();
// set anys
aAny <<= pCtx->GetDiffuseColor();