diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2014-07-18 15:04:37 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2014-07-18 15:10:51 +0200 |
commit | 9f2dc12e611e5706469889c03fa5b11a6ab6e297 (patch) | |
tree | 2c2b7e3f65ba5ee2a57e5a88c3ae3713ed050719 /oox | |
parent | 84a5720f9ae42b98db99e0affd04b7d16ac742cd (diff) |
Use comphelper::SequenceAsHashMap
Change-Id: I5e4dc99c86b696d2c00392fdb47c4d9ebb7f14ff
Diffstat (limited to 'oox')
-rw-r--r-- | oox/source/core/xmlfilterbase.cxx | 30 |
1 files changed, 10 insertions, 20 deletions
diff --git a/oox/source/core/xmlfilterbase.cxx b/oox/source/core/xmlfilterbase.cxx index acc8805ab330..f236a9e2777f 100644 --- a/oox/source/core/xmlfilterbase.cxx +++ b/oox/source/core/xmlfilterbase.cxx @@ -667,33 +667,23 @@ writeAppProperties( XmlFilterBase& rSelf, Reference< XDocumentProperties > xProp writeElement( pAppProps, XML_DocSecurity, "doc security" ); #endif /* def OOXTODO */ - uno::Sequence<beans::NamedValue> aStats = xProperties->getDocumentStatistics(); - for (sal_Int32 i = 0; i < aStats.getLength(); ++i) + comphelper::SequenceAsHashMap aStats = xProperties->getDocumentStatistics(); + comphelper::SequenceAsHashMap::iterator it = aStats.find("ParagraphCount"); + if (it != aStats.end()) { - if (aStats[i].Name == "ParagraphCount") - { sal_Int32 nValue = 0; - if (aStats[i].Value >>= nValue) - { + if (it->second >>= nValue) writeElement(pAppProps, XML_Paragraphs, OUString::number(nValue)); - break; - } - } } uno::Reference<beans::XPropertyAccess> xUserDefinedProperties(xProperties->getUserDefinedProperties(), uno::UNO_QUERY); - const uno::Sequence<beans::PropertyValue> aUserDefinedProperties = xUserDefinedProperties->getPropertyValues(); - for (sal_Int32 i = 0; i < aUserDefinedProperties.getLength(); ++i) + comphelper::SequenceAsHashMap aUserDefinedProperties(xUserDefinedProperties->getPropertyValues()); + it = aUserDefinedProperties.find("Company"); + if (it != aStats.end()) { - if (aUserDefinedProperties[i].Name == "Company") - { - OUString aValue; - if (aUserDefinedProperties[i].Value >>= aValue) - { - writeElement(pAppProps, XML_Company, aValue); - break; - } - } + OUString aValue; + if (it->second >>= aValue) + writeElement(pAppProps, XML_Company, aValue); } pAppProps->endElement( XML_Properties ); |