Kaydet (Commit) a426cf60 authored tarafından Caolán McNamara's avatar Caolán McNamara

ofz: Direct-leak

Change-Id: Id94586cc659a5e504c727c570dc9fc60c85c8820
üst 64be5657
...@@ -592,13 +592,13 @@ void OStorage_Impl::ReadContents() ...@@ -592,13 +592,13 @@ void OStorage_Impl::ReadContents()
uno::Reference< container::XNameContainer > xNameContainer( xNamed, uno::UNO_QUERY ); uno::Reference< container::XNameContainer > xNameContainer( xNamed, uno::UNO_QUERY );
SotElement_Impl* pNewElement = new SotElement_Impl( aName, xNameContainer.is(), false ); std::unique_ptr<SotElement_Impl> xNewElement(new SotElement_Impl(aName, xNameContainer.is(), false));
if ( m_nStorageType == embed::StorageFormats::OFOPXML && aName == "_rels" ) if ( m_nStorageType == embed::StorageFormats::OFOPXML && aName == "_rels" )
{ {
if ( !pNewElement->m_bIsStorage ) if (!xNewElement->m_bIsStorage)
throw io::IOException( THROW_WHERE ); // TODO: Unexpected format throw io::IOException( THROW_WHERE ); // TODO: Unexpected format
m_pRelStorElement = pNewElement; m_pRelStorElement = xNewElement.release();
CreateRelStorage(); CreateRelStorage();
} }
else else
...@@ -606,10 +606,10 @@ void OStorage_Impl::ReadContents() ...@@ -606,10 +606,10 @@ void OStorage_Impl::ReadContents()
if ( ( m_nStorageMode & embed::ElementModes::TRUNCATE ) == embed::ElementModes::TRUNCATE ) if ( ( m_nStorageMode & embed::ElementModes::TRUNCATE ) == embed::ElementModes::TRUNCATE )
{ {
// if a storage is truncated all of it elements are marked as deleted // if a storage is truncated all of it elements are marked as deleted
pNewElement->m_bIsRemoved = true; xNewElement->m_bIsRemoved = true;
} }
m_aChildrenVector.push_back( pNewElement ); m_aChildrenVector.push_back(xNewElement.release());
} }
} }
catch( const container::NoSuchElementException& rNoSuchElementException ) catch( const container::NoSuchElementException& rNoSuchElementException )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment