diff options
author | npcdoom <venccsralph@gmail.com> | 2011-03-01 13:34:49 -0430 |
---|---|---|
committer | Luboš Luňák <l.lunak@suse.cz> | 2011-03-04 12:11:28 +0100 |
commit | 266013916943e13b7e942ce0d5597eceab9d588b (patch) | |
tree | 431bece404c5413abe1e8278da0d6168ba9da111 /tools | |
parent | b019189c0b476038a6621702648cc7b97fe2b993 (diff) |
Remove deprecated container List.
Signed-off-by: Luboš Luňák <l.lunak@suse.cz>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/inc/tools/inetmime.hxx | 31 | ||||
-rw-r--r-- | tools/source/inet/inetmime.cxx | 19 |
2 files changed, 28 insertions, 22 deletions
diff --git a/tools/inc/tools/inetmime.hxx b/tools/inc/tools/inetmime.hxx index 51c626329581..f02a487987ea 100644 --- a/tools/inc/tools/inetmime.hxx +++ b/tools/inc/tools/inetmime.hxx @@ -28,13 +28,14 @@ #ifndef TOOLS_INETMIME_HXX #define TOOLS_INETMIME_HXX +#include <boost/ptr_container/ptr_vector.hpp> + #include "tools/toolsdllapi.h" #include <rtl/alloc.h> #include <rtl/string.h> #include "rtl/tencinfo.h" #include <tools/debug.hxx> #include <tools/errcode.hxx> -#include <tools/list.hxx> #include <tools/string.hxx> class DateTime; @@ -1418,29 +1419,35 @@ inline INetContentTypeParameter::INetContentTypeParameter(const ByteString & {} //============================================================================ -class TOOLS_DLLPUBLIC INetContentTypeParameterList: private List +class TOOLS_DLLPUBLIC INetContentTypeParameterList { public: - ~INetContentTypeParameterList() { Clear(); } - - using List::Count; void Clear(); void Insert(INetContentTypeParameter * pParameter, ULONG nIndex) - { List::Insert(pParameter, nIndex); } + { + maEntries.insert(maEntries.begin()+nIndex,pParameter); + } + + void Append(INetContentTypeParameter *pParameter) + { + maEntries.push_back(pParameter); + } - inline const INetContentTypeParameter * GetObject(ULONG nIndex) const; + inline const INetContentTypeParameter * GetObject(ULONG nIndex) const + { + return &(maEntries[nIndex]); + } const INetContentTypeParameter * find(const ByteString & rAttribute) const; + +private: + + boost::ptr_vector<INetContentTypeParameter> maEntries; }; -inline const INetContentTypeParameter * -INetContentTypeParameterList::GetObject(ULONG nIndex) const -{ - return static_cast< INetContentTypeParameter * >(List::GetObject(nIndex)); -} #endif // TOOLS_INETMIME_HXX diff --git a/tools/source/inet/inetmime.cxx b/tools/source/inet/inetmime.cxx index 5d80ebd8f7a6..b4c703df1c71 100644 --- a/tools/source/inet/inetmime.cxx +++ b/tools/source/inet/inetmime.cxx @@ -373,12 +373,11 @@ bool parseParameters(ParameterList const & rInput, break; }; } - pOutput->Insert(new INetContentTypeParameter(p->m_aAttribute, + pOutput->Append(new INetContentTypeParameter(p->m_aAttribute, p->m_aCharset, p->m_aLanguage, aValue, - !bBadEncoding), - LIST_APPEND); + !bBadEncoding)); p = pNext; } return true; @@ -4544,21 +4543,21 @@ INetMIMEEncodedWordOutputSink::operator <<(sal_uInt32 nChar) void INetContentTypeParameterList::Clear() { - while (Count() > 0) - delete static_cast< INetContentTypeParameter * >(Remove(Count() - 1)); + maEntries.clear(); } //============================================================================ const INetContentTypeParameter * INetContentTypeParameterList::find(const ByteString & rAttribute) const { - for (ULONG i = 0; i < Count(); ++i) + boost::ptr_vector<INetContentTypeParameter>::const_iterator iter; + for (iter = maEntries.begin(); iter != maEntries.end(); ++iter) { - const INetContentTypeParameter * pParameter = GetObject(i); - if (pParameter->m_sAttribute.EqualsIgnoreCaseAscii(rAttribute)) - return pParameter; + if (iter->m_sAttribute.EqualsIgnoreCaseAscii(rAttribute)) + return &(*iter); } - return 0; + + return NULL; } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |