tdf#144244: sc_uicalc: Add unittest
Change-Id: I4445152d8bcba0b571873a39c98936a4fcd207f6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125872 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
This commit is contained in:
BIN
sc/qa/unit/uicalc/data/tdf144244.ods
Normal file
BIN
sc/qa/unit/uicalc/data/tdf144244.ods
Normal file
Binary file not shown.
@@ -345,6 +345,34 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf145085)
|
||||
CPPUNIT_ASSERT_EQUAL(OUString(""), pDoc->GetString(ScAddress(0, 1, 0)));
|
||||
}
|
||||
|
||||
CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf144244)
|
||||
{
|
||||
ScModelObj* pModelObj = createDoc("tdf144244.ods");
|
||||
ScDocument* pDoc = pModelObj->GetDocument();
|
||||
CPPUNIT_ASSERT(pDoc);
|
||||
|
||||
uno::Reference<drawing::XDrawPage> xPage(pModelObj->getDrawPages()->getByIndex(0),
|
||||
uno::UNO_QUERY_THROW);
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(2), xPage->getCount());
|
||||
|
||||
// Select column A and B
|
||||
goToCell("A:B");
|
||||
|
||||
dispatchCommand(mxComponent, ".uno:DeleteColumns", {});
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL(OUString("x"), pDoc->GetString(ScAddress(0, 0, 0)));
|
||||
|
||||
// Without the fix in place, this test would have crashed
|
||||
pModelObj = saveAndReload(mxComponent, "calc8");
|
||||
pDoc = pModelObj->GetDocument();
|
||||
CPPUNIT_ASSERT(pDoc);
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL(OUString("x"), pDoc->GetString(ScAddress(0, 0, 0)));
|
||||
|
||||
xPage.set(pModelObj->getDrawPages()->getByIndex(0), uno::UNO_QUERY_THROW);
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(2), xPage->getCount());
|
||||
}
|
||||
|
||||
CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf100582)
|
||||
{
|
||||
ScModelObj* pModelObj = createDoc("tdf100582.xls");
|
||||
|
Reference in New Issue
Block a user