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

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

Change-Id: I6f1ab588b4523fa5d2fdbe41b136fa8365499351
üst 3a03dd6c
...@@ -1576,7 +1576,7 @@ void XclImpXFBuffer::ReadStyle( XclImpStream& rStrm ) ...@@ -1576,7 +1576,7 @@ void XclImpXFBuffer::ReadStyle( XclImpStream& rStrm )
{ {
XclImpStyle* pStyle = new XclImpStyle( GetRoot() ); XclImpStyle* pStyle = new XclImpStyle( GetRoot() );
pStyle->ReadStyle( rStrm ); pStyle->ReadStyle( rStrm );
(pStyle->IsBuiltin() ? maBuiltinStyles : maUserStyles).push_back( pStyle ); (pStyle->IsBuiltin() ? maBuiltinStyles : maUserStyles).push_back( std::unique_ptr<XclImpStyle>(pStyle) );
OSL_ENSURE( maStylesByXf.count( pStyle->GetXfId() ) == 0, "XclImpXFBuffer::ReadStyle - multiple styles with equal XF identifier" ); OSL_ENSURE( maStylesByXf.count( pStyle->GetXfId() ) == 0, "XclImpXFBuffer::ReadStyle - multiple styles with equal XF identifier" );
maStylesByXf[ pStyle->GetXfId() ] = pStyle; maStylesByXf[ pStyle->GetXfId() ] = pStyle;
} }
...@@ -1632,13 +1632,13 @@ void XclImpXFBuffer::CreateUserStyles() ...@@ -1632,13 +1632,13 @@ void XclImpXFBuffer::CreateUserStyles()
in the aConflictNameStyles list. */ in the aConflictNameStyles list. */
for( XclImpStyleList::iterator itStyle = maBuiltinStyles.begin(); itStyle != maBuiltinStyles.end(); ++itStyle ) for( XclImpStyleList::iterator itStyle = maBuiltinStyles.begin(); itStyle != maBuiltinStyles.end(); ++itStyle )
{ {
OUString aStyleName = XclTools::GetBuiltInStyleName( itStyle->GetBuiltinId(), itStyle->GetName(), itStyle->GetLevel() ); OUString aStyleName = XclTools::GetBuiltInStyleName( (*itStyle)->GetBuiltinId(), (*itStyle)->GetName(), (*itStyle)->GetLevel() );
OSL_ENSURE( bReserveAll || (aCellStyles.count( aStyleName ) == 0), OSL_ENSURE( bReserveAll || (aCellStyles.count( aStyleName ) == 0),
"XclImpXFBuffer::CreateUserStyles - multiple styles with equal built-in identifier" ); "XclImpXFBuffer::CreateUserStyles - multiple styles with equal built-in identifier" );
if( aCellStyles.count( aStyleName ) > 0 ) if( aCellStyles.count( aStyleName ) > 0 )
aConflictNameStyles.push_back( &(*itStyle) ); aConflictNameStyles.push_back( itStyle->get() );
else else
aCellStyles[ aStyleName ] = &(*itStyle); aCellStyles[ aStyleName ] = itStyle->get();
} }
/* Calculate names of user defined styles. Store styles with reserved /* Calculate names of user defined styles. Store styles with reserved
...@@ -1646,12 +1646,12 @@ void XclImpXFBuffer::CreateUserStyles() ...@@ -1646,12 +1646,12 @@ void XclImpXFBuffer::CreateUserStyles()
for( XclImpStyleList::iterator itStyle = maUserStyles.begin(); itStyle != maUserStyles.end(); ++itStyle ) for( XclImpStyleList::iterator itStyle = maUserStyles.begin(); itStyle != maUserStyles.end(); ++itStyle )
{ {
// #i1624# #i1768# ignore unnamed user styles // #i1624# #i1768# ignore unnamed user styles
if( !itStyle->GetName().isEmpty() ) if( !(*itStyle)->GetName().isEmpty() )
{ {
if( aCellStyles.count( itStyle->GetName() ) > 0 ) if( aCellStyles.count( (*itStyle)->GetName() ) > 0 )
aConflictNameStyles.push_back( &(*itStyle) ); aConflictNameStyles.push_back( itStyle->get() );
else else
aCellStyles[ itStyle->GetName() ] = &(*itStyle); aCellStyles[ (*itStyle)->GetName() ] = itStyle->get();
} }
} }
......
...@@ -506,7 +506,7 @@ public: ...@@ -506,7 +506,7 @@ public:
ScStyleSheet* CreateStyleSheet( sal_uInt16 nXFIndex ); ScStyleSheet* CreateStyleSheet( sal_uInt16 nXFIndex );
private: private:
typedef boost::ptr_vector< XclImpStyle > XclImpStyleList; typedef std::vector< std::unique_ptr<XclImpStyle> > XclImpStyleList;
typedef ::std::map< sal_uInt16, XclImpStyle* > XclImpStyleMap; typedef ::std::map< sal_uInt16, XclImpStyle* > XclImpStyleMap;
boost::ptr_vector< XclImpXF > maXFList; /// List of contents of all XF record. boost::ptr_vector< XclImpXF > maXFList; /// List of contents of all XF record.
......
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