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

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

Change-Id: Ia75bf59de4eb5e0be18f81b6ab897f9f9cb28855
üst ea2ae023
......@@ -57,7 +57,7 @@ struct ExternalImageItemDescriptor
typedef std::vector<std::unique_ptr<ImageItemDescriptor> > ImageItemListDescriptor;
typedef boost::ptr_vector<ExternalImageItemDescriptor> ExternalImageItemListDescriptor;
typedef std::vector<std::unique_ptr<ExternalImageItemDescriptor> > ExternalImageItemListDescriptor;
struct ImageListItemDescriptor
{
......
......@@ -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 );
}
......
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