Kaydet (Commit) 059f0fd3 authored tarafından Noel Grandin's avatar Noel Grandin Kaydeden (comit) Michael Stahl

Convert SV_DECL_PTRARR_DEL( ImageListDescriptor) to boost::ptr_vector

Change-Id: Iea01a7d7c01bb9da80ccae001157c60d6090348b
üst 78a219e9
...@@ -40,6 +40,7 @@ ...@@ -40,6 +40,7 @@
#include <com/sun/star/io/XOutputStream.hpp> #include <com/sun/star/io/XOutputStream.hpp>
#include <vector> #include <vector>
#include <boost/ptr_container/ptr_vector.hpp>
namespace framework namespace framework
{ {
...@@ -86,8 +87,7 @@ struct ImageListItemDescriptor ...@@ -86,8 +87,7 @@ struct ImageListItemDescriptor
String aHighContrastMaskURL; // an URL to an optional high contrast bitmap as a mask String aHighContrastMaskURL; // an URL to an optional high contrast bitmap as a mask
}; };
typedef ImageListItemDescriptor* ImageListItemDescriptorPtr; typedef boost::ptr_vector<ImageListItemDescriptor> ImageListDescriptor;
SV_DECL_PTRARR_DEL( ImageListDescriptor, ImageListItemDescriptorPtr, 10 )
struct ImageListsDescriptor struct ImageListsDescriptor
{ {
......
...@@ -504,9 +504,9 @@ sal_Bool ImageManagerImpl::implts_loadUserImages( ...@@ -504,9 +504,9 @@ sal_Bool ImageManagerImpl::implts_loadUserImages(
xInputStream, xInputStream,
aUserImageListInfo ); aUserImageListInfo );
if (( aUserImageListInfo.pImageList != 0 ) && 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(); sal_Int32 nCount = pList->pImageItemList->Count();
std::vector< OUString > aUserImagesVector; std::vector< OUString > aUserImagesVector;
aUserImagesVector.reserve(nCount); aUserImagesVector.reserve(nCount);
...@@ -580,7 +580,7 @@ sal_Bool ImageManagerImpl::implts_storeUserImages( ...@@ -580,7 +580,7 @@ sal_Bool ImageManagerImpl::implts_storeUserImages(
aUserImageListInfo.pImageList = new ImageListDescriptor; aUserImageListInfo.pImageList = new ImageListDescriptor;
ImageListItemDescriptor* pList = new ImageListItemDescriptor; ImageListItemDescriptor* pList = new ImageListItemDescriptor;
aUserImageListInfo.pImageList->Insert( pList, 0 ); aUserImageListInfo.pImageList->push_back( pList );
pList->pImageItemList = new ImageItemListDescriptor; pList->pImageItemList = new ImageItemListDescriptor;
for ( sal_uInt16 i=0; i < pImageList->GetImageCount(); i++ ) for ( sal_uInt16 i=0; i < pImageList->GetImageCount(); i++ )
......
...@@ -63,7 +63,6 @@ namespace framework ...@@ -63,7 +63,6 @@ namespace framework
SV_IMPL_PTRARR( ImageItemListDescriptor, ImageItemDescriptorPtr ); SV_IMPL_PTRARR( ImageItemListDescriptor, ImageItemDescriptorPtr );
SV_IMPL_PTRARR( ExternalImageItemListDescriptor, ExternalImageItemDescriptorPtr ); SV_IMPL_PTRARR( ExternalImageItemListDescriptor, ExternalImageItemDescriptorPtr );
SV_IMPL_PTRARR( ImageListDescriptor, ImageListItemDescriptorPtr );
static Reference< XParser > GetSaxParser( static Reference< XParser > GetSaxParser(
const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceFactory const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceFactory
......
...@@ -545,7 +545,7 @@ throw( SAXException, RuntimeException ) ...@@ -545,7 +545,7 @@ throw( SAXException, RuntimeException )
if ( m_pImages ) if ( m_pImages )
{ {
if ( m_aImageList.pImageList ) 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_pImages = NULL;
} }
m_bImagesStartFound = sal_False; m_bImagesStartFound = sal_False;
...@@ -681,9 +681,9 @@ void OWriteImagesDocumentHandler::WriteImagesDocument() throw ...@@ -681,9 +681,9 @@ void OWriteImagesDocumentHandler::WriteImagesDocument() throw
{ {
ImageListDescriptor* pImageList = m_aImageListsItems.pImageList; 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 ); 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