xmloff/source/style/impastp1.cxx | 24 +++-------- xmloff/source/style/impastp2.cxx | 6 +- xmloff/source/style/impastp3.cxx | 26 ++++++------ xmloff/source/style/impastp4.cxx | 83 +++++++++++++++++++-------------------- xmloff/source/style/impastpl.hxx | 56 +++++++++----------------- 5 files changed, 87 insertions(+), 108 deletions(-)
New commits: commit 16735020088ce652e57091ed6dc376a40b876546 Author: Kohei Yoshida <kohei.yosh...@gmail.com> Date: Sat Aug 17 22:57:24 2013 -0400 No need for elaborate type name for this. Change-Id: Ia29a5956813c5d71f042f774d00de3bc82b7f1aa diff --git a/xmloff/source/style/impastp1.cxx b/xmloff/source/style/impastp1.cxx index 2106184..63ce9de 100644 --- a/xmloff/source/style/impastp1.cxx +++ b/xmloff/source/style/impastp1.cxx @@ -31,20 +31,12 @@ XMLAutoStyleFamily::XMLAutoStyleFamily( bool bAsFamily ) : mnFamily( nFamily ), maStrFamilyName( rStrName), mxMapper( rMapper ), mnCount( 0 ), mnName( 0 ), maStrPrefix( rStrPrefix ), mbAsFamily( bAsFamily ) - -{ - mpNameList = new SvXMLAutoStylePoolNamesP_Impl; -} +{} XMLAutoStyleFamily::XMLAutoStyleFamily( sal_Int32 nFamily ) : - mnFamily( nFamily ), mpNameList( NULL ), mnCount( 0 ), mnName( 0 ), - mbAsFamily( false ) -{} + mnFamily(nFamily), mnCount(0), mnName(0), mbAsFamily(false) {} -XMLAutoStyleFamily::~XMLAutoStyleFamily() -{ - delete mpNameList; -} +XMLAutoStyleFamily::~XMLAutoStyleFamily() {} void XMLAutoStyleFamily::ClearEntries() { diff --git a/xmloff/source/style/impastp2.cxx b/xmloff/source/style/impastp2.cxx index e6caba1..8c6b50d 100644 --- a/xmloff/source/style/impastp2.cxx +++ b/xmloff/source/style/impastp2.cxx @@ -39,7 +39,7 @@ XMLAutoStylePoolProperties::XMLAutoStylePoolProperties( XMLAutoStyleFamily& rFam sBuffer.append( OUString::valueOf( (sal_Int32)rFamilyData.mnName ) ); msName = sBuffer.makeStringAndClear(); } - while( rFamilyData.mpNameList->find(msName) != rFamilyData.mpNameList->end() ); + while (rFamilyData.maNameList.find(msName) != rFamilyData.maNameList.end()); } bool operator<( const XMLAutoStyleFamily& r1, const XMLAutoStyleFamily& r2) diff --git a/xmloff/source/style/impastp3.cxx b/xmloff/source/style/impastp3.cxx index 8dde3f7..589d7e3 100644 --- a/xmloff/source/style/impastp3.cxx +++ b/xmloff/source/style/impastp3.cxx @@ -91,7 +91,7 @@ sal_Bool XMLAutoStylePoolParent::AddNamed( XMLAutoStyleFamily& rFamilyData, cons } } - if(rFamilyData.mpNameList->find(rName) == rFamilyData.mpNameList->end()) + if (rFamilyData.maNameList.find(rName) == rFamilyData.maNameList.end()) { XMLAutoStylePoolProperties* pProperties = new XMLAutoStylePoolProperties( rFamilyData, rProperties ); diff --git a/xmloff/source/style/impastp4.cxx b/xmloff/source/style/impastp4.cxx index a5d2f91..8aa7214 100644 --- a/xmloff/source/style/impastp4.cxx +++ b/xmloff/source/style/impastp4.cxx @@ -104,7 +104,7 @@ void SvXMLAutoStylePoolP_Impl::RegisterName( sal_Int32 nFamily, const OUString& DBG_ASSERT( aFind != maFamilyList.end(), "SvXMLAutoStylePool_Impl::RegisterName: unknown family" ); if (aFind != maFamilyList.end()) - aFind->mpNameList->insert(rName); + aFind->maNameList.insert(rName); } // @@ -125,10 +125,7 @@ void SvXMLAutoStylePoolP_Impl::GetRegisteredNames( XMLAutoStyleFamily &rFamily = *aJ; // iterate over names - SvXMLAutoStylePoolNamesP_Impl* pNames = rFamily.mpNameList; - if (!pNames) - continue; - for (SvXMLAutoStylePoolNamesP_Impl::const_iterator aI = pNames->begin(); aI != pNames->end(); ++aI) + for (XMLAutoStyleFamily::NameSetType::const_iterator aI = rFamily.maNameList.begin(); aI != rFamily.maNameList.end(); ++aI) { aFamilies.push_back( rFamily.mnFamily ); aNames.push_back( *aI ); diff --git a/xmloff/source/style/impastpl.hxx b/xmloff/source/style/impastpl.hxx index 56eb40a..04632ac 100644 --- a/xmloff/source/style/impastpl.hxx +++ b/xmloff/source/style/impastpl.hxx @@ -37,7 +37,6 @@ class SvXMLAutoStylePoolP; class XMLAutoStylePoolParent; -typedef std::set<OUString> SvXMLAutoStylePoolNamesP_Impl; class SvXMLExportPropertyMapper; class SvXMLExport; @@ -48,13 +47,14 @@ class SvXMLExport; struct XMLAutoStyleFamily : boost::noncopyable { typedef boost::ptr_set<XMLAutoStylePoolParent> ParentsType; + typedef std::set<OUString> NameSetType; sal_uInt32 mnFamily; OUString maStrFamilyName; UniReference < SvXMLExportPropertyMapper > mxMapper; ParentsType maParents; - SvXMLAutoStylePoolNamesP_Impl* mpNameList; + NameSetType maNameList; sal_uInt32 mnCount; sal_uInt32 mnName; OUString maStrPrefix; commit ed8c8a7173d26defac017ed9a1950b47d573898a Author: Kohei Yoshida <kohei.yosh...@gmail.com> Date: Sat Aug 17 22:49:44 2013 -0400 Move static struct to where it's used, and use std::vector for this. Change-Id: Id68fa488731d3b34213db23bf4d50f73b04c6fe4 diff --git a/xmloff/source/style/impastp4.cxx b/xmloff/source/style/impastp4.cxx index bd90fdf..a5d2f91 100644 --- a/xmloff/source/style/impastp4.cxx +++ b/xmloff/source/style/impastp4.cxx @@ -246,9 +246,17 @@ OUString SvXMLAutoStylePoolP_Impl::Find( sal_Int32 nFamily, return sName; } -// -// export -// +namespace { + +struct AutoStylePoolExport +{ + const OUString* mpParent; + const XMLAutoStylePoolProperties* mpProperties; + + AutoStylePoolExport() : mpParent(NULL), mpProperties(NULL) {} +}; + +} void SvXMLAutoStylePoolP_Impl::exportXML( sal_Int32 nFamily, @@ -273,9 +281,7 @@ void SvXMLAutoStylePoolP_Impl::exportXML( // create, initialize and fill helper-structure (SvXMLAutoStylePoolProperties_Impl) // which contains a parent-name and a SvXMLAutoStylePoolProperties_Impl - // - SvXMLAutoStylePoolPExport_Impl* aExpStyles = - new SvXMLAutoStylePoolPExport_Impl[nCount]; + std::vector<AutoStylePoolExport> aExpStyles(nCount); sal_uInt32 i; for( i=0; i < nCount; i++ ) @@ -390,8 +396,6 @@ void SvXMLAutoStylePoolP_Impl::exportXML( ); } } - - delete[] aExpStyles; } void SvXMLAutoStylePoolP_Impl::ClearEntries() diff --git a/xmloff/source/style/impastpl.hxx b/xmloff/source/style/impastpl.hxx index 4ad8486..56eb40a 100644 --- a/xmloff/source/style/impastpl.hxx +++ b/xmloff/source/style/impastpl.hxx @@ -180,12 +180,6 @@ public: void ClearEntries(); }; -struct SvXMLAutoStylePoolPExport_Impl -{ - const OUString *mpParent; - const XMLAutoStylePoolProperties *mpProperties; -}; - #endif /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ commit c19b9679a745a5ebb3eedd7583aedc4d75ae62c9 Author: Kohei Yoshida <kohei.yosh...@gmail.com> Date: Sat Aug 17 22:44:46 2013 -0400 This function object is no longer used. Change-Id: I0aa881bae4c1ee0857bafef78094a3d92bcc0702 diff --git a/xmloff/source/style/impastpl.hxx b/xmloff/source/style/impastpl.hxx index c45f87e..4ad8486 100644 --- a/xmloff/source/style/impastpl.hxx +++ b/xmloff/source/style/impastpl.hxx @@ -130,14 +130,6 @@ public: bool operator< (const XMLAutoStylePoolParent& rOther) const; }; -struct SvXMLAutoStylePoolParentPCmp_Impl -{ - bool operator()( XMLAutoStylePoolParent* const& lhs, XMLAutoStylePoolParent* const& rhs) const - { - return lhs->GetParent().compareTo( rhs->GetParent() ) < 0; - } -}; - // Implementationclass of SvXMLAutoStylePool class SvXMLAutoStylePoolP_Impl commit 82e3de57471c30e0047fcfc714d1219fd15067e4 Author: Kohei Yoshida <kohei.yosh...@gmail.com> Date: Sat Aug 17 22:43:43 2013 -0400 Rename SvXMLAutoStylePoolPropertiesP_Impl to XMLAutoStylePoolProperties. Change-Id: Ib2bd2da3852fdd8110d6d799b5a4091f2a89f0a8 diff --git a/xmloff/source/style/impastp2.cxx b/xmloff/source/style/impastp2.cxx index bcdaf3b..e6caba1 100644 --- a/xmloff/source/style/impastp2.cxx +++ b/xmloff/source/style/impastp2.cxx @@ -25,7 +25,7 @@ using namespace std; // Class SvXMLAutoStylePoolProperties_Impl // ctor class SvXMLAutoStylePoolProperties_Impl -SvXMLAutoStylePoolPropertiesP_Impl::SvXMLAutoStylePoolPropertiesP_Impl( XMLAutoStyleFamily& rFamilyData, const vector< XMLPropertyState >& rProperties ) +XMLAutoStylePoolProperties::XMLAutoStylePoolProperties( XMLAutoStyleFamily& rFamilyData, const vector< XMLPropertyState >& rProperties ) : maProperties( rProperties ), mnPos ( rFamilyData.mnCount ) { diff --git a/xmloff/source/style/impastp3.cxx b/xmloff/source/style/impastp3.cxx index 6ab2016..8dde3f7 100644 --- a/xmloff/source/style/impastp3.cxx +++ b/xmloff/source/style/impastp3.cxx @@ -32,12 +32,12 @@ XMLAutoStylePoolParent::~XMLAutoStylePoolParent() sal_Bool XMLAutoStylePoolParent::Add( XMLAutoStyleFamily& rFamilyData, const vector< XMLPropertyState >& rProperties, OUString& rName, bool bDontSeek ) { sal_Bool bAdded = sal_False; - SvXMLAutoStylePoolPropertiesP_Impl *pProperties = 0; + XMLAutoStylePoolProperties *pProperties = 0; sal_Int32 nProperties = rProperties.size(); size_t i = 0; for (size_t n = maPropertiesList.size(); i < n; ++i) { - SvXMLAutoStylePoolPropertiesP_Impl* pIS = &maPropertiesList[i]; + XMLAutoStylePoolProperties* pIS = &maPropertiesList[i]; if( nProperties > (sal_Int32)pIS->GetProperties().size() ) { continue; @@ -55,7 +55,7 @@ sal_Bool XMLAutoStylePoolParent::Add( XMLAutoStyleFamily& rFamilyData, const vec if( !pProperties ) { - pProperties = new SvXMLAutoStylePoolPropertiesP_Impl( rFamilyData, rProperties ); + pProperties = new XMLAutoStylePoolProperties( rFamilyData, rProperties ); PropertiesListType::iterator it = maPropertiesList.begin(); ::std::advance( it, i ); maPropertiesList.insert( it, pProperties ); @@ -80,7 +80,7 @@ sal_Bool XMLAutoStylePoolParent::AddNamed( XMLAutoStyleFamily& rFamilyData, cons size_t i = 0; for (size_t n = maPropertiesList.size(); i < n; ++i) { - SvXMLAutoStylePoolPropertiesP_Impl* pIS = &maPropertiesList[i]; + XMLAutoStylePoolProperties* pIS = &maPropertiesList[i]; if( nProperties > (sal_Int32)pIS->GetProperties().size() ) { continue; @@ -93,8 +93,8 @@ sal_Bool XMLAutoStylePoolParent::AddNamed( XMLAutoStyleFamily& rFamilyData, cons if(rFamilyData.mpNameList->find(rName) == rFamilyData.mpNameList->end()) { - SvXMLAutoStylePoolPropertiesP_Impl* pProperties = - new SvXMLAutoStylePoolPropertiesP_Impl( rFamilyData, rProperties ); + XMLAutoStylePoolProperties* pProperties = + new XMLAutoStylePoolProperties( rFamilyData, rProperties ); // ignore the generated name pProperties->SetName( rName ); PropertiesListType::iterator it = maPropertiesList.begin(); @@ -116,7 +116,7 @@ OUString XMLAutoStylePoolParent::Find( const XMLAutoStyleFamily& rFamilyData, co vector< XMLPropertyState>::size_type nItems = rProperties.size(); for (size_t i = 0, n = maPropertiesList.size(); i < n; ++i) { - const SvXMLAutoStylePoolPropertiesP_Impl* pIS = &maPropertiesList[i]; + const XMLAutoStylePoolProperties* pIS = &maPropertiesList[i]; if( nItems > pIS->GetProperties().size() ) { continue; diff --git a/xmloff/source/style/impastp4.cxx b/xmloff/source/style/impastp4.cxx index 1a7235e..bd90fdf 100644 --- a/xmloff/source/style/impastp4.cxx +++ b/xmloff/source/style/impastp4.cxx @@ -291,7 +291,7 @@ void SvXMLAutoStylePoolP_Impl::exportXML( size_t nProperties = rParent.GetPropertiesList().size(); for( size_t j = 0; j < nProperties; j++ ) { - const SvXMLAutoStylePoolPropertiesP_Impl* pProperties = + const XMLAutoStylePoolProperties* pProperties = &rParent.GetPropertiesList()[j]; sal_uLong nPos = pProperties->GetPos(); DBG_ASSERT( nPos < nCount, diff --git a/xmloff/source/style/impastpl.hxx b/xmloff/source/style/impastpl.hxx index 077456e..c45f87e 100644 --- a/xmloff/source/style/impastpl.hxx +++ b/xmloff/source/style/impastpl.hxx @@ -74,7 +74,7 @@ struct XMLAutoStyleFamily : boost::noncopyable // Properties of a pool -class SvXMLAutoStylePoolPropertiesP_Impl +class XMLAutoStylePoolProperties { OUString msName; ::std::vector< XMLPropertyState > maProperties; @@ -82,9 +82,9 @@ class SvXMLAutoStylePoolPropertiesP_Impl public: - SvXMLAutoStylePoolPropertiesP_Impl( XMLAutoStyleFamily& rFamilyData, const ::std::vector< XMLPropertyState >& rProperties ); + XMLAutoStylePoolProperties( XMLAutoStyleFamily& rFamilyData, const ::std::vector< XMLPropertyState >& rProperties ); - ~SvXMLAutoStylePoolPropertiesP_Impl() + ~XMLAutoStylePoolProperties() { } @@ -99,7 +99,7 @@ public: class XMLAutoStylePoolParent { public: - typedef boost::ptr_vector<SvXMLAutoStylePoolPropertiesP_Impl> PropertiesListType; + typedef boost::ptr_vector<XMLAutoStylePoolProperties> PropertiesListType; private: OUString msParent; @@ -191,7 +191,7 @@ public: struct SvXMLAutoStylePoolPExport_Impl { const OUString *mpParent; - const SvXMLAutoStylePoolPropertiesP_Impl *mpProperties; + const XMLAutoStylePoolProperties *mpProperties; }; #endif commit 30dab43c058c27ca603b5ac318a0283883475fc9 Author: Kohei Yoshida <kohei.yosh...@gmail.com> Date: Sat Aug 17 22:42:21 2013 -0400 Rename SvXMLAutoStylePoolParentP_Impl to XMLAutoStylePoolParent. Change-Id: Ia5fe8e386fd363f0b5bb81b3d0e8fd1e15efe430 diff --git a/xmloff/source/style/impastp3.cxx b/xmloff/source/style/impastp3.cxx index e6a644d..6ab2016 100644 --- a/xmloff/source/style/impastp3.cxx +++ b/xmloff/source/style/impastp3.cxx @@ -22,14 +22,14 @@ using namespace std; -SvXMLAutoStylePoolParentP_Impl::~SvXMLAutoStylePoolParentP_Impl() +XMLAutoStylePoolParent::~XMLAutoStylePoolParent() { } // Adds a array of XMLPropertyState ( vector< XMLPropertyState > ) to list // if not added, yet. -sal_Bool SvXMLAutoStylePoolParentP_Impl::Add( XMLAutoStyleFamily& rFamilyData, const vector< XMLPropertyState >& rProperties, OUString& rName, bool bDontSeek ) +sal_Bool XMLAutoStylePoolParent::Add( XMLAutoStyleFamily& rFamilyData, const vector< XMLPropertyState >& rProperties, OUString& rName, bool bDontSeek ) { sal_Bool bAdded = sal_False; SvXMLAutoStylePoolPropertiesP_Impl *pProperties = 0; @@ -73,7 +73,7 @@ sal_Bool SvXMLAutoStylePoolParentP_Impl::Add( XMLAutoStyleFamily& rFamilyData, c // the same properties exists, a new one is added (like with bDontSeek). // -sal_Bool SvXMLAutoStylePoolParentP_Impl::AddNamed( XMLAutoStyleFamily& rFamilyData, const vector< XMLPropertyState >& rProperties, const OUString& rName ) +sal_Bool XMLAutoStylePoolParent::AddNamed( XMLAutoStyleFamily& rFamilyData, const vector< XMLPropertyState >& rProperties, const OUString& rName ) { sal_Bool bAdded = sal_False; sal_Int32 nProperties = rProperties.size(); @@ -110,7 +110,7 @@ sal_Bool SvXMLAutoStylePoolParentP_Impl::AddNamed( XMLAutoStyleFamily& rFamilyDa // Search for a array of XMLPropertyState ( vector< XMLPropertyState > ) in list // -OUString SvXMLAutoStylePoolParentP_Impl::Find( const XMLAutoStyleFamily& rFamilyData, const vector< XMLPropertyState >& rProperties ) const +OUString XMLAutoStylePoolParent::Find( const XMLAutoStyleFamily& rFamilyData, const vector< XMLPropertyState >& rProperties ) const { OUString sName; vector< XMLPropertyState>::size_type nItems = rProperties.size(); @@ -135,7 +135,7 @@ OUString SvXMLAutoStylePoolParentP_Impl::Find( const XMLAutoStyleFamily& rFamily return sName; } -bool SvXMLAutoStylePoolParentP_Impl::operator< (const SvXMLAutoStylePoolParentP_Impl& rOther) const +bool XMLAutoStylePoolParent::operator< (const XMLAutoStylePoolParent& rOther) const { return msParent < rOther.msParent; } diff --git a/xmloff/source/style/impastp4.cxx b/xmloff/source/style/impastp4.cxx index 56cbffa..1a7235e 100644 --- a/xmloff/source/style/impastp4.cxx +++ b/xmloff/source/style/impastp4.cxx @@ -161,16 +161,16 @@ bool SvXMLAutoStylePoolP_Impl::Add( XMLAutoStyleFamily &rFamily = *aFind; - SvXMLAutoStylePoolParentP_Impl aTmp(rParentName); + XMLAutoStylePoolParent aTmp(rParentName); XMLAutoStyleFamily::ParentsType::iterator it2 = rFamily.maParents.find(aTmp); if (it2 == rFamily.maParents.end()) { std::pair<XMLAutoStyleFamily::ParentsType::iterator,bool> r = - rFamily.maParents.insert(new SvXMLAutoStylePoolParentP_Impl(rParentName)); + rFamily.maParents.insert(new XMLAutoStylePoolParent(rParentName)); it2 = r.first; } - SvXMLAutoStylePoolParentP_Impl& rParent = *it2; + XMLAutoStylePoolParent& rParent = *it2; bool bRet = false; if (rParent.Add(rFamily, rProperties, rName, bDontSeek)) @@ -197,16 +197,16 @@ bool SvXMLAutoStylePoolP_Impl::AddNamed( XMLAutoStyleFamily &rFamily = *aFind; - SvXMLAutoStylePoolParentP_Impl aTmp(rParentName); + XMLAutoStylePoolParent aTmp(rParentName); XMLAutoStyleFamily::ParentsType::iterator it2 = rFamily.maParents.find(aTmp); if (it2 == rFamily.maParents.end()) { std::pair<XMLAutoStyleFamily::ParentsType::iterator,bool> r = - rFamily.maParents.insert(new SvXMLAutoStylePoolParentP_Impl(rParentName)); + rFamily.maParents.insert(new XMLAutoStylePoolParent(rParentName)); it2 = r.first; } - SvXMLAutoStylePoolParentP_Impl& rParent = *it2; + XMLAutoStylePoolParent& rParent = *it2; bool bRet = false; if (rParent.AddNamed(rFamily, rProperties, rName)) @@ -235,7 +235,7 @@ OUString SvXMLAutoStylePoolP_Impl::Find( sal_Int32 nFamily, if (iter != maFamilyList.end()) { XMLAutoStyleFamily const& rFamily = *iter; - SvXMLAutoStylePoolParentP_Impl aTmp( rParent ); + XMLAutoStylePoolParent aTmp( rParent ); XMLAutoStyleFamily::ParentsType::const_iterator it2 = rFamily.maParents.find(aTmp); if (it2 != rFamily.maParents.end()) { @@ -287,7 +287,7 @@ void SvXMLAutoStylePoolP_Impl::exportXML( XMLAutoStyleFamily::ParentsType::const_iterator it = rFamily.maParents.begin(), itEnd = rFamily.maParents.end(); for (; it != itEnd; ++it) { - const SvXMLAutoStylePoolParentP_Impl& rParent = *it; + const XMLAutoStylePoolParent& rParent = *it; size_t nProperties = rParent.GetPropertiesList().size(); for( size_t j = 0; j < nProperties; j++ ) { diff --git a/xmloff/source/style/impastpl.hxx b/xmloff/source/style/impastpl.hxx index 6b4aa6d..077456e 100644 --- a/xmloff/source/style/impastpl.hxx +++ b/xmloff/source/style/impastpl.hxx @@ -36,7 +36,7 @@ #include <boost/ptr_container/ptr_vector.hpp> class SvXMLAutoStylePoolP; -class SvXMLAutoStylePoolParentP_Impl; +class XMLAutoStylePoolParent; typedef std::set<OUString> SvXMLAutoStylePoolNamesP_Impl; class SvXMLExportPropertyMapper; class SvXMLExport; @@ -47,7 +47,7 @@ class SvXMLExport; struct XMLAutoStyleFamily : boost::noncopyable { - typedef boost::ptr_set<SvXMLAutoStylePoolParentP_Impl> ParentsType; + typedef boost::ptr_set<XMLAutoStylePoolParent> ParentsType; sal_uInt32 mnFamily; OUString maStrFamilyName; @@ -96,7 +96,7 @@ public: }; // Parents of AutoStylePool's -class SvXMLAutoStylePoolParentP_Impl +class XMLAutoStylePoolParent { public: typedef boost::ptr_vector<SvXMLAutoStylePoolPropertiesP_Impl> PropertiesListType; @@ -107,12 +107,12 @@ private: public: - SvXMLAutoStylePoolParentP_Impl( const OUString & rParent ) : + XMLAutoStylePoolParent( const OUString & rParent ) : msParent( rParent ) { } - ~SvXMLAutoStylePoolParentP_Impl(); + ~XMLAutoStylePoolParent(); sal_Bool Add( XMLAutoStyleFamily& rFamilyData, const ::std::vector< XMLPropertyState >& rProperties, OUString& rName, bool bDontSeek = false ); @@ -127,12 +127,12 @@ public: return maPropertiesList; } - bool operator< (const SvXMLAutoStylePoolParentP_Impl& rOther) const; + bool operator< (const XMLAutoStylePoolParent& rOther) const; }; struct SvXMLAutoStylePoolParentPCmp_Impl { - bool operator()( SvXMLAutoStylePoolParentP_Impl* const& lhs, SvXMLAutoStylePoolParentP_Impl* const& rhs) const + bool operator()( XMLAutoStylePoolParent* const& lhs, XMLAutoStylePoolParent* const& rhs) const { return lhs->GetParent().compareTo( rhs->GetParent() ) < 0; } commit 965f98162deb89ac789bfe0ba81a8975d9140f13 Author: Kohei Yoshida <kohei.yosh...@gmail.com> Date: Sat Aug 17 22:35:35 2013 -0400 Rename XMLFamilyData_Impl to XMLAutoStyleFamily. Change-Id: I9798408dc92a983fecc98c42516482afcb12ae25 diff --git a/xmloff/source/style/impastp1.cxx b/xmloff/source/style/impastp1.cxx index 4d813ae..2106184 100644 --- a/xmloff/source/style/impastp1.cxx +++ b/xmloff/source/style/impastp1.cxx @@ -20,10 +20,10 @@ #include <tools/debug.hxx> #include "impastpl.hxx" -// Class XMLFamilyData_Impl -// ctor/dtor class XMLFamilyData_Impl +// Class XMLAutoStyleFamily +// ctor/dtor class XMLAutoStyleFamily -XMLFamilyData_Impl::XMLFamilyData_Impl( +XMLAutoStyleFamily::XMLAutoStyleFamily( sal_Int32 nFamily, const OUString& rStrName, const UniReference < SvXMLExportPropertyMapper > &rMapper, @@ -36,17 +36,17 @@ XMLFamilyData_Impl::XMLFamilyData_Impl( mpNameList = new SvXMLAutoStylePoolNamesP_Impl; } -XMLFamilyData_Impl::XMLFamilyData_Impl( sal_Int32 nFamily ) : +XMLAutoStyleFamily::XMLAutoStyleFamily( sal_Int32 nFamily ) : mnFamily( nFamily ), mpNameList( NULL ), mnCount( 0 ), mnName( 0 ), mbAsFamily( false ) {} -XMLFamilyData_Impl::~XMLFamilyData_Impl() +XMLAutoStyleFamily::~XMLAutoStyleFamily() { delete mpNameList; } -void XMLFamilyData_Impl::ClearEntries() +void XMLAutoStyleFamily::ClearEntries() { maParents.clear(); } diff --git a/xmloff/source/style/impastp2.cxx b/xmloff/source/style/impastp2.cxx index 86e2a40..bcdaf3b 100644 --- a/xmloff/source/style/impastp2.cxx +++ b/xmloff/source/style/impastp2.cxx @@ -25,7 +25,7 @@ using namespace std; // Class SvXMLAutoStylePoolProperties_Impl // ctor class SvXMLAutoStylePoolProperties_Impl -SvXMLAutoStylePoolPropertiesP_Impl::SvXMLAutoStylePoolPropertiesP_Impl( XMLFamilyData_Impl& rFamilyData, const vector< XMLPropertyState >& rProperties ) +SvXMLAutoStylePoolPropertiesP_Impl::SvXMLAutoStylePoolPropertiesP_Impl( XMLAutoStyleFamily& rFamilyData, const vector< XMLPropertyState >& rProperties ) : maProperties( rProperties ), mnPos ( rFamilyData.mnCount ) { @@ -42,7 +42,7 @@ SvXMLAutoStylePoolPropertiesP_Impl::SvXMLAutoStylePoolPropertiesP_Impl( XMLFamil while( rFamilyData.mpNameList->find(msName) != rFamilyData.mpNameList->end() ); } -bool operator<( const XMLFamilyData_Impl& r1, const XMLFamilyData_Impl& r2) +bool operator<( const XMLAutoStyleFamily& r1, const XMLAutoStyleFamily& r2) { return r1.mnFamily < r2.mnFamily; } diff --git a/xmloff/source/style/impastp3.cxx b/xmloff/source/style/impastp3.cxx index e9baa3c..e6a644d 100644 --- a/xmloff/source/style/impastp3.cxx +++ b/xmloff/source/style/impastp3.cxx @@ -29,7 +29,7 @@ SvXMLAutoStylePoolParentP_Impl::~SvXMLAutoStylePoolParentP_Impl() // Adds a array of XMLPropertyState ( vector< XMLPropertyState > ) to list // if not added, yet. -sal_Bool SvXMLAutoStylePoolParentP_Impl::Add( XMLFamilyData_Impl& rFamilyData, const vector< XMLPropertyState >& rProperties, OUString& rName, bool bDontSeek ) +sal_Bool SvXMLAutoStylePoolParentP_Impl::Add( XMLAutoStyleFamily& rFamilyData, const vector< XMLPropertyState >& rProperties, OUString& rName, bool bDontSeek ) { sal_Bool bAdded = sal_False; SvXMLAutoStylePoolPropertiesP_Impl *pProperties = 0; @@ -73,7 +73,7 @@ sal_Bool SvXMLAutoStylePoolParentP_Impl::Add( XMLFamilyData_Impl& rFamilyData, c // the same properties exists, a new one is added (like with bDontSeek). // -sal_Bool SvXMLAutoStylePoolParentP_Impl::AddNamed( XMLFamilyData_Impl& rFamilyData, const vector< XMLPropertyState >& rProperties, const OUString& rName ) +sal_Bool SvXMLAutoStylePoolParentP_Impl::AddNamed( XMLAutoStyleFamily& rFamilyData, const vector< XMLPropertyState >& rProperties, const OUString& rName ) { sal_Bool bAdded = sal_False; sal_Int32 nProperties = rProperties.size(); @@ -110,7 +110,7 @@ sal_Bool SvXMLAutoStylePoolParentP_Impl::AddNamed( XMLFamilyData_Impl& rFamilyDa // Search for a array of XMLPropertyState ( vector< XMLPropertyState > ) in list // -OUString SvXMLAutoStylePoolParentP_Impl::Find( const XMLFamilyData_Impl& rFamilyData, const vector< XMLPropertyState >& rProperties ) const +OUString SvXMLAutoStylePoolParentP_Impl::Find( const XMLAutoStyleFamily& rFamilyData, const vector< XMLPropertyState >& rProperties ) const { OUString sName; vector< XMLPropertyState>::size_type nItems = rProperties.size(); diff --git a/xmloff/source/style/impastp4.cxx b/xmloff/source/style/impastp4.cxx index 3c4aeb1..56cbffa 100644 --- a/xmloff/source/style/impastp4.cxx +++ b/xmloff/source/style/impastp4.cxx @@ -67,7 +67,7 @@ void SvXMLAutoStylePoolP_Impl::AddFamily( } #if OSL_DEBUG_LEVEL > 0 - XMLFamilyData_Impl aTemporary( nFamily ); + XMLAutoStyleFamily aTemporary( nFamily ); FamilyListType::iterator aFind = maFamilyList.find(aTemporary); if( aFind != maFamilyList.end() ) { @@ -81,7 +81,7 @@ void SvXMLAutoStylePoolP_Impl::AddFamily( } #endif - XMLFamilyData_Impl *pFamily = new XMLFamilyData_Impl( nFamily, rStrName, rMapper, aPrefix, bAsFamily ); + XMLAutoStyleFamily *pFamily = new XMLAutoStyleFamily( nFamily, rStrName, rMapper, aPrefix, bAsFamily ); maFamilyList.insert(pFamily); } @@ -90,7 +90,7 @@ void SvXMLAutoStylePoolP_Impl::SetFamilyPropSetMapper( const UniReference < SvXMLExportPropertyMapper > & rMapper ) { - XMLFamilyData_Impl aTemporary( nFamily ); + XMLAutoStyleFamily aTemporary( nFamily ); FamilyListType::iterator aFind = maFamilyList.find(aTemporary); if (aFind != maFamilyList.end()) aFind->mxMapper = rMapper; @@ -99,7 +99,7 @@ void SvXMLAutoStylePoolP_Impl::SetFamilyPropSetMapper( // Adds a name to list void SvXMLAutoStylePoolP_Impl::RegisterName( sal_Int32 nFamily, const OUString& rName ) { - XMLFamilyData_Impl aTmp( nFamily ); + XMLAutoStyleFamily aTmp( nFamily ); FamilyListType::iterator aFind = maFamilyList.find(aTmp); DBG_ASSERT( aFind != maFamilyList.end(), "SvXMLAutoStylePool_Impl::RegisterName: unknown family" ); @@ -122,7 +122,7 @@ void SvXMLAutoStylePoolP_Impl::GetRegisteredNames( // iterate over families for (FamilyListType::iterator aJ = maFamilyList.begin(); aJ != maFamilyList.end(); ++aJ) { - XMLFamilyData_Impl &rFamily = *aJ; + XMLAutoStyleFamily &rFamily = *aJ; // iterate over names SvXMLAutoStylePoolNamesP_Impl* pNames = rFamily.mpNameList; @@ -152,20 +152,20 @@ bool SvXMLAutoStylePoolP_Impl::Add( OUString& rName, sal_Int32 nFamily, const OUString& rParentName, const ::std::vector< XMLPropertyState >& rProperties, bool bDontSeek ) { - XMLFamilyData_Impl aTemporary( nFamily ); + XMLAutoStyleFamily aTemporary( nFamily ); FamilyListType::iterator aFind = maFamilyList.find(aTemporary); DBG_ASSERT(aFind != maFamilyList.end(), "SvXMLAutoStylePool_Impl::Add: unknown family"); if (aFind == maFamilyList.end()) return false; - XMLFamilyData_Impl &rFamily = *aFind; + XMLAutoStyleFamily &rFamily = *aFind; SvXMLAutoStylePoolParentP_Impl aTmp(rParentName); - XMLFamilyData_Impl::ParentsType::iterator it2 = rFamily.maParents.find(aTmp); + XMLAutoStyleFamily::ParentsType::iterator it2 = rFamily.maParents.find(aTmp); if (it2 == rFamily.maParents.end()) { - std::pair<XMLFamilyData_Impl::ParentsType::iterator,bool> r = + std::pair<XMLAutoStyleFamily::ParentsType::iterator,bool> r = rFamily.maParents.insert(new SvXMLAutoStylePoolParentP_Impl(rParentName)); it2 = r.first; } @@ -188,20 +188,20 @@ bool SvXMLAutoStylePoolP_Impl::AddNamed( { // get family and parent the same way as in Add() - XMLFamilyData_Impl aTemporary( nFamily ); + XMLAutoStyleFamily aTemporary( nFamily ); FamilyListType::iterator aFind = maFamilyList.find(aTemporary); DBG_ASSERT(aFind != maFamilyList.end(), "SvXMLAutoStylePool_Impl::Add: unknown family"); if (aFind == maFamilyList.end()) return false; - XMLFamilyData_Impl &rFamily = *aFind; + XMLAutoStyleFamily &rFamily = *aFind; SvXMLAutoStylePoolParentP_Impl aTmp(rParentName); - XMLFamilyData_Impl::ParentsType::iterator it2 = rFamily.maParents.find(aTmp); + XMLAutoStyleFamily::ParentsType::iterator it2 = rFamily.maParents.find(aTmp); if (it2 == rFamily.maParents.end()) { - std::pair<XMLFamilyData_Impl::ParentsType::iterator,bool> r = + std::pair<XMLAutoStyleFamily::ParentsType::iterator,bool> r = rFamily.maParents.insert(new SvXMLAutoStylePoolParentP_Impl(rParentName)); it2 = r.first; } @@ -228,15 +228,15 @@ OUString SvXMLAutoStylePoolP_Impl::Find( sal_Int32 nFamily, { OUString sName; - XMLFamilyData_Impl aTemporary( nFamily ); + XMLAutoStyleFamily aTemporary( nFamily ); FamilyListType::const_iterator const iter = maFamilyList.find(aTemporary); OSL_ENSURE(iter != maFamilyList.end(), "SvXMLAutoStylePool_Impl::Find: unknown family"); if (iter != maFamilyList.end()) { - XMLFamilyData_Impl const& rFamily = *iter; + XMLAutoStyleFamily const& rFamily = *iter; SvXMLAutoStylePoolParentP_Impl aTmp( rParent ); - XMLFamilyData_Impl::ParentsType::const_iterator it2 = rFamily.maParents.find(aTmp); + XMLAutoStyleFamily::ParentsType::const_iterator it2 = rFamily.maParents.find(aTmp); if (it2 != rFamily.maParents.end()) { sName = it2->Find(rFamily, rProperties); @@ -258,14 +258,14 @@ void SvXMLAutoStylePoolP_Impl::exportXML( const SvXMLAutoStylePoolP *pAntiImpl) const { // Get list of parents for current family (nFamily) - XMLFamilyData_Impl aTmp( nFamily ); + XMLAutoStyleFamily aTmp( nFamily ); FamilyListType::const_iterator aFind = maFamilyList.find(aTmp); DBG_ASSERT( aFind != maFamilyList.end(), "SvXMLAutoStylePool_Impl::exportXML: unknown family" ); if (aFind == maFamilyList.end()) return; - const XMLFamilyData_Impl &rFamily = *aFind; + const XMLAutoStyleFamily &rFamily = *aFind; sal_uInt32 nCount = rFamily.mnCount; if (!nCount) @@ -284,7 +284,7 @@ void SvXMLAutoStylePoolP_Impl::exportXML( aExpStyles[i].mpProperties = 0; } - XMLFamilyData_Impl::ParentsType::const_iterator it = rFamily.maParents.begin(), itEnd = rFamily.maParents.end(); + XMLAutoStyleFamily::ParentsType::const_iterator it = rFamily.maParents.begin(), itEnd = rFamily.maParents.end(); for (; it != itEnd; ++it) { const SvXMLAutoStylePoolParentP_Impl& rParent = *it; diff --git a/xmloff/source/style/impastpl.hxx b/xmloff/source/style/impastpl.hxx index d3b6cf6..6b4aa6d 100644 --- a/xmloff/source/style/impastpl.hxx +++ b/xmloff/source/style/impastpl.hxx @@ -45,7 +45,7 @@ class SvXMLExport; // Implementationclass for stylefamily-information -struct XMLFamilyData_Impl : boost::noncopyable +struct XMLAutoStyleFamily : boost::noncopyable { typedef boost::ptr_set<SvXMLAutoStylePoolParentP_Impl> ParentsType; @@ -60,14 +60,14 @@ struct XMLFamilyData_Impl : boost::noncopyable OUString maStrPrefix; bool mbAsFamily; - XMLFamilyData_Impl( sal_Int32 nFamily, const OUString& rStrName, + XMLAutoStyleFamily( sal_Int32 nFamily, const OUString& rStrName, const UniReference<SvXMLExportPropertyMapper>& rMapper, const OUString& rStrPrefix, bool bAsFamily = true ); - XMLFamilyData_Impl( sal_Int32 nFamily ); - ~XMLFamilyData_Impl(); + XMLAutoStyleFamily( sal_Int32 nFamily ); + ~XMLAutoStyleFamily(); - friend bool operator<(const XMLFamilyData_Impl& r1, const XMLFamilyData_Impl& r2); + friend bool operator<(const XMLAutoStyleFamily& r1, const XMLAutoStyleFamily& r2); void ClearEntries(); }; @@ -82,7 +82,7 @@ class SvXMLAutoStylePoolPropertiesP_Impl public: - SvXMLAutoStylePoolPropertiesP_Impl( XMLFamilyData_Impl& rFamilyData, const ::std::vector< XMLPropertyState >& rProperties ); + SvXMLAutoStylePoolPropertiesP_Impl( XMLAutoStyleFamily& rFamilyData, const ::std::vector< XMLPropertyState >& rProperties ); ~SvXMLAutoStylePoolPropertiesP_Impl() { @@ -114,11 +114,11 @@ public: ~SvXMLAutoStylePoolParentP_Impl(); - sal_Bool Add( XMLFamilyData_Impl& rFamilyData, const ::std::vector< XMLPropertyState >& rProperties, OUString& rName, bool bDontSeek = false ); + sal_Bool Add( XMLAutoStyleFamily& rFamilyData, const ::std::vector< XMLPropertyState >& rProperties, OUString& rName, bool bDontSeek = false ); - sal_Bool AddNamed( XMLFamilyData_Impl& rFamilyData, const ::std::vector< XMLPropertyState >& rProperties, const OUString& rName ); + sal_Bool AddNamed( XMLAutoStyleFamily& rFamilyData, const ::std::vector< XMLPropertyState >& rProperties, const OUString& rName ); - OUString Find( const XMLFamilyData_Impl& rFamilyData, const ::std::vector< XMLPropertyState >& rProperties ) const; + OUString Find( const XMLAutoStyleFamily& rFamilyData, const ::std::vector< XMLPropertyState >& rProperties ) const; const OUString& GetParent() const { return msParent; } @@ -143,7 +143,7 @@ struct SvXMLAutoStylePoolParentPCmp_Impl class SvXMLAutoStylePoolP_Impl { // A set that finds and sorts based only on mnFamily - typedef boost::ptr_set<XMLFamilyData_Impl> FamilyListType; + typedef boost::ptr_set<XMLAutoStyleFamily> FamilyListType; SvXMLExport& rExport; FamilyListType maFamilyList; _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits