diff options
Diffstat (limited to 'sw/qa/extras/uiwriter')
-rwxr-xr-x | sw/qa/extras/uiwriter/data/tdf91801.fodt | 21 | ||||
-rw-r--r-- | sw/qa/extras/uiwriter/uiwriter.cxx | 11 |
2 files changed, 32 insertions, 0 deletions
diff --git a/sw/qa/extras/uiwriter/data/tdf91801.fodt b/sw/qa/extras/uiwriter/data/tdf91801.fodt new file mode 100755 index 000000000000..4d5486f71bbb --- /dev/null +++ b/sw/qa/extras/uiwriter/data/tdf91801.fodt @@ -0,0 +1,21 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<office:document xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0" xmlns:ooow="http://openoffice.org/2004/writer" office:version="1.2" office:mimetype="application/vnd.oasis.opendocument.text"> + <office:body> + <office:text> + <text:user-field-decls> + <text:user-field-decl office:value-type="float" office:value="111" text:name="aaa"/> + <text:user-field-decl office:value-type="float" office:value="222" text:name="bbb"/> + </text:user-field-decls> + <table:table table:name="Table1"> + <table:table-column/> + <table:table-row> + <table:table-cell table:formula="ooow:aaa+bbb*2" office:value-type="float" office:value="111"> + <text:p>111</text:p> + </table:table-cell> + </table:table-row> + </table:table> + <text:p/> + </office:text> + </office:body> +</office:document>
\ No newline at end of file diff --git a/sw/qa/extras/uiwriter/uiwriter.cxx b/sw/qa/extras/uiwriter/uiwriter.cxx index 924ff04f6911..d2086048ad94 100644 --- a/sw/qa/extras/uiwriter/uiwriter.cxx +++ b/sw/qa/extras/uiwriter/uiwriter.cxx @@ -342,6 +342,7 @@ public: void testHtmlCopyImages(); void testTdf116789(); void testTdf117225(); + void testTdf91801(); CPPUNIT_TEST_SUITE(SwUiWriterTest); CPPUNIT_TEST(testReplaceForward); @@ -535,6 +536,7 @@ public: CPPUNIT_TEST(testHtmlCopyImages); CPPUNIT_TEST(testTdf116789); CPPUNIT_TEST(testTdf117225); + CPPUNIT_TEST(testTdf91801); CPPUNIT_TEST_SUITE_END(); private: @@ -6232,6 +6234,15 @@ void SwUiWriterTest::testTdf117225() CPPUNIT_ASSERT_EQUAL(nExpected, nActual); } +void SwUiWriterTest::testTdf91801() +{ + // Tests calculation with several user field variables without prior user fields + createDoc("tdf91801.fodt"); + uno::Reference<text::XTextTable> xTable(getParagraphOrTable(1), uno::UNO_QUERY); + uno::Reference<table::XCell> xCell(xTable->getCellByName("A1")); + CPPUNIT_ASSERT_EQUAL(555.0, xCell->getValue()); +} + CPPUNIT_TEST_SUITE_REGISTRATION(SwUiWriterTest); CPPUNIT_PLUGIN_IMPLEMENT(); |