summaryrefslogtreecommitdiff
path: root/xmloff/source/style/impastpl.hxx
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@gmail.com>2013-08-16 16:13:59 -0400
committerKohei Yoshida <kohei.yoshida@gmail.com>2013-08-16 21:31:44 -0400
commit1b183738aecc32219920a698196c72afebcdd8c0 (patch)
tree2ce068499efac6011ce20e5def1156aef7d73e3f /xmloff/source/style/impastpl.hxx
parente4f55865078e887a34d7b127b75d01ae374968de (diff)
Use ptr_set for auto style parent list. That seems like a natural fit.
Change-Id: I9fc094ec4aa7e4a6d4e637c5940c361639d44c65
Diffstat (limited to 'xmloff/source/style/impastpl.hxx')
-rw-r--r--xmloff/source/style/impastpl.hxx45
1 files changed, 20 insertions, 25 deletions
diff --git a/xmloff/source/style/impastpl.hxx b/xmloff/source/style/impastpl.hxx
index 84bfdfb781c9..b004115a4705 100644
--- a/xmloff/source/style/impastpl.hxx
+++ b/xmloff/source/style/impastpl.hxx
@@ -28,12 +28,14 @@
#include <com/sun/star/uno/Reference.h>
#include <com/sun/star/xml/sax/XAttributeList.hpp>
#include <com/sun/star/xml/sax/XDocumentHandler.hpp>
-#include <o3tl/sorted_vector.hxx>
#include <xmloff/maptype.hxx>
#include <xmloff/xmlexppr.hxx>
+#include <boost/noncopyable.hpp>
+#include <boost/ptr_container/ptr_set.hpp>
+
class SvXMLAutoStylePoolP;
-class SvXMLAutoStylePoolParentsP_Impl;
+class SvXMLAutoStylePoolParentP_Impl;
typedef std::set<OUString> SvXMLAutoStylePoolNamesP_Impl;
class SvXMLExportPropertyMapper;
class SvXMLExport;
@@ -42,31 +44,26 @@ class SvXMLExport;
// Implementationclass for stylefamily-information
-class XMLFamilyData_Impl
+struct XMLFamilyData_Impl : boost::noncopyable
{
-public:
- sal_uInt32 mnFamily;
+ typedef boost::ptr_set<SvXMLAutoStylePoolParentP_Impl> ParentsType;
+
+ sal_uInt32 mnFamily;
OUString maStrFamilyName;
UniReference < SvXMLExportPropertyMapper > mxMapper;
- SvXMLAutoStylePoolParentsP_Impl* mpParentList;
+ ParentsType maParents;
SvXMLAutoStylePoolNamesP_Impl* mpNameList;
sal_uInt32 mnCount;
sal_uInt32 mnName;
OUString maStrPrefix;
- sal_Bool bAsFamily;
+ bool mbAsFamily;
-public:
XMLFamilyData_Impl( sal_Int32 nFamily, const OUString& rStrName,
- const UniReference < SvXMLExportPropertyMapper > & rMapper,
- const OUString& rStrPrefix, sal_Bool bAsFamily = sal_True );
+ const UniReference<SvXMLExportPropertyMapper>& rMapper,
+ const OUString& rStrPrefix, bool bAsFamily = true );
- XMLFamilyData_Impl( sal_Int32 nFamily ) :
- mnFamily( nFamily ), mpParentList( NULL ),
- mpNameList( NULL ), mnCount( 0 ), mnName( 0 ),
- bAsFamily( false )
-
- {}
+ XMLFamilyData_Impl( sal_Int32 nFamily );
~XMLFamilyData_Impl();
friend bool operator<(const XMLFamilyData_Impl& r1, const XMLFamilyData_Impl& r2);
@@ -127,6 +124,8 @@ public:
{
return maPropertiesList;
}
+
+ bool operator< (const SvXMLAutoStylePoolParentP_Impl& rOther) const;
};
struct SvXMLAutoStylePoolParentPCmp_Impl
@@ -136,11 +135,6 @@ struct SvXMLAutoStylePoolParentPCmp_Impl
return lhs->GetParent().compareTo( rhs->GetParent() ) < 0;
}
};
-class SvXMLAutoStylePoolParentsP_Impl : public o3tl::sorted_vector<SvXMLAutoStylePoolParentP_Impl*, SvXMLAutoStylePoolParentPCmp_Impl>
-{
-public:
- ~SvXMLAutoStylePoolParentsP_Impl() { DeleteAndDestroyAll(); }
-};
// Implementationclass of SvXMLAutoStylePool
@@ -171,13 +165,14 @@ public:
bool Add(
OUString& rName, sal_Int32 nFamily,
- const OUString& rParent,
+ const OUString& rParentName,
const ::std::vector< XMLPropertyState >& rProperties,
bool bDontSeek = false );
- sal_Bool AddNamed( const OUString& rName, sal_Int32 nFamily,
- const OUString& rParent,
- const ::std::vector< XMLPropertyState >& rProperties );
+ bool AddNamed(
+ const OUString& rName, sal_Int32 nFamily,
+ const OUString& rParentName,
+ const ::std::vector< XMLPropertyState >& rProperties );
OUString Find( sal_Int32 nFamily, const OUString& rParent,
const ::std::vector< XMLPropertyState >& rProperties ) const;