diff options
author | Xisco Fauli <xiscofauli@libreoffice.org> | 2022-03-22 12:42:41 +0100 |
---|---|---|
committer | Xisco Fauli <xiscofauli@libreoffice.org> | 2022-03-22 15:58:48 +0100 |
commit | 1d1e89988d45564d17acc286ecfb8d59cddf94ce (patch) | |
tree | 746e95c872dd4124b08335446bf9629e1e1841fb /sc/qa/unit/uicalc | |
parent | 931ce5db280ab7c4ccd005cc43f08a693dc34e9f (diff) |
tdf#118983: sc_uicalc: Add unittest
Change-Id: I7d0e473136b4d57fbebf6c6477044a61e2fa39f3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131933
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/tdf118983.ods | bin | 0 -> 9157 bytes | |||
-rw-r--r-- | sc/qa/unit/uicalc/uicalc.cxx | 29 |
2 files changed, 29 insertions, 0 deletions
diff --git a/sc/qa/unit/uicalc/data/tdf118983.ods b/sc/qa/unit/uicalc/data/tdf118983.ods Binary files differnew file mode 100644 index 000000000000..3c10a7fd16ba --- /dev/null +++ b/sc/qa/unit/uicalc/data/tdf118983.ods diff --git a/sc/qa/unit/uicalc/uicalc.cxx b/sc/qa/unit/uicalc/uicalc.cxx index aff4574845da..a3a782aa9a19 100644 --- a/sc/qa/unit/uicalc/uicalc.cxx +++ b/sc/qa/unit/uicalc/uicalc.cxx @@ -2467,6 +2467,35 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf126540_GridToggleModifiesTheDocument) CPPUNIT_ASSERT(pDocSh->IsModified()); } +CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf118983) +{ + ScModelObj* pModelObj = createDoc("tdf118983.ods"); + ScDocument* pDoc = pModelObj->GetDocument(); + CPPUNIT_ASSERT(pDoc); + + css::uno::Reference<css::sheet::XGlobalSheetSettings> xGlobalSheetSettings + = css::sheet::GlobalSheetSettings::create(::comphelper::getProcessComponentContext()); + bool bOldValue = xGlobalSheetSettings->getExpandReferences(); + + xGlobalSheetSettings->setExpandReferences(true); + + const ScRangeData* pRD = pDoc->GetRangeName()->findByUpperName("TEST"); + CPPUNIT_ASSERT(pRD); + CPPUNIT_ASSERT_EQUAL(OUString("$Test.$A$3:$D$7"), pRD->GetSymbol()); + + //Select columns E to G + goToCell("E:G"); + + dispatchCommand(mxComponent, ".uno:InsertColumnsBefore", {}); + + // Without the fix in place, this test would have failed with + // - Expected: $Test.$A$3:$D$7 + // - Actual : $Test.$A$3:$G$7 + CPPUNIT_ASSERT_EQUAL(OUString("$Test.$A$3:$D$7"), pRD->GetSymbol()); + + xGlobalSheetSettings->setExpandReferences(bOldValue); +} + CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf144022) { ScModelObj* pModelObj = createDoc("tdf144022.ods"); |