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

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

Change-Id: I0950b732f60a7b75d87da520f8cbc131d1a04137
üst 9304ce96
......@@ -566,16 +566,16 @@ PropRead::PropRead( SotStorage& rStorage, const OUString& rName ) :
void PropRead::AddSection( Section& rSection )
{
maSections.push_back( new Section( rSection ) );
maSections.push_back( o3tl::make_unique<Section>( rSection ) );
}
const Section* PropRead::GetSection( const sal_uInt8* pFMTID )
{
boost::ptr_vector<Section>::iterator it;
std::vector<std::unique_ptr<Section> >::iterator it;
for ( it = maSections.begin(); it != maSections.end(); ++it)
{
if ( memcmp( it->GetFMTID(), pFMTID, 16 ) == 0 )
return &(*it);
if ( memcmp( (*it)->GetFMTID(), pFMTID, 16 ) == 0 )
return it->get();
}
return nullptr;
}
......@@ -628,7 +628,8 @@ PropRead& PropRead::operator=( const PropRead& rPropRead )
mnVersionHi = rPropRead.mnVersionHi;
memcpy( mApplicationCLSID, rPropRead.mApplicationCLSID, 16 );
maSections = rPropRead.maSections.clone();
for(const std::unique_ptr<Section>& rSection : rPropRead.maSections)
maSections.push_back(o3tl::make_unique<Section>(*rSection.get()));
}
return *this;
}
......
......@@ -23,7 +23,6 @@
#include <map>
#include <vector>
#include <memory>
#include <boost/ptr_container/ptr_vector.hpp>
#include <sal/types.h>
#include <sot/storage.hxx>
......@@ -148,7 +147,7 @@ class PropRead
sal_uInt16 mnVersionLo;
sal_uInt16 mnVersionHi;
sal_uInt8 mApplicationCLSID[ 16 ];
boost::ptr_vector<Section> maSections;
std::vector<std::unique_ptr<Section> > maSections;
void AddSection( Section& rSection );
......
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