[Libreoffice-commits] .: sfx2/source

Joseph Powers jpowers at kemper.freedesktop.org
Thu Dec 23 22:35:02 PST 2010


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

New commits:
commit 13e997b1952b1547893c151c3c84108df03c6ee9
Author: Joseph Powers <jpowers27 at cox.net>
Date:   Thu Dec 23 22:17:03 2010 -0800

    Remove DECLARE_LIST( NameList_Impl, NamePair_Impl* )

diff --git a/sfx2/source/doc/doctemplates.cxx b/sfx2/source/doc/doctemplates.cxx
index ffcfe78..341be52 100644
--- a/sfx2/source/doc/doctemplates.cxx
+++ b/sfx2/source/doc/doctemplates.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
@@ -71,6 +71,8 @@
 #include <sfx2/docfile.hxx>
 #include "doc.hrc"
 
+#include <vector>
+
 //-----------------------------------------------------------------------------
 
 //=============================================================================
@@ -122,6 +124,8 @@ using namespace ::rtl;
 using namespace ::ucbhelper;
 using namespace ::comphelper;
 
+using ::std::vector;
+
 //=============================================================================
 
 class WaitWindow_Impl : public WorkWindow
@@ -147,7 +151,7 @@ struct NamePair_Impl
     OUString maLongName;
 };
 
-DECLARE_LIST( NameList_Impl, NamePair_Impl* )
+typedef vector< NamePair_Impl* > NameList_Impl;
 
 class Updater_Impl;
 class GroupList_Impl;
@@ -556,7 +560,7 @@ void SfxDocTplService_Impl::readFolderList()
         pPair->maShortName  = aShortNames.GetString( i );
         pPair->maLongName   = aLongNames.GetString( i );
 
-        maNames.Insert( pPair, LIST_APPEND );
+        maNames.push_back( pPair );
     }
 }
 
@@ -564,17 +568,15 @@ void SfxDocTplService_Impl::readFolderList()
 OUString SfxDocTplService_Impl::getLongName( const OUString& rShortName )
 {
     OUString         aRet;
-    NamePair_Impl   *pPair = maNames.First();
 
-    while ( pPair )
+    for ( size_t i = 0, n = maNames.size(); i < n; ++i )
     {
+        NamePair_Impl* pPair = maNames[ i ];
         if ( pPair->maShortName == rShortName )
         {
             aRet = pPair->maLongName;
             break;
         }
-        else
-            pPair = maNames.Next();
     }
 
     if ( !aRet.getLength() )
@@ -1155,6 +1157,10 @@ SfxDocTplService_Impl::~SfxDocTplService_Impl()
         mpUpdater->join();
         delete mpUpdater;
     }
+
+    for ( size_t i = 0, n = maNames.size(); i < n; ++i )
+        delete maNames[ i ];
+    maNames.clear();
 }
 
 //-----------------------------------------------------------------------------


More information about the Libreoffice-commits mailing list