diff options
author | Xisco Fauli <xiscofauli@libreoffice.org> | 2021-02-02 16:39:59 +0100 |
---|---|---|
committer | Xisco Fauli <xiscofauli@libreoffice.org> | 2021-02-02 21:26:32 +0100 |
commit | e99608ce752f34ddb6611146c6cf4643c97d62f3 (patch) | |
tree | d60469cdd69f44d7cd72a7055e57f2ceb579b67e /sc | |
parent | 2d084836102fdf3a486bd8c01f55ae0a5a673d10 (diff) |
tdf#97215: sc_uicalc: Add unittest
Change-Id: I829021d0ab5619317d831986309cab577499f278
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110326
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/qa/unit/uicalc/data/tdf97215.ods | bin | 0 -> 17828 bytes | |||
-rw-r--r-- | sc/qa/unit/uicalc/uicalc.cxx | 33 |
2 files changed, 33 insertions, 0 deletions
diff --git a/sc/qa/unit/uicalc/data/tdf97215.ods b/sc/qa/unit/uicalc/data/tdf97215.ods Binary files differnew file mode 100644 index 000000000000..e6b01a67b324 --- /dev/null +++ b/sc/qa/unit/uicalc/data/tdf97215.ods diff --git a/sc/qa/unit/uicalc/uicalc.cxx b/sc/qa/unit/uicalc/uicalc.cxx index 2d8d6389f907..5c42f7c61db4 100644 --- a/sc/qa/unit/uicalc/uicalc.cxx +++ b/sc/qa/unit/uicalc/uicalc.cxx @@ -140,6 +140,39 @@ ScModelObj* ScUiCalcTest::createDoc(const char* pName) return pModelObj; } +CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf97215) +{ + ScModelObj* pModelObj = createDoc("tdf97215.ods"); + ScDocument* pDoc = pModelObj->GetDocument(); + CPPUNIT_ASSERT(pDoc); + + // Enable sorting with update reference + ScModule* pMod = SC_MOD(); + ScInputOptions aInputOption = pMod->GetInputOptions(); + bool bOldStatus = aInputOption.GetSortRefUpdate(); + aInputOption.SetSortRefUpdate(true); + pMod->SetInputOptions(aInputOption); + + CPPUNIT_ASSERT_EQUAL(OUString("Inserted at bottom"), pDoc->GetString(ScAddress(0, 23, 0))); + + goToCell("A1:M24"); + + // Without the fix in place, this test would have hung here + dispatchCommand(mxComponent, ".uno:SortAscending", {}); + Scheduler::ProcessEventsToIdle(); + + CPPUNIT_ASSERT_EQUAL(OUString("Inserted at bottom"), pDoc->GetString(ScAddress(0, 0, 0))); + + dispatchCommand(mxComponent, ".uno:Undo", {}); + Scheduler::ProcessEventsToIdle(); + + CPPUNIT_ASSERT_EQUAL(OUString("Inserted at bottom"), pDoc->GetString(ScAddress(0, 23, 0))); + + // Restore previous status + aInputOption.SetSortRefUpdate(bOldStatus); + pMod->SetInputOptions(aInputOption); +} + CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf92963) { ScModelObj* pModelObj = createDoc("tdf92963.ods"); |