summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXisco Fauli <xiscofauli@libreoffice.org>2021-02-02 17:33:52 +0100
committerXisco Fauli <xiscofauli@libreoffice.org>2021-02-02 20:47:54 +0100
commit4c95b7415340b07fd94e8f374aa2dfbb070783f8 (patch)
tree3f6397e2fe789ae3d0113c5ab0540433d47488b9
parentdec14c4a074b4e4b156b932155e73647d6ebd519 (diff)
tdf#84762: sc_subsequent_filters: Add unittest
Change-Id: I54f7b65628c40922eeb9159435f94e675f3c888a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110329 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
-rw-r--r--sc/qa/unit/subsequent_filters-test.cxx36
1 files changed, 36 insertions, 0 deletions
diff --git a/sc/qa/unit/subsequent_filters-test.cxx b/sc/qa/unit/subsequent_filters-test.cxx
index 7ceee84f63ae..89a5eb084244 100644
--- a/sc/qa/unit/subsequent_filters-test.cxx
+++ b/sc/qa/unit/subsequent_filters-test.cxx
@@ -227,6 +227,7 @@ public:
void testCopyMergedNumberFormats();
void testVBAUserFunctionXLSM();
void testEmbeddedImageXLS();
+ void testTdf84762();
void testTdf44076();
void testEditEngStrikeThroughXLSX();
void testRefStringXLSX();
@@ -413,6 +414,7 @@ public:
CPPUNIT_TEST(testVBAUserFunctionXLSM);
CPPUNIT_TEST(testEmbeddedImageXLS);
CPPUNIT_TEST(testErrorOnExternalReferences);
+ CPPUNIT_TEST(testTdf84762);
CPPUNIT_TEST(testTdf44076);
CPPUNIT_TEST(testEditEngStrikeThroughXLSX);
CPPUNIT_TEST(testRefStringXLSX);
@@ -3704,6 +3706,40 @@ void ScFiltersTest::testErrorOnExternalReferences()
xDocSh->DoClose();
}
+void ScFiltersTest::testTdf84762()
+{
+ ScDocShellRef xDocSh = loadDoc(u"blank.", FORMAT_ODS);
+ CPPUNIT_ASSERT_MESSAGE("Failed to open empty doc", xDocSh.is());
+
+ ScDocument& rDoc = xDocSh->GetDocument();
+
+ rDoc.SetString(ScAddress(0,0,0), "=RAND()");
+ rDoc.SetString(ScAddress(0,1,0), "=RAND()");
+ rDoc.SetString(ScAddress(1,0,0), "=RAND()*A1");
+ rDoc.SetString(ScAddress(1,1,0), "=RAND()*B1");
+
+ double nValA1, nValB1, nValA2, nValB2;
+
+ // Without the fix in place, some cells wouldn't have been updated
+ // after using F9 a few times
+ for(sal_Int16 i = 0; i < 10; ++i)
+ {
+ nValA1 = rDoc.GetValue(0, 0, 0);
+ nValB1 = rDoc.GetValue(0, 1, 0);
+ nValA2 = rDoc.GetValue(1, 0, 0);
+ nValB2 = rDoc.GetValue(1, 1, 0);
+
+ xDocSh->DoRecalc(false);
+
+ CPPUNIT_ASSERT(nValA1 != rDoc.GetValue(0, 0, 0));
+ CPPUNIT_ASSERT(nValA2 != rDoc.GetValue(0, 1, 0));
+ CPPUNIT_ASSERT(nValB1 != rDoc.GetValue(1, 0, 0));
+ CPPUNIT_ASSERT(nValB2 != rDoc.GetValue(1, 1, 0));
+ }
+
+ xDocSh->DoClose();
+}
+
void ScFiltersTest::testTdf44076()
{
ScDocShellRef xDocSh = loadDoc(u"blank.", FORMAT_ODS);