diff options
-rw-r--r-- | oox/source/core/xmlfilterbase.cxx | 17 | ||||
-rw-r--r-- | sw/qa/extras/ooxmlexport/data/zoom.docx | bin | 10825 -> 10625 bytes | |||
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlexport.cxx | 1 |
3 files changed, 17 insertions, 1 deletions
diff --git a/oox/source/core/xmlfilterbase.cxx b/oox/source/core/xmlfilterbase.cxx index af0567b5c8e1..acc8805ab330 100644 --- a/oox/source/core/xmlfilterbase.cxx +++ b/oox/source/core/xmlfilterbase.cxx @@ -21,6 +21,7 @@ #include <cstdio> #include <set> +#include <com/sun/star/beans/XPropertyAccess.hpp> #include <com/sun/star/container/XNameContainer.hpp> #include <com/sun/star/embed/XRelationshipAccess.hpp> #include <com/sun/star/xml/sax/InputSource.hpp> @@ -637,7 +638,6 @@ writeAppProperties( XmlFilterBase& rSelf, Reference< XDocumentProperties > xProp writeElement( pAppProps, XML_Template, xProperties->getTemplateName() ); #ifdef OOXTODO writeElement( pAppProps, XML_Manager, "manager" ); - writeElement( pAppProps, XML_Company, "company" ); writeElement( pAppProps, XML_Pages, "pages" ); writeElement( pAppProps, XML_Words, "words" ); writeElement( pAppProps, XML_Characters, "characters" ); @@ -681,6 +681,21 @@ writeAppProperties( XmlFilterBase& rSelf, Reference< XDocumentProperties > xProp } } + 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) + { + if (aUserDefinedProperties[i].Name == "Company") + { + OUString aValue; + if (aUserDefinedProperties[i].Value >>= aValue) + { + writeElement(pAppProps, XML_Company, aValue); + break; + } + } + } + pAppProps->endElement( XML_Properties ); } diff --git a/sw/qa/extras/ooxmlexport/data/zoom.docx b/sw/qa/extras/ooxmlexport/data/zoom.docx Binary files differindex a61069f48c04..ce93a1a9bb75 100644 --- a/sw/qa/extras/ooxmlexport/data/zoom.docx +++ b/sw/qa/extras/ooxmlexport/data/zoom.docx diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx index 2ef916055926..e7934b2e79c4 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx @@ -99,6 +99,7 @@ DECLARE_OOXMLEXPORT_TEST(testZoom, "zoom.docx") pXmlDoc = parseExport("docProps/app.xml"); // One paragraph in the document. assertXPathContent(pXmlDoc, "/extended-properties:Properties/extended-properties:Paragraphs", "1"); + assertXPathContent(pXmlDoc, "/extended-properties:Properties/extended-properties:Company", "Example Ltd"); } DECLARE_OOXMLEXPORT_TEST(defaultTabStopNotInStyles, "empty.odt") |