diff options
author | Zolnai Tamás <tamas.zolnai@collabora.com> | 2014-01-03 15:21:32 +0100 |
---|---|---|
committer | Zolnai Tamás <tamas.zolnai@collabora.com> | 2014-01-03 16:43:03 +0100 |
commit | 5969eec0e998804eba77338b17de90737e2acb43 (patch) | |
tree | fad8f58b2af7261d6ab4bf791bf29ebd99a7c1cf /sw/qa/extras/ww8export | |
parent | 0127e3dbabaf24c6c0d828e6d26357ff0b63c3fb (diff) |
cp#2013101510000026: doc export of commented text ranges
Change-Id: I2d31da5d659edcbebc682d5604d2db24b5e341fb
Diffstat (limited to 'sw/qa/extras/ww8export')
-rw-r--r-- | sw/qa/extras/ww8export/data/fdo59530.doc | bin | 0 -> 9728 bytes | |||
-rw-r--r-- | sw/qa/extras/ww8export/ww8export.cxx | 25 |
2 files changed, 25 insertions, 0 deletions
diff --git a/sw/qa/extras/ww8export/data/fdo59530.doc b/sw/qa/extras/ww8export/data/fdo59530.doc Binary files differnew file mode 100644 index 000000000000..60cfe840a787 --- /dev/null +++ b/sw/qa/extras/ww8export/data/fdo59530.doc diff --git a/sw/qa/extras/ww8export/ww8export.cxx b/sw/qa/extras/ww8export/ww8export.cxx index 257510bcfbad..c835c59ef221 100644 --- a/sw/qa/extras/ww8export/ww8export.cxx +++ b/sw/qa/extras/ww8export/ww8export.cxx @@ -150,6 +150,31 @@ DECLARE_WW8EXPORT_TEST(testCharacterBorder, "charborder.odt") } } +DECLARE_WW8EXPORT_TEST(testFdo59530, "fdo59530.doc") +{ + // See ooxmlexport's testFdo38244(). + // Test comment range feature. + uno::Reference<text::XTextDocument> xTextDocument(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XEnumerationAccess> xParaEnumAccess(xTextDocument->getText(), uno::UNO_QUERY); + uno::Reference<container::XEnumeration> xParaEnum = xParaEnumAccess->createEnumeration(); + uno::Reference<container::XEnumerationAccess> xRunEnumAccess(xParaEnum->nextElement(), uno::UNO_QUERY); + uno::Reference<container::XEnumeration> xRunEnum = xRunEnumAccess->createEnumeration(); + xRunEnum->nextElement(); + uno::Reference<beans::XPropertySet> xPropertySet(xRunEnum->nextElement(), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(OUString("TextFieldStart"), getProperty<OUString>(xPropertySet, "TextPortionType")); + xRunEnum->nextElement(); + xRunEnum->nextElement(); + xPropertySet.set(xRunEnum->nextElement(), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(OUString("TextFieldEnd"), getProperty<OUString>(xPropertySet, "TextPortionType")); + + // Test initials. + uno::Reference<text::XTextFieldsSupplier> xTextFieldsSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XEnumerationAccess> xFieldsAccess(xTextFieldsSupplier->getTextFields()); + uno::Reference<container::XEnumeration> xFields(xFieldsAccess->createEnumeration()); + xPropertySet.set(xFields->nextElement(), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(OUString("M"), getProperty<OUString>(xPropertySet, "Initials")); +} + #endif CPPUNIT_PLUGIN_IMPLEMENT(); |