summaryrefslogtreecommitdiff
path: root/sc/qa/unit
diff options
context:
space:
mode:
authorXisco Fauli <xiscofauli@libreoffice.org>2022-03-22 13:27:35 +0100
committerXisco Fauli <xiscofauli@libreoffice.org>2022-03-22 14:20:47 +0100
commit7bc16436e28153dfdd01e8d49cd193f62098476c (patch)
tree5b5e021aaed51f35702fb8942169938bdeb44908 /sc/qa/unit
parent721c4faa50d12bb5bbff27cb9fb0c3beca8a5886 (diff)
tdf#108292: sc_uicalc: Add unittest
Change-Id: I0543b0ce1914ff5d69370802b65da311c37111f5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131935 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'sc/qa/unit')
-rw-r--r--sc/qa/unit/uicalc/data/tdf108292.odsbin0 -> 25216 bytes
-rw-r--r--sc/qa/unit/uicalc/uicalc.cxx28
2 files changed, 28 insertions, 0 deletions
diff --git a/sc/qa/unit/uicalc/data/tdf108292.ods b/sc/qa/unit/uicalc/data/tdf108292.ods
new file mode 100644
index 000000000000..6f698fb71264
--- /dev/null
+++ b/sc/qa/unit/uicalc/data/tdf108292.ods
Binary files differ
diff --git a/sc/qa/unit/uicalc/uicalc.cxx b/sc/qa/unit/uicalc/uicalc.cxx
index 69282fcd0661..aff4574845da 100644
--- a/sc/qa/unit/uicalc/uicalc.cxx
+++ b/sc/qa/unit/uicalc/uicalc.cxx
@@ -1150,6 +1150,34 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf117706)
CPPUNIT_ASSERT_EQUAL(OUString(""), pDoc->GetString(ScAddress(0, 2, 0)));
}
+CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf108292)
+{
+ ScModelObj* pModelObj = createDoc("tdf108292.ods");
+ ScDocument* pDoc = pModelObj->GetDocument();
+ CPPUNIT_ASSERT(pDoc);
+
+ dispatchCommand(mxComponent, ".uno:SelectAll", {});
+ Scheduler::ProcessEventsToIdle();
+
+ dispatchCommand(mxComponent, ".uno:Copy", {});
+ Scheduler::ProcessEventsToIdle();
+
+ mxComponent->dispose();
+
+ // Open a new document
+ mxComponent = loadFromDesktop("private:factory/scalc");
+ pModelObj = dynamic_cast<ScModelObj*>(mxComponent.get());
+ CPPUNIT_ASSERT(pModelObj);
+ pDoc = pModelObj->GetDocument();
+ CPPUNIT_ASSERT(pDoc);
+
+ // Without the fix in place, this test would have crashed
+ dispatchCommand(mxComponent, ".uno:Paste", {});
+ Scheduler::ProcessEventsToIdle();
+
+ CPPUNIT_ASSERT_EQUAL(OUString("2D"), pDoc->GetString(ScAddress(26, 0, 0)));
+}
+
// Inspired from testTdf117706, test columns instead of rows
CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testMultiRangeCol)
{