diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2016-03-09 14:41:10 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2016-03-09 15:58:35 +0100 |
commit | 2e1a6ba26fd0cb251f831dd2a0f60103ca1342e2 (patch) | |
tree | c46ff15e539f9f4af53f321f2211395aa098ff12 /sw/qa/extras/rtfexport | |
parent | b8ad8bf2ca0c875f182b1776579fdcd95a8759a5 (diff) |
RTF export: write user-defined document properties
Change-Id: I07dfd626f7d248e264fd1724f6f2bd1241be39d0
Diffstat (limited to 'sw/qa/extras/rtfexport')
-rw-r--r-- | sw/qa/extras/rtfexport/data/custom-doc-props.rtf | 10 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/rtfexport.cxx | 10 |
2 files changed, 20 insertions, 0 deletions
diff --git a/sw/qa/extras/rtfexport/data/custom-doc-props.rtf b/sw/qa/extras/rtfexport/data/custom-doc-props.rtf new file mode 100644 index 000000000000..b36d864f2969 --- /dev/null +++ b/sw/qa/extras/rtfexport/data/custom-doc-props.rtf @@ -0,0 +1,10 @@ +{\rtf1 +{\*\userprops +{\propname urn:bails:IntellectualProperty:Authorization:StartValidity} +\proptype30 +{\staticval 2016-03-08T10:55:18,531376147} +{\propname urn:bails:IntellectualProperty:Authorization:StopValidity} +\proptype30 +{\staticval None} +} +} diff --git a/sw/qa/extras/rtfexport/rtfexport.cxx b/sw/qa/extras/rtfexport/rtfexport.cxx index 60a2293c99fb..24faee23a2f2 100644 --- a/sw/qa/extras/rtfexport/rtfexport.cxx +++ b/sw/qa/extras/rtfexport/rtfexport.cxx @@ -989,6 +989,16 @@ DECLARE_RTFEXPORT_TEST(testRedline, "redline.rtf") CPPUNIT_ASSERT_EQUAL(OUString("Dorothy Jones"), getProperty<OUString>(getRun(getParagraph(2), 2), "RedlineAuthor")); } +DECLARE_RTFEXPORT_TEST(testCustomDocProps, "custom-doc-props.rtf") +{ + // Custom document properties were not improved, this resulted in a beans::UnknownPropertyException. + uno::Reference<document::XDocumentPropertiesSupplier> xDocumentPropertiesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<document::XDocumentProperties> xDocumentProperties = xDocumentPropertiesSupplier->getDocumentProperties(); + uno::Reference<beans::XPropertyContainer> xUserDefinedProperties = xDocumentProperties->getUserDefinedProperties(); + CPPUNIT_ASSERT_EQUAL(OUString("2016-03-08T10:55:18,531376147"), getProperty<OUString>(xUserDefinedProperties, "urn:bails:IntellectualProperty:Authorization:StartValidity")); + CPPUNIT_ASSERT_EQUAL(OUString("None"), getProperty<OUString>(xUserDefinedProperties, "urn:bails:IntellectualProperty:Authorization:StopValidity")); +} + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |