diff options
author | Noel Grandin <noel@peralex.com> | 2015-11-10 16:37:55 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2015-11-11 11:35:40 +0200 |
commit | aef8a59d51954f1858296ef23f70c8bd65c77c1c (patch) | |
tree | b59b7610c62d38addb7bd2054475224e2aca44de /framework/source | |
parent | ea2ae023cf0ca44b445aead93a47b8154f0cc818 (diff) |
framework: boost::ptr_vector->std::vector<std::unique_ptr>
Change-Id: Ia75bf59de4eb5e0be18f81b6ab897f9f9cb28855
Diffstat (limited to 'framework/source')
-rw-r--r-- | framework/source/xml/imagesdocumenthandler.cxx | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/framework/source/xml/imagesdocumenthandler.cxx b/framework/source/xml/imagesdocumenthandler.cxx index 667ab853b262..89c3513c9fb2 100644 --- a/framework/source/xml/imagesdocumenthandler.cxx +++ b/framework/source/xml/imagesdocumenthandler.cxx @@ -422,7 +422,7 @@ void SAL_CALL OReadImagesDocumentHandler::startElement( m_bExternalImageStartFound = true; - ExternalImageItemDescriptor* pItem = new ExternalImageItemDescriptor; + std::unique_ptr<ExternalImageItemDescriptor> pItem(new ExternalImageItemDescriptor); // Read attributes for this external image definition for ( sal_Int16 n = 0; n < xAttribs->getLength(); n++ ) @@ -444,8 +444,8 @@ void SAL_CALL OReadImagesDocumentHandler::startElement( } break; - default: - break; + default: + break; } } } @@ -453,7 +453,6 @@ void SAL_CALL OReadImagesDocumentHandler::startElement( // Check required attribute "command" if ( pItem->aCommandURL.isEmpty() ) { - delete pItem; delete m_pImages; delete m_pExternalImages; m_pImages = nullptr; @@ -467,7 +466,6 @@ void SAL_CALL OReadImagesDocumentHandler::startElement( // Check required attribute "href" if ( pItem->aURL.isEmpty() ) { - delete pItem; delete m_pImages; delete m_pExternalImages; m_pImages = nullptr; @@ -479,14 +477,12 @@ void SAL_CALL OReadImagesDocumentHandler::startElement( } if ( m_pExternalImages ) - m_pExternalImages->push_back( pItem ); - else - delete pItem; + m_pExternalImages->push_back( std::move(pItem) ); } break; - default: - break; + default: + break; } } } @@ -763,7 +759,7 @@ void OWriteImagesDocumentHandler::WriteExternalImageList( const ExternalImageIte for ( size_t i = 0; i < pExternalImageList->size(); i++ ) { - const ExternalImageItemDescriptor* pItem = &(*pExternalImageList)[i]; + const ExternalImageItemDescriptor* pItem = (*pExternalImageList)[i].get(); WriteExternalImage( pItem ); } |