diff options
author | Michael Stahl <mstahl@redhat.com> | 2015-07-15 23:17:20 +0200 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2015-07-16 00:06:21 +0200 |
commit | 218be53fe00aebed43df0b041de609b30f99ce95 (patch) | |
tree | ad9098da3c0868c211065414fc7be6bbfff40cef /tools/source/inet | |
parent | 5c8325325868753d2891556400c91651bce58402 (diff) |
tools: replace boost::ptr_vector with std::unordered_map
Change-Id: I530c5f95dda9aa80654e3a2a20a2e236221e7305
Diffstat (limited to 'tools/source/inet')
-rw-r--r-- | tools/source/inet/inetmime.cxx | 29 |
1 files changed, 6 insertions, 23 deletions
diff --git a/tools/source/inet/inetmime.cxx b/tools/source/inet/inetmime.cxx index bfb06b814dc5..88e2cf9876db 100644 --- a/tools/source/inet/inetmime.cxx +++ b/tools/source/inet/inetmime.cxx @@ -257,7 +257,7 @@ bool parseParameters(ParameterList const & rInput, INetContentTypeParameterList * pOutput) { if (pOutput) - pOutput->Clear(); + pOutput->clear(); Parameter * pPrev = 0; for (Parameter * p = rInput.m_pList; p; p = p->m_pNext) @@ -335,11 +335,14 @@ bool parseParameters(ParameterList const & rInput, break; }; } - pOutput->Append(new INetContentTypeParameter(p->m_aAttribute, + auto const ret = pOutput->insert(std::make_pair(p->m_aAttribute, + INetContentTypeParameter(p->m_aAttribute, p->m_aCharset, p->m_aLanguage, aValue, - !bBadEncoding)); + !bBadEncoding))); + SAL_INFO_IF(!ret.second, "tools", + "INetMIME: dropping duplicate parameter: " << p->m_aAttribute); p = pNext; } return true; @@ -3738,24 +3741,4 @@ INetMIMEEncodedWordOutputSink::WriteUInt32(sal_uInt32 nChar) return *this; } -// INetContentTypeParameterList - -void INetContentTypeParameterList::Clear() -{ - maEntries.clear(); -} - -const INetContentTypeParameter * -INetContentTypeParameterList::find(const OString& rAttribute) const -{ - boost::ptr_vector<INetContentTypeParameter>::const_iterator iter; - for (iter = maEntries.begin(); iter != maEntries.end(); ++iter) - { - if (iter->m_sAttribute.equalsIgnoreAsciiCase(rAttribute)) - return &(*iter); - } - - return NULL; -} - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |