summaryrefslogtreecommitdiff
path: root/sw/qa
diff options
context:
space:
mode:
authorSamuel Mehrbrodt <samuel.mehrbrodt@allotropia.de>2023-03-06 17:00:10 +0100
committerSamuel Mehrbrodt <samuel.mehrbrodt@allotropia.de>2023-03-13 20:12:52 +0000
commitc132a1abd57c109331191c3b3fbd14e1c5e46631 (patch)
tree15ce5a83d289b3c51a7681fcc959775d92997d05 /sw/qa
parent758050caa06bd742dddea55fb29b0eec1b2309e4 (diff)
Always update fields when loading document
to make sure that table formulas are re-evaluated after loading. When a document has a wrong sum saved (which seems to happen sometimes), this sum is used until user clicks into the table or otherwise refreshes the formula. Change-Id: I5cc3f983524b395089c17aa35d8641847a388bad Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148355 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt <samuel.mehrbrodt@allotropia.de>
Diffstat (limited to 'sw/qa')
-rw-r--r--sw/qa/core/accessibilitycheck/AccessibilityCheckTest.cxx7
-rw-r--r--sw/qa/extras/odfimport/data/incorrectsum.odtbin0 -> 17356 bytes
-rw-r--r--sw/qa/extras/odfimport/odfimport.cxx13
3 files changed, 14 insertions, 6 deletions
diff --git a/sw/qa/core/accessibilitycheck/AccessibilityCheckTest.cxx b/sw/qa/core/accessibilitycheck/AccessibilityCheckTest.cxx
index 235a5ccaf757..d24a0922b73e 100644
--- a/sw/qa/core/accessibilitycheck/AccessibilityCheckTest.cxx
+++ b/sw/qa/core/accessibilitycheck/AccessibilityCheckTest.cxx
@@ -273,12 +273,7 @@ CPPUNIT_TEST_FIXTURE(AccessibilityCheckTest, testOnlineNodeSplitAppend)
Scheduler::ProcessEventsToIdle();
- CPPUNIT_ASSERT_EQUAL(sal_Int32(0),
- pDoc->getOnlineAccessibilityCheck()->getNumberOfAccessibilityIssues());
- // Trigger a11y checker
- pWrtShell->Down(/*bSelect*/ false, /*nCount*/ 0);
-
- // Check we have 1 a11y issue
+ // Check we have 2 a11y issue
CPPUNIT_ASSERT_EQUAL(sal_Int32(2),
pDoc->getOnlineAccessibilityCheck()->getNumberOfAccessibilityIssues());
auto aIssues = scanAccessibilityIssuesOnNodes(pDoc);
diff --git a/sw/qa/extras/odfimport/data/incorrectsum.odt b/sw/qa/extras/odfimport/data/incorrectsum.odt
new file mode 100644
index 000000000000..0e1e99b0d699
--- /dev/null
+++ b/sw/qa/extras/odfimport/data/incorrectsum.odt
Binary files differ
diff --git a/sw/qa/extras/odfimport/odfimport.cxx b/sw/qa/extras/odfimport/odfimport.cxx
index cc84c5c16fb5..227814045ad5 100644
--- a/sw/qa/extras/odfimport/odfimport.cxx
+++ b/sw/qa/extras/odfimport/odfimport.cxx
@@ -46,6 +46,7 @@
#include <comphelper/propertysequence.hxx>
#include <comphelper/propertyvalue.hxx>
#include <editeng/boxitem.hxx>
+#include <vcl/scheduler.hxx>
#include <IDocumentSettingAccess.hxx>
#include <wrtsh.hxx>
@@ -596,6 +597,18 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo56272)
CPPUNIT_ASSERT_EQUAL(sal_Int32(422), xShape->getPosition().Y); // Was -2371
}
+CPPUNIT_TEST_FIXTURE(Test, testIncorrectSum)
+{
+ createSwDoc("incorrectsum.odt");
+ Scheduler::ProcessEventsToIdle();
+ uno::Reference<text::XTextTablesSupplier> xTablesSupplier(mxComponent, uno::UNO_QUERY);
+ uno::Reference<container::XIndexAccess> xTables(xTablesSupplier->getTextTables( ), uno::UNO_QUERY);
+ uno::Reference<text::XTextTable> xTextTable(xTables->getByIndex(0), uno::UNO_QUERY);
+ uno::Reference<text::XTextRange> xCell(xTextTable->getCellByName("C3"), uno::UNO_QUERY);
+ // Use indexOf instead of exact match since the result contains an Euro sign which OUString doesn't like
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(0), xCell->getString().indexOf("1,278"));
+}
+
CPPUNIT_TEST_FIXTURE(Test, testTdf128737)
{
createSwDoc("tdf128737.odt");