[Libreoffice-commits] .: svl/inc svl/source

Joseph Powers jpowers at kemper.freedesktop.org
Wed Feb 2 05:19:15 PST 2011


 svl/inc/adrparse.hxx         |   12 ++++++------
 svl/source/misc/adrparse.cxx |   13 +++++++------
 2 files changed, 13 insertions(+), 12 deletions(-)

New commits:
commit fcad67121977628f4a6bfc47536aee859516e8ac
Author: Joseph Powers <jpowers27 at cox.net>
Date:   Wed Feb 2 05:18:45 2011 -0800

    Remove DECLARE_LIST(SvAddressList_Impl, SvAddressEntry_Impl*)

diff --git a/svl/inc/adrparse.hxx b/svl/inc/adrparse.hxx
index 57b31c6..dbb6718 100644
--- a/svl/inc/adrparse.hxx
+++ b/svl/inc/adrparse.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
@@ -30,8 +30,8 @@
 #define _ADRPARSE_HXX
 
 #include "svl/svldllapi.h"
-#include <tools/list.hxx>
 #include <tools/string.hxx>
+#include <vector>
 
 //============================================================================
 struct SvAddressEntry_Impl
@@ -46,7 +46,7 @@ struct SvAddressEntry_Impl
 };
 
 //============================================================================
-DECLARE_LIST(SvAddressList_Impl, SvAddressEntry_Impl *)
+typedef ::std::vector< SvAddressEntry_Impl* > SvAddressList_Impl;
 
 //============================================================================
 class SVL_DLLPUBLIC SvAddressParser
@@ -62,7 +62,7 @@ public:
 
     ~SvAddressParser();
 
-    sal_Int32 Count() const { return m_bHasFirst ? m_aRest.Count() + 1 : 0; }
+    sal_Int32 Count() const { return m_bHasFirst ? m_aRest.size() + 1 : 0; }
 
     inline UniString const & GetEmailAddress(sal_Int32 nIndex) const;
 
@@ -95,13 +95,13 @@ inline UniString const & SvAddressParser::GetEmailAddress(sal_Int32 nIndex)
     const
 {
     return nIndex == 0 ? m_aFirst.m_aAddrSpec :
-                         m_aRest.GetObject(nIndex - 1)->m_aAddrSpec;
+                         m_aRest[ nIndex - 1 ]->m_aAddrSpec;
 }
 
 inline UniString const & SvAddressParser::GetRealName(sal_Int32 nIndex) const
 {
     return nIndex == 0 ? m_aFirst.m_aRealName :
-                         m_aRest.GetObject(nIndex - 1)->m_aRealName;
+                         m_aRest[ nIndex - 1 ]->m_aRealName;
 }
 
 #endif // _ADRPARSE_HXX
diff --git a/svl/source/misc/adrparse.cxx b/svl/source/misc/adrparse.cxx
index 4b5731a..1c99aee 100644
--- a/svl/source/misc/adrparse.cxx
+++ b/svl/source/misc/adrparse.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
@@ -701,10 +701,10 @@ SvAddressParser_Impl::SvAddressParser_Impl(SvAddressParser * pParser,
                                         nLen);
                         }
                         if (pParser->m_bHasFirst)
-                            pParser->m_aRest.Insert(new SvAddressEntry_Impl(
+                            pParser->m_aRest.push_back(new SvAddressEntry_Impl(
                                                             aTheAddrSpec,
-                                                            aTheRealName),
-                                                    LIST_APPEND);
+                                                            aTheRealName)
+                                                      );
                         else
                         {
                             pParser->m_bHasFirst = true;
@@ -775,8 +775,9 @@ SvAddressParser::SvAddressParser(UniString const & rInput): m_bHasFirst(false)
 //============================================================================
 SvAddressParser::~SvAddressParser()
 {
-    for (ULONG i = m_aRest.Count(); i != 0;)
-        delete m_aRest.Remove(--i);
+    for ( size_t i = m_aRest.size(); i > 0; )
+        delete m_aRest[ --i ];
+    m_aRest.clear();
 }
 
 //============================================================================


More information about the Libreoffice-commits mailing list