tdf#134675: sc_uicalc: Add unittest
Change-Id: Ie76152ca1b1b80d60fcd891548c5eb4f32bcb40c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116033
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
diff --git a/sc/qa/unit/uicalc/uicalc.cxx b/sc/qa/unit/uicalc/uicalc.cxx
index e86bfbf..aa5d8b5 100644
--- a/sc/qa/unit/uicalc/uicalc.cxx
+++ b/sc/qa/unit/uicalc/uicalc.cxx
@@ -1566,6 +1566,36 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf123202)
CPPUNIT_ASSERT(pDoc->RowHidden(2, 0));
}
CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf134675)
{
mxComponent = loadFromDesktop("private:factory/scalc");
ScModelObj* pModelObj = dynamic_cast<ScModelObj*>(mxComponent.get());
CPPUNIT_ASSERT(pModelObj);
ScDocument* pDoc = pModelObj->GetDocument();
CPPUNIT_ASSERT(pDoc);
insertStringToCell(*pModelObj, "A1", "A");
// Select column A
goToCell("A:A");
dispatchCommand(mxComponent, ".uno:Copy", {});
Scheduler::ProcessEventsToIdle();
// Select column B to Z
goToCell("B:Z");
dispatchCommand(mxComponent, ".uno:Paste", {});
Scheduler::ProcessEventsToIdle();
for (size_t i = 1; i < 24; ++i)
{
// Without the fix in place, this test would have failed here with
// - Expected: A
// - Actual :
CPPUNIT_ASSERT_EQUAL(OUString("A"), pDoc->GetString(ScAddress(i, 0, 0)));
}
}
CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf116215)
{
mxComponent = loadFromDesktop("private:factory/scalc");