oox/source/core/xmlfilterbase.cxx | 30 +++++++++++++++++++++++++----- 1 file changed, 25 insertions(+), 5 deletions(-)
New commits: commit 8beea0f6b43b9fe893418687a75d28a6d624ede7 Author: alexey.chemichev <[email protected]> Date: Wed Nov 18 13:11:18 2015 -0500 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 <[email protected]> Tested-by: Jenkins <[email protected]> Reviewed-by: Michael Stahl <[email protected]> diff --git a/oox/source/core/xmlfilterbase.cxx b/oox/source/core/xmlfilterbase.cxx index f140d1d..a89cc9d 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); } _______________________________________________ Libreoffice-commits mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
