summaryrefslogtreecommitdiff
path: root/oox
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2014-07-18 14:36:15 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2014-07-18 15:10:51 +0200
commit84a5720f9ae42b98db99e0affd04b7d16ac742cd (patch)
treee3fb6781e650dd25030bb8285800e4908a58ae71 /oox
parentaaedf14175c841fa74340f9f0af19d722756628d (diff)
oox: write Company in docProps/app.xml
Change-Id: I8474b8ec7415b4d8e067343295ea985319c34834
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 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 );
}