diff options
author | Joseph Powers <jpowers27@cox.net> | 2011-06-23 19:35:41 -0700 |
---|---|---|
committer | Joseph Powers <jpowers27@cox.net> | 2011-06-29 20:01:19 -0700 |
commit | 1d07b560e90ae85033f8ed2093e4ce05fcfe2113 (patch) | |
tree | 12611f4504a037c67f69c1bb39e315951b4f10b2 /uui | |
parent | df69092dd7c23f676970090ca994b5445b6a7e89 (diff) |
Replace List with std::vector< CntHTTPCookie* >
Signed-off-by: Joseph Powers <jpowers27@cox.net>
Diffstat (limited to 'uui')
-rw-r--r-- | uui/source/cookiedg.cxx | 12 | ||||
-rw-r--r-- | uui/source/iahndl-cookies.cxx | 22 |
2 files changed, 10 insertions, 24 deletions
diff --git a/uui/source/cookiedg.cxx b/uui/source/cookiedg.cxx index 5c1652814aa3..75b15c5ed2dd 100644 --- a/uui/source/cookiedg.cxx +++ b/uui/source/cookiedg.cxx @@ -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 bb2a4a50566c..a2b80101a14a 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-> |