[Libreoffice-commits] .: sfx2/source

Joseph Powers jpowers at kemper.freedesktop.org
Fri Dec 24 19:45:12 PST 2010


 sfx2/source/doc/doctemplates.cxx |   37 ++++++++++++++++++++-----------------
 1 file changed, 20 insertions(+), 17 deletions(-)

New commits:
commit 0801fe73cf7376e281f36d95419b539760821ef0
Author: Joseph Powers <jpowers27 at cox.net>
Date:   Fri Dec 24 19:44:19 2010 -0800

    Remove DECLARE_LIST( GroupList_Impl, GroupData_Impl* )

diff --git a/sfx2/source/doc/doctemplates.cxx b/sfx2/source/doc/doctemplates.cxx
index 4edef65..7851716 100644
--- a/sfx2/source/doc/doctemplates.cxx
+++ b/sfx2/source/doc/doctemplates.cxx
@@ -151,13 +151,13 @@ struct NamePair_Impl
     OUString maLongName;
 };
 
-typedef vector< NamePair_Impl* > NameList_Impl;
-
 class Updater_Impl;
-class GroupList_Impl;
 class DocTemplates_EntryData_Impl;
 class GroupData_Impl;
 
+typedef vector< NamePair_Impl* > NameList_Impl;
+typedef vector< GroupData_Impl* > GroupList_Impl;
+
 //=============================================================================
 #include <com/sun/star/task/XInteractionHandler.hpp>
 #include <com/sun/star/ucb/XProgressHandler.hpp>
@@ -392,8 +392,6 @@ public:
     DocTemplates_EntryData_Impl*    getEntry( size_t nPos ) { return maEntries[ nPos ]; }
 };
 
-DECLARE_LIST( GroupList_Impl, GroupData_Impl* )
-
 //=============================================================================
 //=============================================================================
 //=============================================================================
@@ -1240,9 +1238,9 @@ void SfxDocTplService_Impl::doUpdate()
     }
 
     // now check the list
-    GroupData_Impl *pGroup = aGroupList.First();
-    while ( pGroup )
+    for( size_t j = 0, n = aGroupList.size(); j < n; ++j )
     {
+        GroupData_Impl *pGroup = aGroupList[ j ];
         if ( pGroup->getInUse() )
         {
             if ( pGroup->getInHierarchy() )
@@ -1253,8 +1251,8 @@ void SfxDocTplService_Impl::doUpdate()
                                  OUString( RTL_CONSTASCII_USTRINGPARAM( TARGET_DIR_URL ) ),
                                  makeAny( pGroup->getTargetURL() ) );
 
-                ULONG nCount = pGroup->count();
-                for ( ULONG i=0; i<nCount; i++ )
+                size_t nCount = pGroup->count();
+                for ( size_t i=0; i<nCount; i++ )
                 {
                     DocTemplates_EntryData_Impl *pData = pGroup->getEntry( i );
                     if ( ! pData->getInUse() )
@@ -1280,10 +1278,10 @@ void SfxDocTplService_Impl::doUpdate()
             removeFromHierarchy( pGroup ); // delete group from hierarchy
 
         delete pGroup;
-        pGroup = aGroupList.Next();
     }
+    aGroupList.clear();
 
-       aValue <<= sal_False;
+    aValue <<= sal_False;
     setProperty( maRootContent, aPropName, aValue );
 }
 
@@ -2458,7 +2456,7 @@ void SfxDocTplService_Impl::addHierGroup( GroupList_Impl& rList,
         GroupData_Impl *pGroup = new GroupData_Impl( rTitle );
         pGroup->setHierarchy( sal_True );
         pGroup->setHierarchyURL( rOwnURL );
-        rList.Insert( pGroup );
+        rList.push_back( pGroup );
 
         uno::Reference< XContentAccess > xContentAccess( xResultSet, UNO_QUERY );
         uno::Reference< XRow > xRow( xResultSet, UNO_QUERY );
@@ -2523,15 +2521,20 @@ void SfxDocTplService_Impl::addFsysGroup( GroupList_Impl& rList,
     if ( !aTitle.getLength() )
         return;
 
-    GroupData_Impl *pGroup = rList.First();
-
-    while ( pGroup && pGroup->getTitle() != aTitle )
-        pGroup = rList.Next();
+    GroupData_Impl* pGroup = NULL;
+    for ( size_t i = 0, n = rList.size(); i < n; ++i )
+    {
+        if ( rList[ i ]->getTitle() == aTitle )
+        {
+            pGroup = rList[ i ];
+            break;
+        }
+    }
 
     if ( !pGroup )
     {
         pGroup = new GroupData_Impl( aTitle );
-        rList.Insert( pGroup );
+        rList.push_back( pGroup );
     }
 
     if ( bWriteableGroup )


More information about the Libreoffice-commits mailing list