[Libreoffice-commits] .: uui/source

Joseph Powers jpowers at kemper.freedesktop.org
Wed Jun 29 20:02:14 PDT 2011


 uui/source/cookiedg.cxx       |   14 +++++++-------
 uui/source/iahndl-cookies.cxx |   22 ++++------------------
 2 files changed, 11 insertions(+), 25 deletions(-)

New commits:
commit abbe94c8f239acc58a7fa4b51ea10e1533ca08e4
Author: Joseph Powers <jpowers27 at cox.net>
Date:   Thu Jun 23 19:35:41 2011 -0700

    Replace List with std::vector< CntHTTPCookie* >
    
    Signed-off-by: Joseph Powers <jpowers27 at cox.net>

diff --git a/uui/source/cookiedg.cxx b/uui/source/cookiedg.cxx
index d81a5b3..95ddca3 100644
--- a/uui/source/cookiedg.cxx
+++ b/uui/source/cookiedg.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
@@ -85,12 +85,12 @@ CookiesDialog::CookiesDialog( Window* pParent,
     aMsg.SearchAndReplaceAscii( "${HOST}", aObj.GetHost() );
     aMsg.SearchAndReplaceAscii( "${PATH}", aObj.GetPath() );
     String aTemplate( ResId( STR_COOKIES_RECV_COOKIES, *pResMgr ) );
-    List& rList =mpCookieRequest->m_rCookieList;
+    CntHTTPCookieList_impl& rList =mpCookieRequest->m_rCookieList;
     String aPair, aCookie;
 
-    for ( sal_uInt16 i = (sal_uInt16)rList.Count(); i--; )
+    for ( sal_uInt16 i = (sal_uInt16)rList.size(); i--; )
     {
-        CntHTTPCookie* pCookie = (CntHTTPCookie*)rList.GetObject(i);
+        CntHTTPCookie* pCookie = rList[ i ];
 
         if ( CNTHTTP_COOKIE_POLICY_INTERACTIVE == pCookie->m_nPolicy )
         {
@@ -121,11 +121,11 @@ short CookiesDialog::Execute()
 
     if ( maInFutureIgnoreBtn.IsChecked() )
         nStatus = CNTHTTP_COOKIE_POLICY_BANNED;
-    List& rList = mpCookieRequest->m_rCookieList;
+    CntHTTPCookieList_impl& rList = mpCookieRequest->m_rCookieList;
 
-    for ( sal_uInt16 i = (sal_uInt16)rList.Count(); i--; )
+    for ( sal_uInt16 i = (sal_uInt16)rList.size(); i--; )
     {
-        sal_uInt16& rStatus = ( (CntHTTPCookie*)rList.GetObject(i) )->m_nPolicy;
+        sal_uInt16& rStatus = rList[ i ]->m_nPolicy;
 
         if ( rStatus == CNTHTTP_COOKIE_POLICY_INTERACTIVE )
             rStatus = nStatus;
diff --git a/uui/source/iahndl-cookies.cxx b/uui/source/iahndl-cookies.cxx
index bb2a4a5..a2b8010 100644
--- a/uui/source/iahndl-cookies.cxx
+++ b/uui/source/iahndl-cookies.cxx
@@ -42,18 +42,6 @@ using namespace com::sun::star;
 
 namespace {
 
-class CookieList: public List
-{
-public:
-    ~CookieList() SAL_THROW(());
-};
-
-CookieList::~CookieList() SAL_THROW(())
-{
-    while (Count() != 0)
-        delete static_cast< CntHTTPCookie * >(Remove(Count() - 1));
-}
-
 void
 executeCookieDialog(Window * pParent, CntHTTPCookieRequest & rRequest)
     SAL_THROW((uno::RuntimeException))
@@ -84,7 +72,7 @@ handleCookiesRequest_(
         rContinuations)
     SAL_THROW((uno::RuntimeException))
 {
-    CookieList aCookies;
+    CntHTTPCookieList_impl* pCookies = new CntHTTPCookieList_impl();
     for (sal_Int32 i = 0; i < rRequest.Cookies.getLength(); ++i)
     {
         try
@@ -122,7 +110,7 @@ handleCookiesRequest_(
                 OSL_ASSERT(false);
                 break;
             }
-            aCookies.Insert(xCookie.get(), LIST_APPEND);
+            pCookies->push_back( xCookie.get() );
             xCookie.release();
         }
         catch (std::bad_alloc const &)
@@ -136,7 +124,7 @@ handleCookiesRequest_(
 
     CntHTTPCookieRequest
     aRequest(rRequest.URL,
-                 aCookies,
+                 *pCookies,
                  rRequest.Request == ucb::CookieRequest_RECEIVE
                      ? CNTHTTP_COOKIE_REQUEST_RECV
                      : CNTHTTP_COOKIE_REQUEST_SEND);
@@ -167,9 +155,7 @@ handleCookiesRequest_(
             for (sal_Int32 j = 0; j < rRequest.Cookies.getLength(); ++j)
                 if (rRequest.Cookies[j].Policy
                     == ucb::CookiePolicy_CONFIRM)
-                    switch (static_cast< CntHTTPCookie * >(aCookies.
-                                                           GetObject(j))->
-                            m_nPolicy)
+                    switch ( (*pCookies)[ j ]->m_nPolicy )
                     {
                     case CNTHTTP_COOKIE_POLICY_ACCEPTED:
                         xCookieHandling->


More information about the Libreoffice-commits mailing list