diff options
author | Michael Stahl <mstahl@redhat.com> | 2015-10-30 22:30:56 +0100 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2015-11-02 11:43:12 +0100 |
commit | 2ab470665f9cb350a9a3d10ecf1e1b85b72f676b (patch) | |
tree | a6713e929fc5d3fbda8882ac8507a9f7dcc74635 /xmloff | |
parent | 02b7f3d1a21d68611f2cd8405103c8546542960b (diff) |
xmloff: replace boost::ptr_vector with std::vector<std::unique_ptr>
Change-Id: Icb51f02ca761d683d926135fcaedc1164cd1ae8d
Diffstat (limited to 'xmloff')
-rw-r--r-- | xmloff/source/style/impastpl.cxx | 28 | ||||
-rw-r--r-- | xmloff/source/style/impastpl.hxx | 7 |
2 files changed, 17 insertions, 18 deletions
diff --git a/xmloff/source/style/impastpl.cxx b/xmloff/source/style/impastpl.cxx index 51221b355f8b..7c83433b2b34 100644 --- a/xmloff/source/style/impastpl.cxx +++ b/xmloff/source/style/impastpl.cxx @@ -282,9 +282,9 @@ bool XMLAutoStylePoolParent::Add( XMLAutoStyleFamily& rFamilyData, const vector< XMLAutoStylePoolProperties *pProperties = 0; sal_Int32 nProperties = rProperties.size(); size_t i = 0; - for (size_t n = maPropertiesList.size(); i < n; ++i) + for (size_t n = m_PropertiesList.size(); i < n; ++i) { - XMLAutoStylePoolProperties* pIS = &maPropertiesList[i]; + XMLAutoStylePoolProperties *const pIS = m_PropertiesList[i].get(); if( nProperties > (sal_Int32)pIS->GetProperties().size() ) { continue; @@ -303,9 +303,9 @@ bool XMLAutoStylePoolParent::Add( XMLAutoStyleFamily& rFamilyData, const vector< if( !pProperties ) { pProperties = new XMLAutoStylePoolProperties( rFamilyData, rProperties, msParent ); - PropertiesListType::iterator it = maPropertiesList.begin(); + PropertiesListType::iterator it = m_PropertiesList.begin(); ::std::advance( it, i ); - maPropertiesList.insert( it, pProperties ); + m_PropertiesList.insert(it, std::unique_ptr<XMLAutoStylePoolProperties>(pProperties)); bAdded = true; } @@ -325,9 +325,9 @@ bool XMLAutoStylePoolParent::AddNamed( XMLAutoStyleFamily& rFamilyData, const ve bool bAdded = false; sal_Int32 nProperties = rProperties.size(); size_t i = 0; - for (size_t n = maPropertiesList.size(); i < n; ++i) + for (size_t n = m_PropertiesList.size(); i < n; ++i) { - XMLAutoStylePoolProperties* pIS = &maPropertiesList[i]; + XMLAutoStylePoolProperties *const pIS = m_PropertiesList[i].get(); if( nProperties > (sal_Int32)pIS->GetProperties().size() ) { continue; @@ -340,13 +340,13 @@ bool XMLAutoStylePoolParent::AddNamed( XMLAutoStyleFamily& rFamilyData, const ve if (rFamilyData.maNameSet.find(rName) == rFamilyData.maNameSet.end()) { - XMLAutoStylePoolProperties* pProperties = - new XMLAutoStylePoolProperties( rFamilyData, rProperties, msParent ); + std::unique_ptr<XMLAutoStylePoolProperties> pProperties( + new XMLAutoStylePoolProperties(rFamilyData, rProperties, msParent)); // ignore the generated name pProperties->SetName( rName ); - PropertiesListType::iterator it = maPropertiesList.begin(); + PropertiesListType::iterator it = m_PropertiesList.begin(); ::std::advance( it, i ); - maPropertiesList.insert( it, pProperties ); + m_PropertiesList.insert(it, std::move(pProperties)); bAdded = true; } @@ -361,9 +361,9 @@ OUString XMLAutoStylePoolParent::Find( const XMLAutoStyleFamily& rFamilyData, co { OUString sName; vector< XMLPropertyState>::size_type nItems = rProperties.size(); - for (size_t i = 0, n = maPropertiesList.size(); i < n; ++i) + for (size_t i = 0, n = m_PropertiesList.size(); i < n; ++i) { - const XMLAutoStylePoolProperties* pIS = &maPropertiesList[i]; + const XMLAutoStylePoolProperties *const pIS = m_PropertiesList[i].get(); if( nItems > pIS->GetProperties().size() ) { continue; @@ -636,8 +636,8 @@ void SvXMLAutoStylePoolP_Impl::exportXML( size_t nProperties = rParent.GetPropertiesList().size(); for( size_t j = 0; j < nProperties; j++ ) { - XMLAutoStylePoolProperties* pProperties = - &rParent.GetPropertiesList()[j]; + XMLAutoStylePoolProperties *const pProperties = + rParent.GetPropertiesList()[j].get(); sal_uLong nPos = pProperties->GetPos(); assert(nPos < nCount); assert(!aExpStyles[nPos].mpProperties); diff --git a/xmloff/source/style/impastpl.hxx b/xmloff/source/style/impastpl.hxx index d7a8240e7c3b..c9113d47d569 100644 --- a/xmloff/source/style/impastpl.hxx +++ b/xmloff/source/style/impastpl.hxx @@ -35,7 +35,6 @@ #include <xmloff/xmlexppr.hxx> #include <boost/noncopyable.hpp> -#include <boost/ptr_container/ptr_vector.hpp> class SvXMLAutoStylePoolP; class XMLAutoStylePoolParent; @@ -70,11 +69,11 @@ public: class XMLAutoStylePoolParent { public: - typedef boost::ptr_vector<XMLAutoStylePoolProperties> PropertiesListType; + typedef std::vector<std::unique_ptr<XMLAutoStylePoolProperties>> PropertiesListType; private: OUString msParent; - PropertiesListType maPropertiesList; + PropertiesListType m_PropertiesList; public: @@ -95,7 +94,7 @@ public: PropertiesListType& GetPropertiesList() { - return maPropertiesList; + return m_PropertiesList; } bool operator< (const XMLAutoStylePoolParent& rOther) const; |