summaryrefslogtreecommitdiff
path: root/tools/source
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2015-07-15 23:17:20 +0200
committerMichael Stahl <mstahl@redhat.com>2015-07-16 13:42:11 +0200
commit21834f14c97071c5bcf13ef02bf940dc1922663f (patch)
treed9120a580c00f2e864b2b2bd94399ca4c12ef1d5 /tools/source
parent188208d93a5d95e1f5eb39294c5e467d6d53edef (diff)
tools: replace boost::ptr_vector with std::unordered_map
Change-Id: I530c5f95dda9aa80654e3a2a20a2e236221e7305
Diffstat (limited to 'tools/source')
-rw-r--r--tools/source/inet/inetmime.cxx29
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: */