summaryrefslogtreecommitdiff
path: root/sw/qa
diff options
context:
space:
mode:
Diffstat (limited to 'sw/qa')
-rw-r--r--sw/qa/extras/uiwriter/data/tdf151993.docxbin0 -> 11913 bytes
-rw-r--r--sw/qa/extras/uiwriter/uiwriter8.cxx31
2 files changed, 30 insertions, 1 deletions
diff --git a/sw/qa/extras/uiwriter/data/tdf151993.docx b/sw/qa/extras/uiwriter/data/tdf151993.docx
new file mode 100644
index 000000000000..462feb0a61e4
--- /dev/null
+++ b/sw/qa/extras/uiwriter/data/tdf151993.docx
Binary files differ
diff --git a/sw/qa/extras/uiwriter/uiwriter8.cxx b/sw/qa/extras/uiwriter/uiwriter8.cxx
index 83698fa36a18..e6b5d0dad60c 100644
--- a/sw/qa/extras/uiwriter/uiwriter8.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter8.cxx
@@ -1400,7 +1400,8 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest8, testTdf146573)
CPPUNIT_TEST_FIXTURE(SwUiWriterTest8, testTdf148799)
{
- // load a document with table formulas with comma delimiter
+ // load a document with table formulas with comma delimiter,
+ // but with a document language with default point delimiter
createSwDoc("tdf148799.docx");
SwDoc* pDoc = getSwDoc();
SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell();
@@ -1430,6 +1431,34 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest8, testTdf148799)
CPPUNIT_ASSERT_EQUAL(OUString("23684.5"), xCellA4->getString());
}
+CPPUNIT_TEST_FIXTURE(SwUiWriterTest8, testTdf151993)
+{
+ // load a document with table formulas with comma delimiter
+ // (with a document language with default comma delimiter)
+ createSwDoc("tdf151993.docx");
+ SwDoc* pDoc = getSwDoc();
+ SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell();
+
+ // check formula update
+
+ // put cursor in the first table row
+ pWrtShell->Down(/*bSelect=*/false, /*nCount=*/1);
+
+ uno::Reference<text::XTextTablesSupplier> xTextTablesSupplier(mxComponent, uno::UNO_QUERY);
+ uno::Reference<container::XIndexAccess> xTables(xTextTablesSupplier->getTextTables(),
+ uno::UNO_QUERY);
+
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xTables->getCount());
+
+ uno::Reference<text::XTextTable> xTextTable(xTables->getByIndex(0), uno::UNO_QUERY);
+
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(2), xTextTable->getRows()->getCount());
+
+ // This was 0
+ uno::Reference<text::XTextRange> xCellA1(xTextTable->getCellByName("A2"), uno::UNO_QUERY);
+ CPPUNIT_ASSERT_EQUAL(OUString("30"), xCellA1->getString());
+}
+
CPPUNIT_TEST_FIXTURE(SwUiWriterTest8, testTdf148849)
{
// load a document with a table and an empty paragraph before the table