From 059f0fd3bd6977a9e29a32f5292262b14e8ff679 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Thu, 7 Jun 2012 14:58:34 +0200 Subject: Convert SV_DECL_PTRARR_DEL( ImageListDescriptor) to boost::ptr_vector Change-Id: Iea01a7d7c01bb9da80ccae001157c60d6090348b --- framework/inc/xml/imagesconfiguration.hxx | 4 ++-- framework/source/uiconfiguration/imagemanagerimpl.cxx | 6 +++--- framework/source/xml/imagesconfiguration.cxx | 1 - framework/source/xml/imagesdocumenthandler.cxx | 6 +++--- 4 files changed, 8 insertions(+), 9 deletions(-) diff --git a/framework/inc/xml/imagesconfiguration.hxx b/framework/inc/xml/imagesconfiguration.hxx index 4b2876a38dc6..5a6c2b6d4f43 100644 --- a/framework/inc/xml/imagesconfiguration.hxx +++ b/framework/inc/xml/imagesconfiguration.hxx @@ -40,6 +40,7 @@ #include #include +#include namespace framework { @@ -86,8 +87,7 @@ struct ImageListItemDescriptor String aHighContrastMaskURL; // an URL to an optional high contrast bitmap as a mask }; -typedef ImageListItemDescriptor* ImageListItemDescriptorPtr; -SV_DECL_PTRARR_DEL( ImageListDescriptor, ImageListItemDescriptorPtr, 10 ) +typedef boost::ptr_vector ImageListDescriptor; struct ImageListsDescriptor { diff --git a/framework/source/uiconfiguration/imagemanagerimpl.cxx b/framework/source/uiconfiguration/imagemanagerimpl.cxx index 7931cbfff640..52e498e30aed 100644 --- a/framework/source/uiconfiguration/imagemanagerimpl.cxx +++ b/framework/source/uiconfiguration/imagemanagerimpl.cxx @@ -504,9 +504,9 @@ sal_Bool ImageManagerImpl::implts_loadUserImages( xInputStream, aUserImageListInfo ); if (( aUserImageListInfo.pImageList != 0 ) && - ( aUserImageListInfo.pImageList->Count() > 0 )) + ( !aUserImageListInfo.pImageList->empty() )) { - ImageListItemDescriptor* pList = aUserImageListInfo.pImageList->GetObject(0); + ImageListItemDescriptor* pList = &aUserImageListInfo.pImageList->front(); sal_Int32 nCount = pList->pImageItemList->Count(); std::vector< OUString > aUserImagesVector; aUserImagesVector.reserve(nCount); @@ -580,7 +580,7 @@ sal_Bool ImageManagerImpl::implts_storeUserImages( aUserImageListInfo.pImageList = new ImageListDescriptor; ImageListItemDescriptor* pList = new ImageListItemDescriptor; - aUserImageListInfo.pImageList->Insert( pList, 0 ); + aUserImageListInfo.pImageList->push_back( pList ); pList->pImageItemList = new ImageItemListDescriptor; for ( sal_uInt16 i=0; i < pImageList->GetImageCount(); i++ ) diff --git a/framework/source/xml/imagesconfiguration.cxx b/framework/source/xml/imagesconfiguration.cxx index ba7aa9450334..7f2f51b45eb6 100644 --- a/framework/source/xml/imagesconfiguration.cxx +++ b/framework/source/xml/imagesconfiguration.cxx @@ -63,7 +63,6 @@ namespace framework SV_IMPL_PTRARR( ImageItemListDescriptor, ImageItemDescriptorPtr ); SV_IMPL_PTRARR( ExternalImageItemListDescriptor, ExternalImageItemDescriptorPtr ); -SV_IMPL_PTRARR( ImageListDescriptor, ImageListItemDescriptorPtr ); static Reference< XParser > GetSaxParser( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceFactory diff --git a/framework/source/xml/imagesdocumenthandler.cxx b/framework/source/xml/imagesdocumenthandler.cxx index deade3d825d8..4eb19610c531 100644 --- a/framework/source/xml/imagesdocumenthandler.cxx +++ b/framework/source/xml/imagesdocumenthandler.cxx @@ -545,7 +545,7 @@ throw( SAXException, RuntimeException ) if ( m_pImages ) { if ( m_aImageList.pImageList ) - m_aImageList.pImageList->Insert( m_pImages, m_aImageList.pImageList->Count() ); + m_aImageList.pImageList->push_back( m_pImages ); m_pImages = NULL; } m_bImagesStartFound = sal_False; @@ -681,9 +681,9 @@ void OWriteImagesDocumentHandler::WriteImagesDocument() throw { ImageListDescriptor* pImageList = m_aImageListsItems.pImageList; - for ( sal_uInt16 i = 0; i < m_aImageListsItems.pImageList->Count(); i++ ) + for ( sal_uInt16 i = 0; i < m_aImageListsItems.pImageList->size(); i++ ) { - const ImageListItemDescriptor* pImageItems = (*pImageList)[i]; + const ImageListItemDescriptor* pImageItems = &(*pImageList)[i]; WriteImageList( pImageItems ); } } -- cgit