summaryrefslogtreecommitdiff
path: root/sc/qa/unit
diff options
context:
space:
mode:
authorTünde Tóth <toth.tunde@nisz.hu>2023-04-26 15:31:46 +0200
committerLászló Németh <nemeth@numbertext.org>2023-04-27 18:58:32 +0200
commitb88d11ba05085002cf847d4828ded52a3dfb3b09 (patch)
tree1e4b921227f6a582524b7dfd7e23fc2c18961b40 /sc/qa/unit
parentfd79c5ed9b13516bdb0f2a29806296698ddda7b2 (diff)
tdf#152577 sc DBData: fix regression of database ranges
Regression from commit 0c0444c44107f1a18f23dd0833d462d8dbf56569 "tdf#126926 sc DBData: delete the database range". Change-Id: I04923decdc768770f98763e60cd295400d15c769 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151065 Tested-by: Jenkins Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org>
Diffstat (limited to 'sc/qa/unit')
-rw-r--r--sc/qa/unit/uicalc/uicalc2.cxx24
1 files changed, 24 insertions, 0 deletions
diff --git a/sc/qa/unit/uicalc/uicalc2.cxx b/sc/qa/unit/uicalc/uicalc2.cxx
index a09c9b8e20e9..69db567f305c 100644
--- a/sc/qa/unit/uicalc/uicalc2.cxx
+++ b/sc/qa/unit/uicalc/uicalc2.cxx
@@ -1395,6 +1395,30 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest2, testAutoSum)
CPPUNIT_ASSERT_EQUAL(OUString("=SUM(B207:D207)"), pDoc->GetFormula(4, 206, 0));
}
+CPPUNIT_TEST_FIXTURE(ScUiCalcTest2, testTdf152577)
+{
+ createScDoc();
+ ScDocument* pDoc = getScDoc();
+
+ insertStringToCell("A1", u"1");
+ insertStringToCell("A2", u"2");
+ insertStringToCell("B1", u"3");
+ insertStringToCell("B2", u"4");
+
+ ScDBData* pDBData = new ScDBData("testDB", 0, 0, 0, 1, 1);
+ bool bInserted
+ = pDoc->GetDBCollection()->getNamedDBs().insert(std::unique_ptr<ScDBData>(pDBData));
+ CPPUNIT_ASSERT(bInserted);
+
+ insertNewSheet(*pDoc);
+ uno::Sequence<beans::PropertyValue> aArgs(
+ comphelper::InitPropertySequence({ { "Index", uno::Any(sal_uInt16(2)) } }));
+ dispatchCommand(mxComponent, ".uno:Remove", aArgs);
+
+ ScDBCollection* pDBs = pDoc->GetDBCollection();
+ CPPUNIT_ASSERT(!pDBs->empty());
+}
+
CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */