[Libreoffice-commits] .: binfilter/bf_xmloff

Joseph Powers jpowers at kemper.freedesktop.org
Wed Jan 12 21:52:01 PST 2011


 binfilter/bf_xmloff/source/style/impastpl.hxx        |    4 -
 binfilter/bf_xmloff/source/style/xmloff_impastp3.cxx |   46 +++++++++++--------
 binfilter/bf_xmloff/source/style/xmloff_impastp4.cxx |   18 +++----
 3 files changed, 38 insertions(+), 30 deletions(-)

New commits:
commit affcfcfd7236a955d12c7e44daa7ff37d89353a9
Author: Joseph Powers <jpowers27 at cox.net>
Date:   Wed Jan 12 21:47:09 2011 -0800

    Remove DECLARE_LIST(SvXMLAutoStylePoolPropertiesPList_Impl,...)

diff --git a/binfilter/bf_xmloff/source/style/impastpl.hxx b/binfilter/bf_xmloff/source/style/impastpl.hxx
index c06a221..8dd04c1 100644
--- a/binfilter/bf_xmloff/source/style/impastpl.hxx
+++ b/binfilter/bf_xmloff/source/style/impastpl.hxx
@@ -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
@@ -126,7 +126,7 @@ public:
 };
 
 typedef SvXMLAutoStylePoolPropertiesP_Impl *SvXMLAutoStylePoolPropertiesPPtr;
-DECLARE_LIST( SvXMLAutoStylePoolPropertiesPList_Impl, SvXMLAutoStylePoolPropertiesPPtr )
+typedef ::std::vector< SvXMLAutoStylePoolPropertiesPPtr > SvXMLAutoStylePoolPropertiesPList_Impl;
 
 ///////////////////////////////////////////////////////////////////////////////
 //
diff --git a/binfilter/bf_xmloff/source/style/xmloff_impastp3.cxx b/binfilter/bf_xmloff/source/style/xmloff_impastp3.cxx
index 9917ac3..125028a 100644
--- a/binfilter/bf_xmloff/source/style/xmloff_impastp3.cxx
+++ b/binfilter/bf_xmloff/source/style/xmloff_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
@@ -44,8 +44,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();
 }
 
 ///////////////////////////////////////////////////////////////////////////////
