diff options
author | alexey.chemichev <alexey.chemichev@gmail.com> | 2015-11-18 13:11:18 -0500 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2015-11-18 19:39:29 +0000 |
commit | 8beea0f6b43b9fe893418687a75d28a6d624ede7 (patch) | |
tree | 00566811adc30da46c0b1d70aa4ce282f7552eed /oox | |
parent | c0e04644a1703f4c6529e88b7c208126d2a2b1ec (diff) |
tdf#90904 DOCX export metadata for "Pages", "Word count", "Character count"
/oox/source/core/xmlfilterbase.cxx: writeAppProperties modified.
Stats are extracted from DocumentProperties->DocumentStatistics.
No stat counter found for the lines of text
Change-Id: Ibc2e848a97776f65f0bfd4a880e5279e9c507dd0
Reviewed-on: https://gerrit.libreoffice.org/20046
Reviewed-by: jan iversen <jani@documentfoundation.org>
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Michael Stahl <mstahl@redhat.com>
Diffstat (limited to 'oox')
-rw-r--r-- | oox/source/core/xmlfilterbase.cxx | 30 |
1 files changed, 25 insertions, 5 deletions
diff --git a/oox/source/core/xmlfilterbase.cxx b/oox/source/core/xmlfilterbase.cxx index f140d1da3bda..a89cc9d4fec8 100644 --- a/oox/source/core/xmlfilterbase.cxx +++ b/oox/source/core/xmlfilterbase.cxx @@ -650,9 +650,6 @@ writeAppProperties( XmlFilterBase& rSelf, Reference< XDocumentProperties > xProp writeElement( pAppProps, XML_Template, xProperties->getTemplateName() ); #ifdef OOXTODO writeElement( pAppProps, XML_Manager, "manager" ); - writeElement( pAppProps, XML_Pages, "pages" ); - writeElement( pAppProps, XML_Words, "words" ); - writeElement( pAppProps, XML_Characters, "characters" ); writeElement( pAppProps, XML_PresentationFormat, "presentation format" ); writeElement( pAppProps, XML_Lines, "lines" ); writeElement( pAppProps, XML_Slides, "slides" ); @@ -681,10 +678,33 @@ writeAppProperties( XmlFilterBase& rSelf, Reference< XDocumentProperties > xProp #endif /* def OOXTODO */ comphelper::SequenceAsHashMap aStats = xProperties->getDocumentStatistics(); - comphelper::SequenceAsHashMap::iterator it = aStats.find("ParagraphCount"); + comphelper::SequenceAsHashMap::iterator it; + sal_Int32 nValue = 0; + + it = aStats.find("PageCount"); + if (it != aStats.end()) + { + if (it->second >>= nValue) + writeElement(pAppProps, XML_Pages, nValue); + } + + it = aStats.find("WordCount"); + if (it != aStats.end()) + { + if (it->second >>= nValue) + writeElement(pAppProps, XML_Words, nValue); + } + + it = aStats.find("CharacterCount"); + if (it != aStats.end()) + { + if (it->second >>= nValue) + writeElement(pAppProps, XML_Characters, nValue); + } + + it = aStats.find("ParagraphCount"); if (it != aStats.end()) { - sal_Int32 nValue = 0; if (it->second >>= nValue) writeElement(pAppProps, XML_Paragraphs, nValue); } |