Kaydet (Commit) 9f2dc12e authored tarafından Miklos Vajna's avatar Miklos Vajna

Use comphelper::SequenceAsHashMap

Change-Id: I5e4dc99c86b696d2c00392fdb47c4d9ebb7f14ff
üst 84a5720f
...@@ -667,33 +667,23 @@ writeAppProperties( XmlFilterBase& rSelf, Reference< XDocumentProperties > xProp ...@@ -667,33 +667,23 @@ writeAppProperties( XmlFilterBase& rSelf, Reference< XDocumentProperties > xProp
writeElement( pAppProps, XML_DocSecurity, "doc security" ); writeElement( pAppProps, XML_DocSecurity, "doc security" );
#endif /* def OOXTODO */ #endif /* def OOXTODO */
uno::Sequence<beans::NamedValue> aStats = xProperties->getDocumentStatistics(); comphelper::SequenceAsHashMap aStats = xProperties->getDocumentStatistics();
for (sal_Int32 i = 0; i < aStats.getLength(); ++i) comphelper::SequenceAsHashMap::iterator it = aStats.find("ParagraphCount");
if (it != aStats.end())
{ {
if (aStats[i].Name == "ParagraphCount")
{
sal_Int32 nValue = 0; sal_Int32 nValue = 0;
if (aStats[i].Value >>= nValue) if (it->second >>= nValue)
{
writeElement(pAppProps, XML_Paragraphs, OUString::number(nValue)); writeElement(pAppProps, XML_Paragraphs, OUString::number(nValue));
break;
}
}
} }
uno::Reference<beans::XPropertyAccess> xUserDefinedProperties(xProperties->getUserDefinedProperties(), uno::UNO_QUERY); uno::Reference<beans::XPropertyAccess> xUserDefinedProperties(xProperties->getUserDefinedProperties(), uno::UNO_QUERY);
const uno::Sequence<beans::PropertyValue> aUserDefinedProperties = xUserDefinedProperties->getPropertyValues(); comphelper::SequenceAsHashMap aUserDefinedProperties(xUserDefinedProperties->getPropertyValues());
for (sal_Int32 i = 0; i < aUserDefinedProperties.getLength(); ++i) it = aUserDefinedProperties.find("Company");
if (it != aStats.end())
{ {
if (aUserDefinedProperties[i].Name == "Company") OUString aValue;
{ if (it->second >>= aValue)
OUString aValue; writeElement(pAppProps, XML_Company, aValue);
if (aUserDefinedProperties[i].Value >>= aValue)
{
writeElement(pAppProps, XML_Company, aValue);
break;
}
}
} }
pAppProps->endElement( XML_Properties ); pAppProps->endElement( XML_Properties );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment