summaryrefslogtreecommitdiff
path: root/oox
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2014-03-21 09:40:58 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2014-03-21 10:12:27 +0100
commit5299cc26d136af179328f6e560040e1eabe8b9c8 (patch)
tree941d9c3412a1e27be350b4abbbbd894afd5dae63 /oox
parent258c8cc66ac5a91e4779d47bc3b3eafc7287332a (diff)
DOCX export of paragraph count in app.xml
Change-Id: Ie2fd4af3340c48c915eada74760cb414848f8a8b
Diffstat (limited to 'oox')
-rw-r--r--oox/source/core/xmlfilterbase.cxx17
1 files changed, 16 insertions, 1 deletions
diff --git a/oox/source/core/xmlfilterbase.cxx b/oox/source/core/xmlfilterbase.cxx
index 130ae9e0888a..5fc7c87fc337 100644
--- a/oox/source/core/xmlfilterbase.cxx
+++ b/oox/source/core/xmlfilterbase.cxx
@@ -639,7 +639,6 @@ writeAppProperties( XmlFilterBase& rSelf, Reference< XDocumentProperties > xProp
writeElement( pAppProps, XML_Characters, "characters" );
writeElement( pAppProps, XML_PresentationFormat, "presentation format" );
writeElement( pAppProps, XML_Lines, "lines" );
- writeElement( pAppProps, XML_Paragraphs, "paragraphs" );
writeElement( pAppProps, XML_Slides, "slides" );
writeElement( pAppProps, XML_Notes, "notes" );
#endif /* def OOXTODO */
@@ -663,6 +662,22 @@ writeAppProperties( XmlFilterBase& rSelf, Reference< XDocumentProperties > xProp
writeElement( pAppProps, XML_AppVersion, "app version" );
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)
+ {
+ sal_Int32 nValue = 0;
+ if (aStats[i].Value >>= nValue)
+ {
+ OUString aValue = OUString::number(nValue);
+ if (aStats[i].Name == "ParagraphCount")
+ {
+ writeElement(pAppProps, XML_Paragraphs, aValue);
+ break;
+ }
+ }
+ }
+
pAppProps->endElement( XML_Properties );
}