diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2014-07-05 10:18:31 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2014-07-05 10:18:31 +0200 |
commit | 2ff63282f7bf61379d8b96e7180d5800b2f1e05e (patch) | |
tree | 6411a80e7316bc673f084e17afb616f315ff71d3 | |
parent | 22906fd3470ae33b7fcb4c74095d663789c6178d (diff) |
Use comphelper::SequenceAsHashMap
Change-Id: I555514cb8647ff4a53eeff14933cfc4a868a3ab3
-rw-r--r-- | writerfilter/source/rtftok/rtfdocumentimpl.cxx | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx index 1be8c91c2edf..4f8649fa2e8f 100644 --- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx +++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx @@ -40,6 +40,7 @@ #include <tools/mapunit.hxx> #include <comphelper/classids.hxx> #include <comphelper/embeddedobjectcontainer.hxx> +#include <comphelper/sequenceashashmap.hxx> #include <sfx2/sfxbasemodel.hxx> #include <oox/mathml/import.hxx> @@ -4168,7 +4169,7 @@ int RTFDocumentImpl::dispatchValue(RTFKeyword nKeyword, int nParam) case RTF_NOFCHARSWS: if (m_xDocumentProperties.is()) { - uno::Sequence<beans::NamedValue> aSet = m_xDocumentProperties->getDocumentStatistics(); + comphelper::SequenceAsHashMap aSeq = m_xDocumentProperties->getDocumentStatistics(); OUString aName; switch (nKeyword) { @@ -4190,18 +4191,8 @@ int RTFDocumentImpl::dispatchValue(RTFKeyword nKeyword, int nParam) } if (!aName.isEmpty()) { - bool bFound = false; - int nLen = aSet.getLength(); - for (int i = 0; i < nLen; ++i) - if (aSet[i].Name.equals(aName)) - aSet[i].Value = uno::makeAny(sal_Int32(nParam)); - if (!bFound) - { - aSet.realloc(nLen + 1); - aSet[nLen].Name = aName; - aSet[nLen].Value = uno::makeAny(sal_Int32(nParam)); - } - m_xDocumentProperties->setDocumentStatistics(aSet); + aSeq[aName] = uno::makeAny(sal_Int32(nParam)); + m_xDocumentProperties->setDocumentStatistics(aSeq.getAsConstNamedValueList()); } } break; |