Kaydet (Commit) 965f9816 authored tarafından Kohei Yoshida's avatar Kohei Yoshida

Rename XMLFamilyData_Impl to XMLAutoStyleFamily.

Change-Id: I9798408dc92a983fecc98c42516482afcb12ae25
üst f4be2add
...@@ -20,10 +20,10 @@ ...@@ -20,10 +20,10 @@
#include <tools/debug.hxx> #include <tools/debug.hxx>
#include "impastpl.hxx" #include "impastpl.hxx"
// Class XMLFamilyData_Impl // Class XMLAutoStyleFamily
// ctor/dtor class XMLFamilyData_Impl // ctor/dtor class XMLAutoStyleFamily
XMLFamilyData_Impl::XMLFamilyData_Impl( XMLAutoStyleFamily::XMLAutoStyleFamily(
sal_Int32 nFamily, sal_Int32 nFamily,
const OUString& rStrName, const OUString& rStrName,
const UniReference < SvXMLExportPropertyMapper > &rMapper, const UniReference < SvXMLExportPropertyMapper > &rMapper,
...@@ -36,17 +36,17 @@ XMLFamilyData_Impl::XMLFamilyData_Impl( ...@@ -36,17 +36,17 @@ XMLFamilyData_Impl::XMLFamilyData_Impl(
mpNameList = new SvXMLAutoStylePoolNamesP_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 ), mnFamily( nFamily ), mpNameList( NULL ), mnCount( 0 ), mnName( 0 ),
mbAsFamily( false ) mbAsFamily( false )
{} {}
XMLFamilyData_Impl::~XMLFamilyData_Impl() XMLAutoStyleFamily::~XMLAutoStyleFamily()
{ {
delete mpNameList; delete mpNameList;
} }
void XMLFamilyData_Impl::ClearEntries() void XMLAutoStyleFamily::ClearEntries()
{ {
maParents.clear(); maParents.clear();
} }
......
...@@ -25,7 +25,7 @@ using namespace std; ...@@ -25,7 +25,7 @@ using namespace std;
// Class SvXMLAutoStylePoolProperties_Impl // Class SvXMLAutoStylePoolProperties_Impl
// ctor 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 ), : maProperties( rProperties ),
mnPos ( rFamilyData.mnCount ) mnPos ( rFamilyData.mnCount )
{ {
...@@ -42,7 +42,7 @@ SvXMLAutoStylePoolPropertiesP_Impl::SvXMLAutoStylePoolPropertiesP_Impl( XMLFamil ...@@ -42,7 +42,7 @@ SvXMLAutoStylePoolPropertiesP_Impl::SvXMLAutoStylePoolPropertiesP_Impl( XMLFamil
while( rFamilyData.mpNameList->find(msName) != rFamilyData.mpNameList->end() ); 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; return r1.mnFamily < r2.mnFamily;
} }
......
...@@ -29,7 +29,7 @@ SvXMLAutoStylePoolParentP_Impl::~SvXMLAutoStylePoolParentP_Impl() ...@@ -29,7 +29,7 @@ SvXMLAutoStylePoolParentP_Impl::~SvXMLAutoStylePoolParentP_Impl()
// Adds a array of XMLPropertyState ( vector< XMLPropertyState > ) to list // Adds a array of XMLPropertyState ( vector< XMLPropertyState > ) to list
// if not added, yet. // 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; sal_Bool bAdded = sal_False;
SvXMLAutoStylePoolPropertiesP_Impl *pProperties = 0; SvXMLAutoStylePoolPropertiesP_Impl *pProperties = 0;
...@@ -73,7 +73,7 @@ sal_Bool SvXMLAutoStylePoolParentP_Impl::Add( XMLFamilyData_Impl& rFamilyData, c ...@@ -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). // 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_Bool bAdded = sal_False;
sal_Int32 nProperties = rProperties.size(); sal_Int32 nProperties = rProperties.size();
...@@ -110,7 +110,7 @@ sal_Bool SvXMLAutoStylePoolParentP_Impl::AddNamed( XMLFamilyData_Impl& rFamilyDa ...@@ -110,7 +110,7 @@ sal_Bool SvXMLAutoStylePoolParentP_Impl::AddNamed( XMLFamilyData_Impl& rFamilyDa
// Search for a array of XMLPropertyState ( vector< XMLPropertyState > ) in list // 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; OUString sName;
vector< XMLPropertyState>::size_type nItems = rProperties.size(); vector< XMLPropertyState>::size_type nItems = rProperties.size();
......
...@@ -67,7 +67,7 @@ void SvXMLAutoStylePoolP_Impl::AddFamily( ...@@ -67,7 +67,7 @@ void SvXMLAutoStylePoolP_Impl::AddFamily(
} }
#if OSL_DEBUG_LEVEL > 0 #if OSL_DEBUG_LEVEL > 0
XMLFamilyData_Impl aTemporary( nFamily ); XMLAutoStyleFamily aTemporary( nFamily );
FamilyListType::iterator aFind = maFamilyList.find(aTemporary); FamilyListType::iterator aFind = maFamilyList.find(aTemporary);
if( aFind != maFamilyList.end() ) if( aFind != maFamilyList.end() )
{ {
...@@ -81,7 +81,7 @@ void SvXMLAutoStylePoolP_Impl::AddFamily( ...@@ -81,7 +81,7 @@ void SvXMLAutoStylePoolP_Impl::AddFamily(
} }
#endif #endif
XMLFamilyData_Impl *pFamily = new XMLFamilyData_Impl( nFamily, rStrName, rMapper, aPrefix, bAsFamily ); XMLAutoStyleFamily *pFamily = new XMLAutoStyleFamily( nFamily, rStrName, rMapper, aPrefix, bAsFamily );
maFamilyList.insert(pFamily); maFamilyList.insert(pFamily);
} }
...@@ -90,7 +90,7 @@ void SvXMLAutoStylePoolP_Impl::SetFamilyPropSetMapper( ...@@ -90,7 +90,7 @@ void SvXMLAutoStylePoolP_Impl::SetFamilyPropSetMapper(
const UniReference < SvXMLExportPropertyMapper > & rMapper ) const UniReference < SvXMLExportPropertyMapper > & rMapper )
{ {
XMLFamilyData_Impl aTemporary( nFamily ); XMLAutoStyleFamily aTemporary( nFamily );
FamilyListType::iterator aFind = maFamilyList.find(aTemporary); FamilyListType::iterator aFind = maFamilyList.find(aTemporary);
if (aFind != maFamilyList.end()) if (aFind != maFamilyList.end())
aFind->mxMapper = rMapper; aFind->mxMapper = rMapper;
...@@ -99,7 +99,7 @@ void SvXMLAutoStylePoolP_Impl::SetFamilyPropSetMapper( ...@@ -99,7 +99,7 @@ void SvXMLAutoStylePoolP_Impl::SetFamilyPropSetMapper(
// Adds a name to list // Adds a name to list
void SvXMLAutoStylePoolP_Impl::RegisterName( sal_Int32 nFamily, const OUString& rName ) void SvXMLAutoStylePoolP_Impl::RegisterName( sal_Int32 nFamily, const OUString& rName )
{ {
XMLFamilyData_Impl aTmp( nFamily ); XMLAutoStyleFamily aTmp( nFamily );
FamilyListType::iterator aFind = maFamilyList.find(aTmp); FamilyListType::iterator aFind = maFamilyList.find(aTmp);
DBG_ASSERT( aFind != maFamilyList.end(), DBG_ASSERT( aFind != maFamilyList.end(),
"SvXMLAutoStylePool_Impl::RegisterName: unknown family" ); "SvXMLAutoStylePool_Impl::RegisterName: unknown family" );
...@@ -122,7 +122,7 @@ void SvXMLAutoStylePoolP_Impl::GetRegisteredNames( ...@@ -122,7 +122,7 @@ void SvXMLAutoStylePoolP_Impl::GetRegisteredNames(
// iterate over families // iterate over families
for (FamilyListType::iterator aJ = maFamilyList.begin(); aJ != maFamilyList.end(); ++aJ) for (FamilyListType::iterator aJ = maFamilyList.begin(); aJ != maFamilyList.end(); ++aJ)
{ {
XMLFamilyData_Impl &rFamily = *aJ; XMLAutoStyleFamily &rFamily = *aJ;
// iterate over names // iterate over names
SvXMLAutoStylePoolNamesP_Impl* pNames = rFamily.mpNameList; SvXMLAutoStylePoolNamesP_Impl* pNames = rFamily.mpNameList;
...@@ -152,20 +152,20 @@ bool SvXMLAutoStylePoolP_Impl::Add( ...@@ -152,20 +152,20 @@ bool SvXMLAutoStylePoolP_Impl::Add(
OUString& rName, sal_Int32 nFamily, const OUString& rParentName, OUString& rName, sal_Int32 nFamily, const OUString& rParentName,
const ::std::vector< XMLPropertyState >& rProperties, bool bDontSeek ) const ::std::vector< XMLPropertyState >& rProperties, bool bDontSeek )
{ {
XMLFamilyData_Impl aTemporary( nFamily ); XMLAutoStyleFamily aTemporary( nFamily );
FamilyListType::iterator aFind = maFamilyList.find(aTemporary); FamilyListType::iterator aFind = maFamilyList.find(aTemporary);
DBG_ASSERT(aFind != maFamilyList.end(), "SvXMLAutoStylePool_Impl::Add: unknown family"); DBG_ASSERT(aFind != maFamilyList.end(), "SvXMLAutoStylePool_Impl::Add: unknown family");
if (aFind == maFamilyList.end()) if (aFind == maFamilyList.end())
return false; return false;
XMLFamilyData_Impl &rFamily = *aFind; XMLAutoStyleFamily &rFamily = *aFind;
SvXMLAutoStylePoolParentP_Impl aTmp(rParentName); 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()) 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)); rFamily.maParents.insert(new SvXMLAutoStylePoolParentP_Impl(rParentName));
it2 = r.first; it2 = r.first;
} }
...@@ -188,20 +188,20 @@ bool SvXMLAutoStylePoolP_Impl::AddNamed( ...@@ -188,20 +188,20 @@ bool SvXMLAutoStylePoolP_Impl::AddNamed(
{ {
// get family and parent the same way as in Add() // get family and parent the same way as in Add()
XMLFamilyData_Impl aTemporary( nFamily ); XMLAutoStyleFamily aTemporary( nFamily );
FamilyListType::iterator aFind = maFamilyList.find(aTemporary); FamilyListType::iterator aFind = maFamilyList.find(aTemporary);
DBG_ASSERT(aFind != maFamilyList.end(), "SvXMLAutoStylePool_Impl::Add: unknown family"); DBG_ASSERT(aFind != maFamilyList.end(), "SvXMLAutoStylePool_Impl::Add: unknown family");
if (aFind == maFamilyList.end()) if (aFind == maFamilyList.end())
return false; return false;
XMLFamilyData_Impl &rFamily = *aFind; XMLAutoStyleFamily &rFamily = *aFind;
SvXMLAutoStylePoolParentP_Impl aTmp(rParentName); 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()) 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)); rFamily.maParents.insert(new SvXMLAutoStylePoolParentP_Impl(rParentName));
it2 = r.first; it2 = r.first;
} }
...@@ -228,15 +228,15 @@ OUString SvXMLAutoStylePoolP_Impl::Find( sal_Int32 nFamily, ...@@ -228,15 +228,15 @@ OUString SvXMLAutoStylePoolP_Impl::Find( sal_Int32 nFamily,
{ {
OUString sName; OUString sName;
XMLFamilyData_Impl aTemporary( nFamily ); XMLAutoStyleFamily aTemporary( nFamily );
FamilyListType::const_iterator const iter = maFamilyList.find(aTemporary); FamilyListType::const_iterator const iter = maFamilyList.find(aTemporary);
OSL_ENSURE(iter != maFamilyList.end(), "SvXMLAutoStylePool_Impl::Find: unknown family"); OSL_ENSURE(iter != maFamilyList.end(), "SvXMLAutoStylePool_Impl::Find: unknown family");
if (iter != maFamilyList.end()) if (iter != maFamilyList.end())
{ {
XMLFamilyData_Impl const& rFamily = *iter; XMLAutoStyleFamily const& rFamily = *iter;
SvXMLAutoStylePoolParentP_Impl aTmp( rParent ); 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()) if (it2 != rFamily.maParents.end())
{ {
sName = it2->Find(rFamily, rProperties); sName = it2->Find(rFamily, rProperties);
...@@ -258,14 +258,14 @@ void SvXMLAutoStylePoolP_Impl::exportXML( ...@@ -258,14 +258,14 @@ void SvXMLAutoStylePoolP_Impl::exportXML(
const SvXMLAutoStylePoolP *pAntiImpl) const const SvXMLAutoStylePoolP *pAntiImpl) const
{ {
// Get list of parents for current family (nFamily) // Get list of parents for current family (nFamily)
XMLFamilyData_Impl aTmp( nFamily ); XMLAutoStyleFamily aTmp( nFamily );
FamilyListType::const_iterator aFind = maFamilyList.find(aTmp); FamilyListType::const_iterator aFind = maFamilyList.find(aTmp);
DBG_ASSERT( aFind != maFamilyList.end(), DBG_ASSERT( aFind != maFamilyList.end(),
"SvXMLAutoStylePool_Impl::exportXML: unknown family" ); "SvXMLAutoStylePool_Impl::exportXML: unknown family" );
if (aFind == maFamilyList.end()) if (aFind == maFamilyList.end())
return; return;
const XMLFamilyData_Impl &rFamily = *aFind; const XMLAutoStyleFamily &rFamily = *aFind;
sal_uInt32 nCount = rFamily.mnCount; sal_uInt32 nCount = rFamily.mnCount;
if (!nCount) if (!nCount)
...@@ -284,7 +284,7 @@ void SvXMLAutoStylePoolP_Impl::exportXML( ...@@ -284,7 +284,7 @@ void SvXMLAutoStylePoolP_Impl::exportXML(
aExpStyles[i].mpProperties = 0; 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) for (; it != itEnd; ++it)
{ {
const SvXMLAutoStylePoolParentP_Impl& rParent = *it; const SvXMLAutoStylePoolParentP_Impl& rParent = *it;
......
...@@ -45,7 +45,7 @@ class SvXMLExport; ...@@ -45,7 +45,7 @@ class SvXMLExport;
// Implementationclass for stylefamily-information // Implementationclass for stylefamily-information
struct XMLFamilyData_Impl : boost::noncopyable struct XMLAutoStyleFamily : boost::noncopyable
{ {
typedef boost::ptr_set<SvXMLAutoStylePoolParentP_Impl> ParentsType; typedef boost::ptr_set<SvXMLAutoStylePoolParentP_Impl> ParentsType;
...@@ -60,14 +60,14 @@ struct XMLFamilyData_Impl : boost::noncopyable ...@@ -60,14 +60,14 @@ struct XMLFamilyData_Impl : boost::noncopyable
OUString maStrPrefix; OUString maStrPrefix;
bool mbAsFamily; bool mbAsFamily;
XMLFamilyData_Impl( sal_Int32 nFamily, const OUString& rStrName, XMLAutoStyleFamily( sal_Int32 nFamily, const OUString& rStrName,
const UniReference<SvXMLExportPropertyMapper>& rMapper, const UniReference<SvXMLExportPropertyMapper>& rMapper,
const OUString& rStrPrefix, bool bAsFamily = true ); const OUString& rStrPrefix, bool bAsFamily = true );
XMLFamilyData_Impl( sal_Int32 nFamily ); XMLAutoStyleFamily( sal_Int32 nFamily );
~XMLFamilyData_Impl(); ~XMLAutoStyleFamily();
friend bool operator<(const XMLFamilyData_Impl& r1, const XMLFamilyData_Impl& r2); friend bool operator<(const XMLAutoStyleFamily& r1, const XMLAutoStyleFamily& r2);
void ClearEntries(); void ClearEntries();
}; };
...@@ -82,7 +82,7 @@ class SvXMLAutoStylePoolPropertiesP_Impl ...@@ -82,7 +82,7 @@ class SvXMLAutoStylePoolPropertiesP_Impl
public: public:
SvXMLAutoStylePoolPropertiesP_Impl( XMLFamilyData_Impl& rFamilyData, const ::std::vector< XMLPropertyState >& rProperties ); SvXMLAutoStylePoolPropertiesP_Impl( XMLAutoStyleFamily& rFamilyData, const ::std::vector< XMLPropertyState >& rProperties );
~SvXMLAutoStylePoolPropertiesP_Impl() ~SvXMLAutoStylePoolPropertiesP_Impl()
{ {
...@@ -114,11 +114,11 @@ public: ...@@ -114,11 +114,11 @@ public:
~SvXMLAutoStylePoolParentP_Impl(); ~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; } const OUString& GetParent() const { return msParent; }
...@@ -143,7 +143,7 @@ struct SvXMLAutoStylePoolParentPCmp_Impl ...@@ -143,7 +143,7 @@ struct SvXMLAutoStylePoolParentPCmp_Impl
class SvXMLAutoStylePoolP_Impl class SvXMLAutoStylePoolP_Impl
{ {
// A set that finds and sorts based only on mnFamily // 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; SvXMLExport& rExport;
FamilyListType maFamilyList; FamilyListType maFamilyList;
......
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