@@ -58,15 +59,15 @@ sal_Bool SvXMLAutoStylePoolParentP_Impl::Add( XMLFamilyData_Impl* pFamilyData, c
 {
     sal_Bool bAdded = sal_False;
 
-    sal_Int32 nProperties = rProperties.size();
-    sal_uInt32 nCount = maPropertiesList.Count();
+    size_t nProperties = rProperties.size();
+    size_t nCount = maPropertiesList.size();
     SvXMLAutoStylePoolPropertiesP_Impl *pProperties = 0;
-    sal_uInt32 i;
+    size_t i;
 
     for( i=0; i < nCount; i++ )
     {
-        SvXMLAutoStylePoolPropertiesP_Impl *pIS = maPropertiesList.GetObject( i );
-        if( nProperties > pIS->GetProperties().size() ) 
+        SvXMLAutoStylePoolPropertiesP_Impl *pIS = maPropertiesList[ i ];
+        if( nProperties > pIS->GetProperties().size() )
         {
             continue;
         }
@@ -74,20 +75,27 @@ sal_Bool SvXMLAutoStylePoolParentP_Impl::Add( XMLFamilyData_Impl* pFamilyData, c
         {
             break;
         }
-        else if( pFamilyData->mxMapper->Equals( pIS->GetProperties(), rProperties ) ) 
+        else if( pFamilyData->mxMapper->Equals( pIS->GetProperties(), rProperties ) )
         {
             pProperties = pIS;
             break;
         }
     }
-    
+
     if( !pProperties )
     {
         pProperties = new SvXMLAutoStylePoolPropertiesP_Impl( pFamilyData, rProperties );
-        maPropertiesList.Insert( pProperties, i );
+        if ( i < maPropertiesList.size() )
+        {
+            SvXMLAutoStylePoolPropertiesPList_Impl::iterator it = maPropertiesList.begin();
+            ::std::advance( it, i );
+            maPropertiesList.insert( it, pProperties );
+        }
+        else
+            maPropertiesList.push_back( pProperties );
         bAdded = sal_True;
     }
-    
+
     rName = pProperties->GetName();
 
     return bAdded;
@@ -102,11 +110,11 @@ OUString SvXMLAutoStylePoolParentP_Impl::Find( const XMLFamilyData_Impl* pFamily
 {
     OUString sName;
     sal_uInt16 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 );
-        if( nItems > pIS->GetProperties().size() ) 
+        SvXMLAutoStylePoolPropertiesP_Impl *pIS = maPropertiesList[ i ];
+        if( nItems > pIS->GetProperties().size() )
         {
             continue;
         }
@@ -114,13 +122,13 @@ OUString SvXMLAutoStylePoolParentP_Impl::Find( const XMLFamilyData_Impl* pFamily
         {
             break;
         }
-        else if( pFamilyData->mxMapper->Equals( pIS->GetProperties(), rProperties ) ) 
+        else if( pFamilyData->mxMapper->Equals( pIS->GetProperties(), rProperties ) )
         {
             sName = pIS->GetName();
             break;
         }
     }
-    
+
     return sName;
 }
 
@@ -140,7 +148,7 @@ int SvXMLAutoStylePoolParentPCmp_Impl( const SvXMLAutoStylePoolParentP_Impl& r1,
 // Implementation of sorted list of SvXMLAutoStylePoolParent_Impl-elements
 //
 
-IMPL_CONTAINER_SORT( SvXMLAutoStylePoolParentsP_Impl, 
+IMPL_CONTAINER_SORT( SvXMLAutoStylePoolParentsP_Impl,
                      SvXMLAutoStylePoolParentP_Impl,
                      SvXMLAutoStylePoolParentPCmp_Impl )
 }//end of namespace binfilter
diff --git a/binfilter/bf_xmloff/source/style/xmloff_impastp4.cxx b/binfilter/bf_xmloff/source/style/xmloff_impastp4.cxx
index a5af685..efa5e3e 100644
--- a/binfilter/bf_xmloff/source/style/xmloff_impastp4.cxx
+++ b/binfilter/bf_xmloff/source/style/xmloff_impastp4.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
@@ -252,11 +252,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 );
+                    pParent->GetPropertiesList()[ j ];
                 sal_uInt32 nPos = pProperties->GetPos();
                 DBG_ASSERT( nPos < nCount,
                         "SvXMLAutoStylePool_Impl::exportXML: wrong position" );
@@ -283,7 +283,7 @@ void SvXMLAutoStylePoolP_Impl::exportXML(
 
             if( aExpStyles[i].mpProperties )
             {
-                GetExport().AddAttribute( 
+                GetExport().AddAttribute(
                     XML_NAMESPACE_STYLE, XML_NAME,
                     aExpStyles[i].mpProperties->GetName() );
 
@@ -315,7 +315,7 @@ void SvXMLAutoStylePoolP_Impl::exportXML(
                         GetExport().GetNamespaceMap()
                     );
 
-                SvXMLElementExport aElem( GetExport(), 
+                SvXMLElementExport aElem( GetExport(),
                                           XML_NAMESPACE_STYLE, sName,
                                           sal_True, sal_True );
 
@@ -341,14 +341,14 @@ void SvXMLAutoStylePoolP_Impl::exportXML(
 
                 pFamily->mxMapper->exportXML(
                     GetExport(),
-                    aExpStyles[i].mpProperties->GetProperties(), 
+                    aExpStyles[i].mpProperties->GetProperties(),
                     nStart, nEnd, XML_EXPORT_FLAG_IGN_WS );
 
-                pAntiImpl->exportStyleContent( 
+                pAntiImpl->exportStyleContent(
                     GetExport().GetDocHandler(),
                     nFamily,
                     aExpStyles[i].mpProperties->GetProperties(),
-                    *pFamily->mxMapper.get(), 
+                    *pFamily->mxMapper.get(),
                     GetExport().GetMM100UnitConverter(),
                     GetExport().GetNamespaceMap()
                     );


More information about the Libreoffice-commits mailing list