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

framework: boost::ptr_vector->std::vector<std::unique_ptr>

Change-Id: I10801343e65646b92eb0a6256cd7bfbf5c84c854
üst aef8a59d
......@@ -30,7 +30,6 @@
#include <vector>
#include <memory>
#include <boost/ptr_container/ptr_vector.hpp>
namespace framework
{
......@@ -75,7 +74,7 @@ struct ImageListItemDescriptor
OUString aHighContrastMaskURL; // an URL to an optional high contrast bitmap as a mask
};
typedef boost::ptr_vector<ImageListItemDescriptor> ImageListDescriptor;
typedef std::vector<std::unique_ptr<ImageListItemDescriptor> > ImageListDescriptor;
struct ImageListsDescriptor
{
......
......@@ -440,7 +440,7 @@ bool ImageManagerImpl::implts_loadUserImages(
if (( aUserImageListInfo.pImageList != nullptr ) &&
( !aUserImageListInfo.pImageList->empty() ))
{
ImageListItemDescriptor* pList = &aUserImageListInfo.pImageList->front();
ImageListItemDescriptor* pList = aUserImageListInfo.pImageList->front().get();
sal_Int32 nCount = pList->pImageItemList->size();
std::vector< OUString > aUserImagesVector;
aUserImagesVector.reserve(nCount);
......@@ -512,7 +512,7 @@ bool ImageManagerImpl::implts_storeUserImages(
aUserImageListInfo.pImageList = new ImageListDescriptor;
ImageListItemDescriptor* pList = new ImageListItemDescriptor;
aUserImageListInfo.pImageList->push_back( pList );
aUserImageListInfo.pImageList->push_back( std::unique_ptr<ImageListItemDescriptor>(pList) );
pList->pImageItemList = new ImageItemListDescriptor;
for ( sal_uInt16 i=0; i < pImageList->GetImageCount(); i++ )
......
......@@ -510,7 +510,7 @@ void SAL_CALL OReadImagesDocumentHandler::endElement(const OUString& aName)
if ( m_pImages )
{
if ( m_aImageList.pImageList )
m_aImageList.pImageList->push_back( m_pImages );
m_aImageList.pImageList->push_back( std::unique_ptr<ImageListItemDescriptor>(m_pImages) );
m_pImages = nullptr;
}
m_bImagesStartFound = false;
......@@ -642,7 +642,7 @@ void OWriteImagesDocumentHandler::WriteImagesDocument() throw
for ( size_t i = 0; i < m_aImageListsItems.pImageList->size(); i++ )
{
const ImageListItemDescriptor* pImageItems = &(*pImageList)[i];
const ImageListItemDescriptor* pImageItems = (*pImageList)[i].get();
WriteImageList( pImageItems );
}
}
......
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