summaryrefslogtreecommitdiff
path: root/sc/qa/unit/uicalc
diff options
context:
space:
mode:
authorXisco Fauli <xiscofauli@libreoffice.org>2021-08-23 18:51:11 +0200
committerXisco Fauli <xiscofauli@libreoffice.org>2021-08-24 09:24:19 +0200
commit39a11e3287febeb9dd56f43da6f6612afeb0f512 (patch)
treeaa031aceb22a295bb32629ac93d848a0b17deaa3 /sc/qa/unit/uicalc
parent48c2f0b4b157e133605c99549893521775ede4da (diff)
tdf#143979: sc_uicalc: Add unittest
Change-Id: I0c51e69521a290bb13e39f592a45b9d94634ad3e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120911 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'sc/qa/unit/uicalc')
-rw-r--r--sc/qa/unit/uicalc/data/tdf143979.odsbin0 -> 17683 bytes
-rw-r--r--sc/qa/unit/uicalc/uicalc.cxx24
2 files changed, 24 insertions, 0 deletions
diff --git a/sc/qa/unit/uicalc/data/tdf143979.ods b/sc/qa/unit/uicalc/data/tdf143979.ods
new file mode 100644
index 000000000000..0ebc22d62ff7
--- /dev/null
+++ b/sc/qa/unit/uicalc/data/tdf143979.ods
Binary files differ
diff --git a/sc/qa/unit/uicalc/uicalc.cxx b/sc/qa/unit/uicalc/uicalc.cxx
index 034df5aa3e7d..b7f272883fe9 100644
--- a/sc/qa/unit/uicalc/uicalc.cxx
+++ b/sc/qa/unit/uicalc/uicalc.cxx
@@ -1739,6 +1739,30 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf126540_GridToggleModifiesTheDocument)
CPPUNIT_ASSERT(pDocSh->IsModified());
}
+CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf143979)
+{
+ ScModelObj* pModelObj = createDoc("tdf143979.ods");
+ ScDocument* pDoc = pModelObj->GetDocument();
+ CPPUNIT_ASSERT(pDoc);
+
+ goToCell("A5:B79");
+
+ dispatchCommand(mxComponent, ".uno:Copy", {});
+ Scheduler::ProcessEventsToIdle();
+
+ goToCell("D5");
+
+ //Without the fix in place, this test would have crashed
+ dispatchCommand(mxComponent, ".uno:PasteTransposed", {});
+ Scheduler::ProcessEventsToIdle();
+
+ for (size_t i = 3; i < 76; ++i)
+ {
+ OUString sExpected = "A" + OUString::number(i + 2);
+ CPPUNIT_ASSERT_EQUAL(sExpected, pDoc->GetString(ScAddress(i, 4, 0)));
+ }
+}
+
CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf126926)
{
mxComponent = loadFromDesktop("private:factory/scalc");