Kaydet (Commit) 84a5720f authored tarafından Miklos Vajna's avatar Miklos Vajna

oox: write Company in docProps/app.xml

Change-Id: I8474b8ec7415b4d8e067343295ea985319c34834
üst aaedf141
......@@ -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 );
}
......
......@@ -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")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment