summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorTünde Tóth <toth.tunde@nisz.hu>2023-04-26 15:31:46 +0200
committerAndras Timar <andras.timar@collabora.com>2023-05-13 20:05:28 +0200
commitc498b5cbd80013e0c5e1a7f8ba8fee25833e8396 (patch)
treea988b8f47cf6a3addaad05d66d3e2cde1fa8cf0e /sc
parent6d6d2e5a6de283010bf24898b19fde588ba197ae (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> Signed-off-by: Xisco Fauli <xiscofauli@libreoffice.org> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151159
Diffstat (limited to 'sc')
-rw-r--r--sc/qa/unit/uicalc/uicalc.cxx24
-rw-r--r--sc/source/core/tool/refupdat.cxx2
2 files changed, 24 insertions, 2 deletions
diff --git a/sc/qa/unit/uicalc/uicalc.cxx b/sc/qa/unit/uicalc/uicalc.cxx
index 25b4d0790383..19aa8a703943 100644
--- a/sc/qa/unit/uicalc/uicalc.cxx
+++ b/sc/qa/unit/uicalc/uicalc.cxx
@@ -3013,6 +3013,30 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testUnallocatedColumnsAttributes)
CPPUNIT_ASSERT_EQUAL_MESSAGE("font should be bold", WEIGHT_BOLD, aFont.GetWeight());
}
+CPPUNIT_TEST_FIXTURE(ScUiCalcTest, 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: */
diff --git a/sc/source/core/tool/refupdat.cxx b/sc/source/core/tool/refupdat.cxx
index 3fce7c714423..ef0902aab3f4 100644
--- a/sc/source/core/tool/refupdat.cxx
+++ b/sc/source/core/tool/refupdat.cxx
@@ -291,8 +291,6 @@ ScRefUpdateRes ScRefUpdate::Update( const ScDocument* pDoc, UpdateRefMode eUpdat
eRet = UR_INVALID;
theTab2 = theTab1;
}
- else if (bCut2 && theTab2 == 0)
- eRet = UR_INVALID;
else if ( bCut1 || bCut2 )
eRet = UR_UPDATED;
if ( bExp )