Kaydet (Commit) cfb59817 authored tarafından Noel Grandin's avatar Noel Grandin

loplugin:useuniqueptr in ImageListsDescriptor

Change-Id: I165af348b6d8863a4b1e5dd164d92c29f49d09c0
Reviewed-on: https://gerrit.libreoffice.org/48423Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst 570786e7
......@@ -76,12 +76,10 @@ typedef std::vector<std::unique_ptr<ImageListItemDescriptor> > ImageListDescript
struct ImageListsDescriptor
{
ImageListsDescriptor() : pImageList( nullptr ),
pExternalImageList( nullptr ) {}
~ImageListsDescriptor() { delete pImageList; delete pExternalImageList; }
ImageListsDescriptor() {}
ImageListDescriptor* pImageList;
ExternalImageItemListDescriptor* pExternalImageList;
std::unique_ptr<ImageListDescriptor> pImageList;
std::unique_ptr<ExternalImageItemListDescriptor> pExternalImageList;
};
class ImagesConfiguration
......
......@@ -400,7 +400,7 @@ bool ImageManagerImpl::implts_storeUserImages(
if ( pImageList->GetImageCount() > 0 )
{
ImageListsDescriptor aUserImageListInfo;
aUserImageListInfo.pImageList = new ImageListDescriptor;
aUserImageListInfo.pImageList.reset( new ImageListDescriptor );
ImageListItemDescriptor* pList = new ImageListItemDescriptor;
aUserImageListInfo.pImageList->push_back( std::unique_ptr<ImageListItemDescriptor>(pList) );
......
......@@ -197,7 +197,7 @@ void SAL_CALL OReadImagesDocumentHandler::startElement(
}
if ( !m_aImageList.pImageList )
m_aImageList.pImageList = new ImageListDescriptor;
m_aImageList.pImageList.reset( new ImageListDescriptor );
m_bImagesStartFound = true;
m_pImages = new ImageListItemDescriptor;
......@@ -511,7 +511,7 @@ void SAL_CALL OReadImagesDocumentHandler::endElement(const OUString& aName)
if ( m_pExternalImages && !m_aImageList.pExternalImageList )
{
if ( !m_aImageList.pExternalImageList )
m_aImageList.pExternalImageList = m_pExternalImages;
m_aImageList.pExternalImageList.reset( m_pExternalImages );
}
m_bExternalImagesStartFound = false;
......@@ -614,7 +614,7 @@ void OWriteImagesDocumentHandler::WriteImagesDocument()
if ( m_aImageListsItems.pImageList )
{
ImageListDescriptor* pImageList = m_aImageListsItems.pImageList;
ImageListDescriptor* pImageList = m_aImageListsItems.pImageList.get();
for ( size_t i = 0; i < m_aImageListsItems.pImageList->size(); i++ )
{
......@@ -625,7 +625,7 @@ void OWriteImagesDocumentHandler::WriteImagesDocument()
if ( m_aImageListsItems.pExternalImageList )
{
WriteExternalImageList( m_aImageListsItems.pExternalImageList );
WriteExternalImageList( m_aImageListsItems.pExternalImageList.get() );
}
m_xWriteDocumentHandler->ignorableWhitespace( OUString() );
......
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