[Libreoffice-commits] .: xmloff/source
Joseph Powers
jpowers at kemper.freedesktop.org
Fri Jan 7 20:25:07 PST 2011
xmloff/source/style/impastp3.cxx | 33 +++++++++++++++++++--------------
xmloff/source/style/impastp4.cxx | 8 ++++----
xmloff/source/style/impastpl.hxx | 4 ++--
3 files changed, 25 insertions(+), 20 deletions(-)
New commits:
commit d456da018b3030250b30cbc2b5433a2ac701f2e1
Author: Joseph Powers <jpowers27 at cox.net>
Date: Fri Jan 7 20:24:59 2011 -0800
Remove DECLARE_LIST( SvXMLAutoStylePoolPropertiesPList_Impl, ... )
diff --git a/xmloff/source/style/impastp3.cxx b/xmloff/source/style/impastp3.cxx
index 79cde28..07aa28f 100644
--- a/xmloff/source/style/impastp3.cxx
+++ b/xmloff/source/style/impastp3.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -46,8 +46,9 @@ using namespace rtl;
SvXMLAutoStylePoolParentP_Impl::~SvXMLAutoStylePoolParentP_Impl()
{
- while( maPropertiesList.Count() )
- delete maPropertiesList.Remove( maPropertiesList.Count() -1 );
+ for( size_t i = maPropertiesList.size(); i > 0; )
+ delete maPropertiesList[ --i ];
+ maPropertiesList.clear();
}
///////////////////////////////////////////////////////////////////////////////
@@ -60,13 +61,13 @@ sal_Bool SvXMLAutoStylePoolParentP_Impl::Add( XMLFamilyData_Impl* pFamilyData, c
{
sal_Bool bAdded = sal_False;
SvXMLAutoStylePoolPropertiesP_Impl *pProperties = 0;
- sal_uInt32 i = 0;
+ size_t i = 0;
sal_Int32 nProperties = rProperties.size();
- sal_uInt32 nCount = maPropertiesList.Count();
+ size_t nCount = maPropertiesList.size();
for( i = 0; i < nCount; i++ )
{
- SvXMLAutoStylePoolPropertiesP_Impl *pIS = maPropertiesList.GetObject( i );
+ SvXMLAutoStylePoolPropertiesP_Impl *pIS = maPropertiesList[ i ];
if( nProperties > (sal_Int32)pIS->GetProperties().size() )
{
continue;
@@ -85,7 +86,9 @@ sal_Bool SvXMLAutoStylePoolParentP_Impl::Add( XMLFamilyData_Impl* pFamilyData, c
if( !pProperties )
{
pProperties = new SvXMLAutoStylePoolPropertiesP_Impl( pFamilyData, rProperties );
- maPropertiesList.Insert( pProperties, i );
+ SvXMLAutoStylePoolPropertiesPList_Impl::iterator it = maPropertiesList.begin();
+ ::std::advance( it, i );
+ maPropertiesList.insert( it, pProperties );
bAdded = sal_True;
}
@@ -104,13 +107,13 @@ sal_Bool SvXMLAutoStylePoolParentP_Impl::Add( XMLFamilyData_Impl* pFamilyData, c
sal_Bool SvXMLAutoStylePoolParentP_Impl::AddNamed( XMLFamilyData_Impl* pFamilyData, const vector< XMLPropertyState >& rProperties, const OUString& rName )
{
sal_Bool bAdded = sal_False;
- sal_uInt32 i = 0;
+ size_t i = 0;
sal_Int32 nProperties = rProperties.size();
- sal_uInt32 nCount = maPropertiesList.Count();
+ size_t nCount = maPropertiesList.size();
for( i = 0; i < nCount; i++ )
{
- SvXMLAutoStylePoolPropertiesP_Impl *pIS = maPropertiesList.GetObject( i );
+ SvXMLAutoStylePoolPropertiesP_Impl *pIS = maPropertiesList[ i ];
if( nProperties > (sal_Int32)pIS->GetProperties().size() )
{
continue;
@@ -127,7 +130,9 @@ sal_Bool SvXMLAutoStylePoolParentP_Impl::AddNamed( XMLFamilyData_Impl* pFamilyDa
new SvXMLAutoStylePoolPropertiesP_Impl( pFamilyData, rProperties );
// ignore the generated name
pProperties->SetName( rName );
- maPropertiesList.Insert( pProperties, i );
+ SvXMLAutoStylePoolPropertiesPList_Impl::iterator it = maPropertiesList.begin();
+ ::std::advance( it, i );
+ maPropertiesList.insert( it, pProperties );
bAdded = sal_True;
}
@@ -143,10 +148,10 @@ OUString SvXMLAutoStylePoolParentP_Impl::Find( const XMLFamilyData_Impl* pFamily
{
OUString sName;
vector< XMLPropertyState>::size_type nItems = rProperties.size();
- sal_uInt32 nCount = maPropertiesList.Count();
- for( sal_uInt32 i=0; i < nCount; i++ )
+ size_t nCount = maPropertiesList.size();
+ for( size_t i = 0; i < nCount; i++ )
{
- SvXMLAutoStylePoolPropertiesP_Impl *pIS = maPropertiesList.GetObject( i );
+ SvXMLAutoStylePoolPropertiesP_Impl *pIS = maPropertiesList[ i ];
if( nItems > pIS->GetProperties().size() )
{
continue;
diff --git a/xmloff/source/style/impastp4.cxx b/xmloff/source/style/impastp4.cxx
index 9aea30d..0a4ec52 100644
--- a/xmloff/source/style/impastp4.cxx
+++ b/xmloff/source/style/impastp4.cxx
@@ -410,11 +410,11 @@ void SvXMLAutoStylePoolP_Impl::exportXML(
{
const SvXMLAutoStylePoolParentP_Impl* pParent =
pParents->GetObject( i );
- sal_uInt32 nProperties = pParent->GetPropertiesList().Count();
- for( sal_uInt32 j=0; j < nProperties; j++ )
+ size_t nProperties = pParent->GetPropertiesList().size();
+ for( size_t j = 0; j < nProperties; j++ )
{
- const SvXMLAutoStylePoolPropertiesP_Impl *pProperties =
- pParent->GetPropertiesList().GetObject( j );
+ const SvXMLAutoStylePoolPropertiesP_Impl* pProperties =
+ pParent->GetPropertiesList()[ j ];
nPos = pProperties->GetPos();
DBG_ASSERT( nPos < nCount,
"SvXMLAutoStylePool_Impl::exportXML: wrong position" );
diff --git a/xmloff/source/style/impastpl.hxx b/xmloff/source/style/impastpl.hxx
index 5d391de..d0b4ebb 100644
--- a/xmloff/source/style/impastpl.hxx
+++ b/xmloff/source/style/impastpl.hxx
@@ -127,8 +127,8 @@ public:
void SetName( const ::rtl::OUString& rNew ) { msName = rNew; }
};
-typedef SvXMLAutoStylePoolPropertiesP_Impl *SvXMLAutoStylePoolPropertiesPPtr;
-DECLARE_LIST( SvXMLAutoStylePoolPropertiesPList_Impl, SvXMLAutoStylePoolPropertiesPPtr )
+typedef SvXMLAutoStylePoolPropertiesP_Impl* SvXMLAutoStylePoolPropertiesPPtr;
+typedef ::std::vector< SvXMLAutoStylePoolPropertiesPPtr > SvXMLAutoStylePoolPropertiesPList_Impl;
///////////////////////////////////////////////////////////////////////////////
//
More information about the Libreoffice-commits
mailing list