From 218be53fe00aebed43df0b041de609b30f99ce95 Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Wed, 15 Jul 2015 23:17:20 +0200 Subject: tools: replace boost::ptr_vector with std::unordered_map Change-Id: I530c5f95dda9aa80654e3a2a20a2e236221e7305 --- tools/source/inet/inetmime.cxx | 29 ++++++----------------------- 1 file changed, 6 insertions(+), 23 deletions(-) (limited to 'tools/source') 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::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: */ -- cgit