summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
Diffstat (limited to 'sw')
-rw-r--r--sw/qa/extras/ooxmlexport/data/tdf123356.docxbin0 -> 41063 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport15.cxx20
2 files changed, 20 insertions, 0 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/tdf123356.docx b/sw/qa/extras/ooxmlexport/data/tdf123356.docx
new file mode 100644
index 000000000000..9432ca2dbb06
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/tdf123356.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx
index ad96c19673c3..638a43761c76 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx
@@ -113,6 +113,26 @@ DECLARE_OOXMLEXPORT_TEST(testTdf123390, "tdf123390.docx")
CPPUNIT_ASSERT_EQUAL(OUString("1"), xEnumerationAccess2->getPresentation(false).trim());
}
+DECLARE_OOXMLEXPORT_TEST(testTdf123356, "tdf123356.docx")
+{
+ uno::Reference<text::XTextFieldsSupplier> xTextFieldsSupplier(mxComponent, uno::UNO_QUERY);
+ uno::Reference<container::XEnumerationAccess> xFieldsAccess(xTextFieldsSupplier->getTextFields());
+ uno::Reference<container::XEnumeration> xFields(xFieldsAccess->createEnumeration());
+
+ uno::Reference<text::XTextField> xEnumerationAccess1(xFields->nextElement(), uno::UNO_QUERY);
+ CPPUNIT_ASSERT_EQUAL(OUString("-11"), xEnumerationAccess1->getPresentation(true).trim());
+ CPPUNIT_ASSERT_EQUAL(OUString("-11"), xEnumerationAccess1->getPresentation(false).trim());
+
+ // Tests cell formula COUNT(x) to SUM(x)/MEAN(x) conversion
+ uno::Reference<text::XTextField> xEnumerationAccess4(xFields->nextElement(), uno::UNO_QUERY);
+ CPPUNIT_ASSERT_EQUAL(OUString("(SUM(<A1:C1>|<A2:B2>)/MEAN(<A1:C1>|<A2:B2>))"), xEnumerationAccess4->getPresentation(true).trim());
+ CPPUNIT_ASSERT_EQUAL(OUString("5"), xEnumerationAccess4->getPresentation(false).trim());
+
+ uno::Reference<text::XTextField> xEnumerationAccess3(xFields->nextElement(), uno::UNO_QUERY);
+ CPPUNIT_ASSERT_EQUAL(OUString("(SUM(<A1:C1>)/MEAN(<A1:C1>))"), xEnumerationAccess3->getPresentation(true).trim());
+ CPPUNIT_ASSERT_EQUAL(OUString("3"), xEnumerationAccess3->getPresentation(false).trim());
+}
+
DECLARE_OOXMLEXPORT_TEST(testTdf98000_changePageStyle, "tdf98000_changePageStyle.odt")
{
uno::Reference<frame::XModel> xModel(mxComponent, uno::UNO_QUERY);